v2.0.0 — Тепер із CLI налаштуванням

notification-service

Внутрішній мікросервіс сповіщень для надсилання email-повідомлень із чергою та автоматичними повторними спробами.

Створено для надійності

Все необхідне для надсилання сповіщень у масштабі — з впевненістю.

Обробка черги

Асинхронна доставка через RabbitMQ відокремлює API від надсилання email для максимальної продуктивності.

Автоматичні повтори + DLQ

Повторні спроби з експоненційним відступом і маршрутизацією до Dead Letter Queue забезпечують надійність доставки.

Відстеження доставки

Повний трекінг у PostgreSQL: у черзі → надсилається → надіслано, з ендпоінтами перевірки статусу.

Webhook-зворотні виклики

Отримуйте HTTP-зворотні виклики про статус доставки у ваших сервісах.

Health & Readiness

Ендпоінти liveness та readiness для Kubernetes і Docker health checks.

API Key Auth + Rate Limiting

Опціональна аутентифікація за API-ключем та обмеження запитів на основі Redis.

Як це працює

Простий надійний конвеєр від запиту до поштової скриньки.

Backend Services

Auth · Order · User

Notification API

Express.js + Validation

RabbitMQ

Queue · Retry · DLQ

Worker

Email processing

SMTP Provider

Gmail · SendGrid · SES

Async queue deliveryRetry on failureStatus tracked in PostgreSQL

Почніть за кілька хвилин

Два способи запустити notification-service локально.

1

Use the CLI tool

Interactive wizard to generate .env, docker-compose.yml, and verify your setup.

npx notification-service init
2

Or clone manually

Clone the repo, install dependencies, and configure your .env file.

git clone https://github.com/khodakivskyi/notification-service.git && cd notification-service
3

Start dependencies

Spin up PostgreSQL and RabbitMQ with Docker Compose.

docker-compose up -d
4

Run the service

Start the API server and worker processes. Database migrations run automatically.

npm run dev && npm run dev:workers
5

Send your first notification

The API queues the notification and returns an ID. Workers deliver it asynchronously.

curl -X POST http://localhost:3001/api/notifications/send \
  -H "Content-Type: application/json" \
  -d '{"email":"user@example.com","subject":"Hello","htmlContent":"<h1>It works!</h1>"}'