This repository contains the backend implementation of a comprehensive Task Management System built using Node.js, Express.js, and MongoDB. The system provides a RESTful API that allows users to perform CRUD (Create, Read, Update, Delete) operations on tasks. Users can also assign tasks to other users.
- Node.js: A JavaScript runtime for building scalable and high-performance applications.
- Express.js: A minimal and flexible Node.js web application framework that provides a robust set of features for web and mobile applications.
- MongoDB: A NoSQL database for storing task data.
-
Clone the repository:
git clone https://github.com/Slacky300/TASK_API
-
Install the dependencies
cd TASK_API npm i
This will install all the required dependencies for the project.
-
Configure MongoDB and JWT_SECRET
Create a .env file and create two variables MONGODB_URI and JWT SECRET and assign them appropriate values
-
Run the server
npm run dev
The server will be running at http://localhost:8000 (BASE_URL )
To secure the API,user authentication is implemented using a middleware like JWT (JSON Web Tokens). It ensures that only authenticated users can perform CRUD operations.
User Routes
Url=BASE_URL/api/v1/users
-
Register
Endpoint /register
json_body: {
"name": "Sample" "email": "[email protected]", "password": "12345678"
}
-
Login Endpoint /login
json_body: {
"email": "[email protected]", "password": "12345678"
}
TASK Routes
Url=BASE_URL/api/v1/tasks
-
Create Task
Endpoint /create
json_body: {
"title": "Task Title", "description": "Task Description", "assignedTo": ["user_id", "user_id1"] //not mandatory
}
-
Assign Task
Endpoint /assign
json_body: {
"listOfUsers": ["user_id", "user_id1"]
}
-
Get list of Assigned tasks
Endpoint /assigned
-
Get list of created tasks
Endpoint /created
-
Get Analytics of Tasks
Endpoint /analytics
-
Edit a Task
Endpoint /update/:id
-
Delete a task
Endpoint /delete/:id
-
Retrieve a single task
Endpoint /:id