Skip to content

NestJS, Prisma, Prometheus, BullMQ | BTC-to-UAH exchange rate email notifications

Notifications You must be signed in to change notification settings

vladdoroniuk/email-notification-system

Repository files navigation

Tasks

  • Analyze business requirements and technical details
  • Clarify questions with the customer
  • Create system design diagram
  • Create entity relationship diagram
  • Setup NestJS monorepo
  • Create Prisma schema file based on ERD
  • Create Dockerfile for service app and worker app
  • Create docker-compose.yml file
  • Connect to external BTC-to-UAH API
  • Configure Prometheus and prom-client
  • Create endpoints
    • GET /rate
    • POST /rate
    • GET /emails
    • POST /emails
    • DELETE /emails
    • GET /metrics
  • Collect metrics
    • subscribe email count
    • unsubscribe email count
    • send email success count
    • send email error count
    • exchange rate gauge
  • Get exchange rate every hour
  • Get exchange rate at 9 AM Kyiv time
  • Use CQRS pattern
  • Use Nodemailer for mailing
  • Use Bull for task queuing
  • Use Cron/Interval for task scheduling
  • Use Pino for logging
  • Add unit tests

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)

Links

About

NestJS, Prisma, Prometheus, BullMQ | BTC-to-UAH exchange rate email notifications

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published