https://github.com/vladdoroniuk/email-notification-system
NestJS, Prisma, Prometheus, BullMQ | BTC-to-UAH exchange rate email notifications
https://github.com/vladdoroniuk/email-notification-system
bullmq cqrs cron docker nestjs postgresql prisma prometheus redis typescript
Last synced: 6 months ago
JSON representation
NestJS, Prisma, Prometheus, BullMQ | BTC-to-UAH exchange rate email notifications
- Host: GitHub
- URL: https://github.com/vladdoroniuk/email-notification-system
- Owner: vladdoroniuk
- Created: 2024-02-02T04:05:55.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-22T15:11:14.000Z (7 months ago)
- Last Synced: 2025-03-22T16:23:06.959Z (7 months ago)
- Topics: bullmq, cqrs, cron, docker, nestjs, postgresql, prisma, prometheus, redis, typescript
- Language: TypeScript
- Homepage:
- Size: 1.33 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## System Design Diagram
![]()
## Entity Relationship Diagram
![]()
## Services
- localhost:3001 -> Service App (/api -> Swagger Docs)
- localhost:3002 -> Worker App
- localhost:9090 -> Prometheus
- localhost:6379 -> Redis
- localhost:5432 -> PostgreSQL
- localhost:5555 -> Prisma Studio (npm run db:studio, only in local dev)## Todo
- [x] Create system design diagram
- [x] Create entity relationship diagram
- [x] Setup NestJS monorepo
- [x] Create Prisma schema file based on ERD
- [x] Create Dockerfile for service app and worker app
- [x] Create docker-compose.yml file
- [x] Connect to external BTC-to-UAH API
- [x] Configure Prometheus and prom-client
- [x] Create endpoints
- [x] GET /rate
- [x] POST /rate
- [x] GET /emails
- [x] POST /emails
- [x] DELETE /emails
- [x] GET /metrics
- [x] Collect metrics
- [x] subscribe email count
- [x] unsubscribe email count
- [x] send email success count
- [x] send email error count
- [x] exchange rate gauge
- [x] Get exchange rate every hour
- [x] Get exchange rate at 9 AM Kyiv time
- [x] Use CQRS pattern
- [x] Use Nodemailer for mailing
- [x] Use Bull for task queuing
- [x] Use Cron/Interval for task scheduling
- [ ] Use Pino for logging
- [ ] Add unit tests## Links
- https://www.bemyaficionado.com/design-a-notification-system
- https://blog.risingstack.com/node-js-performance-monitoring-with-prometheus/
- https://mailtrap.io/ (email delivery testing)