Skip to content

Latest commit

 

History

History
195 lines (146 loc) · 3.27 KB

File metadata and controls

195 lines (146 loc) · 3.27 KB

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

Directory Structure

TaskManagementSystem/
│ ├─ config/
│ ├─ middlewares/
│ ├─ models/
│ ├─ routes/
│ ├─ index.js
│ └─ package.json

Installations And Guidelines

API Endpoints

Users

POST /user/register

  • Description: Register a new user.

  • Request Body:

    {
     "username": "string",
     "email": "string",
     "password": "string"
    }
    

POST /user/login

  • Description: Login with user credentials.

  • Request Body:

    {
      "email": "string",
      "password": "string"
    }
    

Tasks

POST /tasks

  • Description: Create a new task.

  • Request Headers:

    • Authorization: Bearer
  • Request Body:

    {
      "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

      [
        {
          "_id": "string",
          "title": "string",
          "description": "string",
          "priority": "string",
          "status": "string",
          "userId": "string",
          "createdAt": "date"
        },
        
      ]
    • 400 Bad Request

      {
        "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

      {
        "_id": "string",
        "title": "string",
        "description": "string",
        "priority": "string",
        "status": "string",
        "userId": "string",
      }
    • 400 Bad Request

      {
        "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:

    {
      "title": "string",
      "description": "string",
      "priority": "string",
      "status": "string"
    }
    
  • Responses:

    • 200 OK

      {
          "msg": "Tasks has been updated"
      }
    • 400 Bad Request

      {
        "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

      {
        "msg": "Task has been deleted"
      }
    • 400 Bad Request

      {
        "msg": "Error message"
      }