Logo Lanfrica

BettyOtchere/ghana-business-day-api

Domaine:

digital infrastructure

Type de record:

software
Créateur:
Bet
Hôte:
REST API for Ghana business-day calculations, containerized with Docker and shipped via a GitHub Actions CI/CD pipeline to GHCR # Ghana Business Day API A REST API that determines whether a given date is a business day in Ghana, accounting for weekends and public holidays, containerized with Docker and published automatically through a GitHub Actions CI/CD pipeline to GitHub Container Registry (GHCR). ## Why this exists Businesses handling payment terms, delivery windows, or deadlines need to know whether a date is an actual working day, not just a weekday. This API answers that using real date logic rather than a static lookup table. ## Endpoints | Endpoint | Description | |---|---| | GET /health | Service health check | | GET /holidays?year=2026 | List of Ghana public holidays for that year | | GET /is-business-day?date=2026-07-28 | Whether the date is a business day, and why | | GET /next-business-day?date=2026-07-28 | The next business day after the given date | ## Holiday logic and its limitation Fixed-date holidays are hardcoded. Good Friday and Easter Monday are calculated with the Anonymous Gregorian Easter algorithm. Farmers' Day is calculated as the first Friday of December. Eid al-Fitr and Eid al-Adha are intentionally excluded, they follow the Islamic lunar calendar and are confirmed close to the date each year, so they cannot be reliably precomputed. ## Run it with Docker ``` docker pull ghcr.io docker run -p 3000:3000 ghcr.io ``` ## Run it locally without Docker ``` npm install npm start ``` ## Run the tests ``` npm test ``` ## CI/CD pipeline Every push and pull request against main triggers automated tests. On a successful push to main, the pipeline builds a multi-stage Docker image, scans it for known vulnerabilities with Trivy, and publishes it to GitHub Container Registry, tagged with both the commit SHA and latest. ## Screenshots ### Holiday lookup ### Business day check ### Running locally in Docker ### CI/CD pipeline passing ### Published image verified pullable ## …