Skip to content

About

Event-driven notification microservice: Express/Bun backend publishes notification events to a Redis Stream, a consumer group fans them into BullMQ priority queues (P0/P1/P2), and workers render HTML templates and send email via Resend with retries, exponential backoff, and Redis-tracked delivery status.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

Repository files navigation

Notification Microservice Assignment

This repo keeps the backend simple for students. The backend creates notification payloads and returns them in API responses. It does not store notifications and does not communicate with notification-service.

Structure

root/
├── backend/
│   ├── prisma/schema.prisma
│   ├── src/controllers/index.ts
│   ├── src/middleware/auth.ts
│   ├── src/routes/index.ts
│   └── src/index.ts
├── notification-service/
└── README.md

Backend Routes

  • POST /auth/signup
  • POST /auth/login
  • POST /wallet/onramp
  • POST /email/marketing
  • GET /health

/wallet/onramp needs a JWT token. /email/marketing needs an ADMIN user token.

Notification Payloads

The backend returns payloads like this:

{
  "id": 1,
  "user": 12,
  "template": "signup-success",
  "service": "EMAIL",
  "priority": 1
}

These payloads are not stored in the database.

Setup

cd backend
bun install
bunx prisma generate
bun run dev

Create backend/.env from backend/.env.example.

Notification-System

About

Event-driven notification microservice: Express/Bun backend publishes notification events to a Redis Stream, a consumer group fans them into BullMQ priority queues (P0/P1/P2), and workers render HTML templates and send email via Resend with retries, exponential backoff, and Redis-tracked delivery status.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages