Nest Logo

NPM Version Package License NPM Downloads CircleCI Coverage Discord Backers on Open Collective Sponsors on Open Collective Support us

Description

This is a birthday email blast application made using TypeScript and Nest.

How it Works

  1. This app has a cron job that performs email blast every hour.
  2. It will check the list of emails, its timezone, and the user's birth date.
  3. If it's a birthday, it will be added to email queue.
  4. Run through the queue and send a request to 3rd-party API (a mock API).
  5. If the API request fails, it will be added to a different queue.
  6. Repeat the API request until the queue is empty (there's a limit to prevent endless loop).

Other features:

  • A failsafe method for when there's a server crash, it runs through the queue immediately after rebooting.
  • CRUD functionalities. You can edit recipient's information and it will still send the birthday email accordingly.

Installation

$ pnpm install

Running the app

# development
$ pnpm run start

# watch mode
$ pnpm run start:dev

# production mode
$ pnpm run start:prod

Test

# unit tests
$ pnpm run test

# e2e tests
$ pnpm run test:e2e

# test coverage
$ pnpm run test:cov

License

Nest is MIT licensed.