Skip to content

An implementation for a rate-limited notification service. The goal is to protect the end user from receiving lots of emails from status report, updates and etc.

Notifications You must be signed in to change notification settings

tapiarafael/notification-rate-limit

Repository files navigation

Description

An implementation of a rate limiter to control the rate of requests to end users based on custom rules.

The application is built with Node.js, NestJS, TypeScript, Knex and Docker.

During the development, I've tried to follow the Hexagonal Architecture, so the application is divided into some layers

Also, I've tried my best to use TDD as much as possible, so I've created a test suite with Jest

Installation

$ yarn install

Migrations

$ yarn knex migrate:latest

Seeding

$ yarn knex seed:run

This will create some rules for testing.

Type Limit Period
STATUS 3 minute
NEWS 5 minute
OTHERS 2 hour

Running the app

# development
$ yarn run start

# watch mode
$ yarn run start:dev

# production mode
$ yarn run start:prod

Running the app with docker

$ docker-compose up

⚠️ It's necessary to run the migrations in order to make the application work.

Test

# unit tests
$ yarn run test

# test coverage
$ yarn run test:cov

About

An implementation for a rate-limited notification service. The goal is to protect the end user from receiving lots of emails from status report, updates and etc.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published