A production-style Notification System built using Node.js, TypeScript, PostgreSQL, Redis, BullMQ, and Docker.
This project demonstrates modern backend engineering concepts including:
- Asynchronous job processing
- Queue-based architecture
- Worker systems
- Multi-channel notifications
- Dead Letter Queue (DLQ)
- Scheduling
- Retry mechanisms
- Idempotency handling
- Distributed system patterns
- API receives notification request
- Notification stored in PostgresSQL
- Job pushed to Redis queue
- Worker Processes job asynchronously
- Notification delivered via Email/SMS/Push
- Status updated in database
- ✅ BullMQ-based async job processing
- ✅ Redis-backed queue system
- ✅ Worker architecture
- ✅ Multi-channel notifications Email SMS Push
- ✅ Dead Letter Queue (DLQ)
- ✅ Retry handling with exponential backoff
- ✅ Delayed/scheduled notifications
- ✅ Idempotency support
- ✅ Structured logging
- ✅ Layered backend architecture
- ✅ Dockerized setup
- ✅ PostgreSQL persistence
- Backend: Node.js, TypeScript, Express
- Database: PostgreSQL
- Queue: Redis + BullMQ
- Tooling: tsx, nodemon
- DevOps Docker, Docker compose
src/
├── config/ # DB, Redis, logger, env configs
├── controllers/ # HTTP request handlers
├── dto/ # Request DTOs
├── middlewares/ # Error handling & rate limiting
├── providers/ # Email/SMS/Push providers
├── queues/ # BullMQ queues
├── repository/ # Database queries
├── routes/ # API routes
├── service/ # Business logic
├── types/ # TypeScript types
├── workers/ # Background workers
└── server.ts # Entry pointgit clone <your-repo-url>
cd notification-systemnpm installPORT=3000
DB_HOST=localhost
DB_PORT=5432
DB_USER=postgres
DB_PASSWORD=yourpassword
DB_NAME=notification-system
REDIS_HOST=127.0.0.1
REDIS_PORT=6379
EMAIL_USER=your_email
EMAIL_PASS=your_passworddocker run -d -p 6379:6379 redisnpm run devnpx tsx src/workers/notification.worker.tsdocker compose up --buildCreate Notification
POST /api/v1/notifications{
"user_id": "user_123",
"type": "EMAIL",
"message": "Hello from Notification system",
"email": "user@email.com"
}idempotency_key: unique-key-123PENDING
↓
PROCESSING
↓
SENT
OR
FAILED
↓
Dead Letter Queue
- Queue-based architectures
- Producer-consumer pattern
- Distributed system patterns
- Background workers
- Async processing
- Retry systems
- Exponential backoff
- Dead Letter Queues
- Idempotency handling
- Multi-channel provider abstraction
- Delayed job scheduling
- Infrastructure containerization
This project helped in understanding:
- Distributed backend systems
- Async job orchestration
- Redis queue processing
- Worker-based architectures
- Backend scalability patterns
- Fault-tolerant systems
- Dockerized infrastructure
Kushal Chavan
