8000 GitHub - hugolee003/task-manager
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

hugolee003/task-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Task Manager

— a simple task management API which i built as a take home assignment project by Ugochukwu, a Backend Engineering student at AltSchool Africa.

back to top

Built With:

Javascript Node.js Express.js MongoDB

back to top


Requirements

Requirements for the take home project
  • CRUD Operations: People should be able to create, read, update, and delete tasks. Each task should have a title and a description.

  • Database: Use MongoDB for data storage. You can create a simple instance on https://www.mongodb.com/cloud/atlas/register

  • Validation: Implement validation to ensure that all task entries have the necessary fields (i.e., title and description).

back to top



Development

Prerequisites

Clone this repo

git clone https://github.com/hugolee003/task-manager.git

Install project dependencies

npm install

Update .env with example.env

Run a development server

npm run dev

For testing, run

npm run test

Models

Tasks

field data_type constraints
title string required
description string required
status string enum ['Todo', 'In Progress', 'Completed']

back to top


Usage

Base URL

Creating a task

  • Route: /tasks
  • Method: POST

👇 Body

{
    "title": "bimpe",
    "description": "wake up by 6:30am today",
    "status": "Completed"
}

👇 Response

{
        "_id": "648d3285322a9779c4de3bc5",
        "title": "bimpe",
        "description": "wake up by 6:30am today",
        "status": "Completed",
        "createdAt": "2023-06-17T04:11:49.796Z",
        "updatedAt": "2023-06-17T04:11:49.796Z",
        "__v": 0
    }

back to top


Read all tasks

  • Route: /tasks
  • Method: Get

👇 Body

👇 Response

[
    {
        "_id": "648cf85ef5fd11f8dbca40ce",
        "title": "Hello Wolrd",
        "description": "HOW ARE YOU",
        "status": "Todo",
        "__v": 0
    },
    {
        "_id": "648d03a7ee5745ac97f091c8",
        "title": "features",
        "description": "new features will be regularly updated to this CRUD app",
        "status": "Todo",
        "__v": 0
    },
    {
        "_id": "648d05ab3c018153d29ffcfd",
        "title": "mojo",
        "description": "wake up by 6:30am today",
        "status": "Completed",
        "__v": 0
    },
    {
        "_id": "648d05d9afe58089fedef175",
        "title": "mojo",
        "description": "wake up by 6:30am today",
        "status": "Completed",
        "createdAt": "2023-06-17T01:01:13.164Z",
        "updatedAt": "2023-06-17T01:01:13.164Z",
        "__v": 0
    },
    {
        "_id": "648d2bb1f802ad39646bd86e",
        "title": "mojo",
        "description": "wake up by 6:30am today",
        "status": "todo",
        "createdAt": "2023-06-17T03:42:41.997Z",
        "updatedAt": "2023-06-17T03:43:54.053Z",
        "__v": 0
    },
    {
        "_id": "648d2c84bcc1064268dfeaba",
        "title": "bimpe",
        "description": "wake up by 6:30am today",
        "status": "Completed",
        "createdAt": "2023-06-17T03:46:12.272Z",
        "updatedAt": "2023-06-17T03:46:12.272Z",
        "__v": 0
    },
    {
        "_id": "648d3285322a9779c4de3bc5",
        "title": "bimpe",
        "description": "wake up by 6:30am today",
        "status": "Completed",
        "createdAt": "2023-06-17T04:11:49.796Z",
        "updatedAt": "2023-06-17T04:11:49.796Z",
        "__v": 0
    }
]

back to top


Update the task

  • Route: /tasks/:id
  • Method: PUT

👇 Body

{
    "title": "Alarm",
    "description": "wake up by 7:30 instead",
    "status": "In Progress"
}

👇 Response

{
    "_id": "648cf85ef5fd11f8dbca40ce",
    "title": "Alarm",
    "description": "wake up by 7:30 instead",
    "status": "In Progress",
    "__v": 0,
    "updatedAt": "2023-06-17T06:42:25.120Z"
}

back to top


Delete specific tasks

  • Route: /tasks/:id
  • Method: DELETE

back to top


Contact

Project Link: Task manager

back to top


back to top

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0