Skip to content

Ltuan126/Task-Management-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 

Repository files navigation

Task Management API

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.


Features

  • RESTful API for task management
  • Clean layered architecture
  • JWT authentication
  • MongoDB database integration
  • Docker containerization
  • Ready for CI/CD deployment

Tech Stack

  • Node.js
  • Express.js
  • MongoDB
  • Mongoose
  • Docker
  • GitHub Actions (CI/CD)

Project Structure

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

API Endpoints

Tasks

GET    /api/tasks
GET    /api/tasks/:id
POST   /api/tasks
PUT    /api/tasks/:id
DELETE /api/tasks/:id

Authentication

POST /api/auth/register
POST /api/auth/login

Installation

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

Docker Setup

Build image

docker build -t task-api .

Run container

docker run -p 5000:5000 task-api

Environment Variables

Create .env file

PORT=5000
MONGO_URI=mongodb://localhost:27017/taskdb
JWT_SECRET=your_secret_key

Future Improvements

  • Role-based authorization
  • API rate limiting
  • Logging system
  • Automated testing
  • Full CI/CD pipeline

License

MIT License

About

Scalable Task Management REST API built with Node.js, Express, MongoDB, clean architecture, JWT authentication, and Docker support.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors