Task Management Microservice crafted with TypeScript, Express.js, and MongoDB, delivering efficient CRUD operations through intuitive REST APIs. Designed with scalability in mind, it features a modern, strongly-typed codebase and seamless MongoDB integration using Mongoose. The project also includes a fully automated CI/CD pipeline.
- 📦 RESTful API: Clean and reusable API endpoints.
- 🧩 Modular Code Structure: Clean and scalable architecture.
- 📄 Environment Variables: Configurable via
.env
file.
├── src
│ ├── controllers # API controllers
│ ├── database # API database
│ │ └── schemas # Mongoose schemas
│ ├── environment # environments dev and prod
│ ├── helpers # Helper functions
│ │ ├── mappers # mappers
│ │ └── utilities # utilities
│ ├── interfaces # interfaces and types
│ ├── middleware # middlewares
│ ├── routes # Express routes
│ ├── server # Server entry point
│ │ ├── app.ts # Express app setup
│ │ └── db.ts # Mongo configuration
│ └── index.ts # App configuration
├── .env # Environment variables
├── tsconfig.json # TypeScript configuration
├── package.json # Dependencies and scripts
└── README.md # Project documentation
- Clone the repository:
git clone https://github.com/Aanttrax/ms-tasks.git cd ms-tasks
- Install dependencies:
npm install
- Set up environment variables: Create a .env file in the root directory and add the following:
PORT=3200 HOST=0.0.0.0 MONGO_USER=***** MONGO_PWD=******** MONGO_HOST=******************* MONGO_DB_NAME=************ MONGO_OPTIONS=********************
- Start the development server:
npm run dev
- Alive
- GET
/alive
- Response:
{ "success": true, "response": "Server online" }
- GET
- Create Task
- POST
/task
- Request Body:
{ "title": "new Task", "description": "description of the task" }
- Response:
{ "success": true, "response": "Task Created" }
- POST
- Get Tasks
- GET
/task
- Response:
{ "success": true, "response": [ { "_id": "674a1d6735166960a3dac662", "title": ".......", "description": "....", "done": false, } ] }
- GET
- Get Task by Id
- GET
/task/:taskId
- Response:
{ "success": true, "response": { "_id": "674a1d6735166960a3dac662", "title": ".......", "description": "....", "done": false, } }
- GET
- Update Task
- PUT
/task/:taskId
- Request Body:
{ "title": "new Task", "description": "description of the task", "done": true }
- Response:
{ "success": true, "response": "Task Updated" }
- PUT
- Delete Task by Id
- DELETE
/task/:taskId
- Response:
{ "success": true, "response": "Task Deleted" }
- DELETE
- Fork the repository.
- Create a new branch:
git checkout -b feature-name
- Commit your changes:
git commit -m "Add your message"
- Push to the branch:
git push origin feature-name
- Create a pull request.
- Express.js - Web framework for Node.js.
- TypeScript - Typed JavaScript at any scale.
- MongoDB - Database for modern applications.
This project is licensed under the MIT License. See the LICENSE file for details.