https://github.com/sumit1921184/taskmanagementsystem
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.
https://github.com/sumit1921184/taskmanagementsystem
bcrypt express-js jwt-authentication mongodb mongoosejs node-js
Last synced: 4 months ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/sumit1921184/taskmanagementsystem
- Owner: sumit1921184
- Created: 2024-04-05T15:05:55.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-06T10:42:57.000Z (about 1 year ago)
- Last Synced: 2025-01-10T18:35:00.534Z (6 months ago)
- Topics: bcrypt, express-js, jwt-authentication, mongodb, mongoosejs, node-js
- Language: JavaScript
- Homepage:
- Size: 46.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Task Management System
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.## Deployed Link
- It is deployed on render
- link: https://taskmanagementsystem-4wva.onrender.com/## Directory Structure
TaskManagementSystem/
│ ├─ config/
│ ├─ middlewares/
│ ├─ models/
│ ├─ routes/
│ ├─ index.js
│ └─ package.json## Installations And Guidelines
- 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## API Endpoints
### Users
#### POST /user/register
- *Description:* Register a new user.
- *Request Body:*
```json
{
"username": "string",
"email": "string",
"password": "string"
}#### POST /user/login
- **Description:** Login with user credentials.
- **Request Body:**
```json
{
"email": "string",
"password": "string"
}### Tasks
#### POST /tasks
- **Description:** Create a new task.
- **Request Headers:**
- Authorization: Bearer- **Request Body:**
```json
{
"title": "string",
"description": "string",
"priority": "string",
"status":"string",
}#### GET /tasks
- **Description:** Get all tasks for the authenticated user.
- **Request Headers:**
- Authorization: Bearer- **Responses:**
- 200 OK
```json
[
{
"_id": "string",
"title": "string",
"description": "string",
"priority": "string",
"status": "string",
"userId": "string",
"createdAt": "date"
},
]
```- 400 Bad Request
```json
{
"msg": "Error message"
}
```#### GET /task/:id
- **Description:** Get a particular task by ID for the authenticated user.
- **Request Headers:**
- Authorization: Bearer- **Request Parameters:**
- id: Task ID- **Responses:**
- 200 OK
```json
{
"_id": "string",
"title": "string",
"description": "string",
"priority": "string",
"status": "string",
"userId": "string",
}
```- 400 Bad Request
```json
{
"msg": "Error message"
}
```
#### PATCH /task/:id- **Description:** Update a particular task by ID for the authenticated user.
- **Request Headers:**
- Authorization: Bearer- **Request Parameters:**
- id: Task ID- **Request Body:**
```json
{
"title": "string",
"description": "string",
"priority": "string",
"status": "string"
}- **Responses:**
- 200 OK
```json
{
"msg": "Tasks has been updated"
}
```- 400 Bad Request
```json
{
"msg": "Error message"
}
```#### DELETE /tasks/:id
- **Description:** Delete a particular task by ID for the authenticated user.
- **Request Headers:**
- Authorization: Bearer- **Request Parameters:**
- id: Task ID- **Responses:**
- 200 OK
```json
{
"msg": "Task has been deleted"
}
```- 400 Bad Request
```json
{
"msg": "Error message"
}
```