Secure Scalable API is a backend project built with Express.js to demonstrate secure, scalable RESTful API design. It implements token-based authentication, rate limiting, and CRUD operations.
- Authentication: JWT-based with access and refresh tokens.
- Rate Limiting: Redis for rate limiting and throttling.
- CRUD Operations: Standard CRUD functionality on secure routes.
- Data Storage: MongoDB as the primary database.
- Automated Testing: Uses Supertest for API endpoint testing.
- Node.js and Express.js
- Redis for rate limiting -> used sliding window algorithm
- MongoDB for data persistence
- JWT for token-based authentication
POST /api/auth/register
- Register a new userPOST /api/auth/login
- Login and receive tokensPOST /api/auth/refresh
- Refresh access tokenPOST /api/auth/logout
- Invalidate refresh token
GET /api/todo
- Fetch all todosGET /api/todo/:id
- Fetch todo by IDPOST /api/todo
- Create a new todoPUT /api/todo/:id
- Update todo by IDDELETE /api/todo/:id
- Delete todo by ID