Logo Lanfrica

kevinIsomMoringa/AT-notification-microservice

Domaine:

digital infrastructure

Type de record:

software
Créateur:
kev
Hôte:
A unified notification API and reusable Africa's Talking microservice that routes messages through SMS, Email, and WhatsApp. Provides a single communication layer with delivery tracking, retries, templates, and channel routing for multiple applications. # Africa's Talking Notification Microservice A single API that front-end apps call to send a notification — the service figures out *how* to deliver it (SMS, Email, or WhatsApp) and talks to the right provider behind the scenes. Built to demo **Africa's Talking** for SMS, with Email (SMTP) and WhatsApp (Twilio) wired up alongside it so the architecture reads as a real omni-channel notification service, not a single-purpose SMS script. Requests are accepted immediately and processed asynchronously: the API returns `202 Accepted` with a job ID while an in-process worker sends through the provider, retries on failure, and appends delivery events to a local log file. **API documentation:** Swagger UI · OpenAPI JSON · Diagnostics · All routes (below) --- ## Quick start (beginning to end) ### 1. Prerequisites - **Node.js 20+** and **npm** - (Optional) Provider accounts for the channels you want to test: - Africa's Talking — SMS - Any SMTP provider — Email - Twilio — WhatsApp ### 2. Install dependencies ```bash git clone cd AT-notification-microservice npm install ``` ### 3. Configure environment ```bash cp .env.example .env ``` Edit `.env` with your values. At minimum for local SMS testing: ```env SERVICE_API_KEY=change-me-to-a-strong-secret AT_USERNAME=sandbox AT_API_KEY=your_sandbox_api_key ``` > **Local dev tip:** Leave `SERVICE_API_KEY` blank to disable API auth entirely during development. ### 4. Run the service (development) ```bash npm run dev ``` The server starts on **http://localhost:3000** (or `PORT` from `.env`). You should see a log line listing key URLs: `/health`, `/ready`, `/metrics`, `/docs`, `/openapi.json`. ### 5. Verify it is running Open in a browser or curl: | Check | URL | |---|---| | Liveness | localhost | | Readiness | localhost | | API docs (Swagger UI) | localhost | | Diagnostics dashboard | localhost | Or from the terminal: ```bash curl l