Demonstrates how to implement a distributed rate-limiting solution across multiple backend tasks using a Redis cache
https://github.com/alexlop29/rate-limiting-in-express-js.git
cd rate-limiting-in-express.js
docker-compose up --build -d
- aws-sdk
- dotenv
- express-openid-connect
- express-rate-limit
- express.js
- multer
- rate-limit-redis
- node-redis
- Node.js 20.11.0
- Docker
- Docker Compose
- Docker Desktop
- Docker - Node
- Docker - Redis
- eslint
- nodemon
- Postman - VS Code
- Prettier
- ts-node
- Typescript
- Node.js Redis - Docs
- Node.js Redis - createClient() Config Docs
- Express.js Graceful Shutdown
- CommonJs & ESM
- Design Patterns Explained – Dependency Injection with Code Examples
- Dependency Injection - Stack Overflow
The scope of the project is limited to demonstrating how to implement a distributed rate limiting solution in a backend microservice.
There are several potential areas of improvement to get this demonstration production-ready.
Suggestions:
- Add a validation function to the Document controller.
- Remove the use of the Math.random() function in the Document controller, merely used for demonstration purposes.
- Remove synchronous functions, such as console.log(), and replace with an ehanced error handling solution, such as Sentry.
- Apply security, performance, and stability best practices in an express.js application.
- Enhance tests.