A scalable Task Management REST API built with Node.js, Express, and MongoDB using a clean layered architecture.
This project demonstrates backend best practices including RESTful API design, authentication, and containerized deployment.
- RESTful API for task management
- Clean layered architecture
- JWT authentication
- MongoDB database integration
- Docker containerization
- Ready for CI/CD deployment
- Node.js
- Express.js
- MongoDB
- Mongoose
- Docker
- GitHub Actions (CI/CD)
src
├ config
│ └ database.js
├ middlewares
├ models
│ ├ task.model.js
│ └ user.model.js
├ modules
│ ├ auth
│ ├ tasks
│ │ ├ task.controller.js
│ │ ├ task.service.js
│ │ ├ task.repository.js
│ │ └ task.route.js
│ └ users
├ utils
├ app.js
└ server.js
Architecture flow:
Route → Controller → Service → Repository → Model → Database
GET /api/tasks
GET /api/tasks/:id
POST /api/tasks
PUT /api/tasks/:id
DELETE /api/tasks/:id
POST /api/auth/register
POST /api/auth/login
Clone repository
git clone https://github.com/yourusername/task-management-api.git
Install dependencies
npm install
Run server
npm run dev
Server will start at:
http://localhost:5000
Build image
docker build -t task-api .
Run container
docker run -p 5000:5000 task-api
Create .env file
PORT=5000
MONGO_URI=mongodb://localhost:27017/taskdb
JWT_SECRET=your_secret_key
- Role-based authorization
- API rate limiting
- Logging system
- Automated testing
- Full CI/CD pipeline
MIT License