A professional, scalable backend API built with Node.js, Express, TypeScript, and MongoDB. This project follows clean architecture principles and is designed for production-readiness.
- Authentication: JWT Access + Refresh token implementation.
- Authorization: Role-Based Access Control (User vs. Admin).
- Architecture: Clean Architecture (Controller → Service → Repository).
- Testing: Comprehensive Unit & Integration tests using Vitest + Supertest.
- Documentation: Auto-generated Swagger (OpenAPI 3.0) documentation.
- Security: Rate limiting, Helmet, and centralized error handling.
- ️Data: MongoDB integration with Mongoose.
- Querying: Support for pagination, filtering, and sorting.
- Runtime: Node.js
- Framework: Express
- Language: TypeScript
- Database: MongoDB + Mongoose
- Testing: Vitest, Supertest.
- Documentation: Swagger (OpenAPI 3.0)
Clone the repository and install the dependencies:
git clone <repository-url>
cd ScalableTaskManagementApi
npm installCreate a .env file in the root directory and configure the following variables:
PORT=3333
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_access_secret
REFRESH_SECRET=your_jwt_refresh_secret# 1. Start the database using Docker
docker-compose up -d
# 2. Run the application in development mode
npm run devOnce the server is running, you can access the interactive API documentation at:
👉 http://localhost:3333/api/docs
- Register: Send a POST request to
/users/register. - Login: Send a POST request to
/users/loginto receiveaccessTokenandrefreshToken. - Authorize: Include your token in the request header for protected routes:
Authorization: Bearer <accessToken>
Roles:
user:Can manage own tasks.admin:Full access, including deleting any task.
- Built with a scalable DI-pattern architecture.
- Modular design for easy maintenance and testing.
- Ready for production deployment.
