A simple RESTful API for managing tasks. Users can register, log in, create, update, delete tasks, and view their tasks. Built with Node.js, Express, and MongoDB.
- It is deployed on render
- link: https://taskmanagementsystem-4wva.onrender.com/
TaskManagementSystem/
│ ├─ config/
│ ├─ middlewares/
│ ├─ models/
│ ├─ routes/
│ ├─ index.js
│ └─ package.json
- git clone https://github.com/sumit1921184/TaskManagementSystem.git
- npm install
- Set up MongoDB and configure the connection string in config/db.js.
- Generate JWT secret key and update it in the authentication middleware (middleware/auth.middleware.js).
- npm run server
-
Description: Register a new user.
-
Request Body:
{ "username": "string", "email": "string", "password": "string" }
-
Description: Login with user credentials.
-
Request Body:
{ "email": "string", "password": "string" }
-
Description: Create a new task.
-
Request Headers:
- Authorization: Bearer
-
Request Body:
{ "title": "string", "description": "string", "priority": "string", "status":"string", }
-
Description: Get all tasks for the authenticated user.
-
Request Headers:
- Authorization: Bearer
-
Responses:
-
200 OK
[ { "_id": "string", "title": "string", "description": "string", "priority": "string", "status": "string", "userId": "string", "createdAt": "date" }, ] -
400 Bad Request
{ "msg": "Error message" }
-
-
Description: Get a particular task by ID for the authenticated user.
-
Request Headers:
- Authorization: Bearer
-
Request Parameters:
- id: Task ID
-
Responses:
-
200 OK
{ "_id": "string", "title": "string", "description": "string", "priority": "string", "status": "string", "userId": "string", } -
400 Bad Request
{ "msg": "Error message" }
-
-
Description: Update a particular task by ID for the authenticated user.
-
Request Headers:
- Authorization: Bearer
-
Request Parameters:
- id: Task ID
-
Request Body:
{ "title": "string", "description": "string", "priority": "string", "status": "string" } -
Responses:
-
200 OK
{ "msg": "Tasks has been updated" } -
400 Bad Request
{ "msg": "Error message" }
-
-
Description: Delete a particular task by ID for the authenticated user.
-
Request Headers:
- Authorization: Bearer
-
Request Parameters:
- id: Task ID
-
Responses:
-
200 OK
{ "msg": "Task has been deleted" } -
400 Bad Request
{ "msg": "Error message" }
-