A simple Task Manager API built using Node.js, Express.js, and Mongodb (with Mongoose).
This project is focused on practising backend fundamentals.
- Node.js
- Express.js
- MongoDB Atlas
- Mongoose
- Clone the repository
git clone <repository-url> cd <project-folder>
- Install dependencies
npm install
- Create a .env file at the root and add your MongoDB URI
MONGO_URI=your-mongodb-uri PORT=3000
- Run the server
node index.js
- Server will run at
http://localhost:3000/
| Method | Endpoint | Description | Body / Query |
|---|---|---|---|
| POST | /addtask | Add a new task | Query params (title, status) |
| GET | /gettask | Get all tasks | None |
| GET | /gettaskbyid | Get task by ID | Query param (id) |
| DELETE | /deletetask | Delete a task by ID | Query param (id) |
| PATCH | /updatetask | Update task by ID | param (id), Body (fields to update) |
| GET | /filterbystatus | Filter tasks by status | Query param (status) |
- Add a Task
POST http://localhost:3000/add?title=CompleteAssignment&description=description&status=pending
- Get All Tasks
GET http://localhost:3000/task
- Get Task By ID
GET http://localhost:3000/taskid?id=your-task-id
- Delete Task
DELETE http://localhost:3000/delete?id=your-task-id
- Update Task
PATCH http://localhost:3000/update?id=your-task-id Body (JSON): { "status": "completed" }
- Filter Tasks by Status
GET http://localhost:3000/filterstatus?status=pending