Code Monkey home page Code Monkey logo

task-manager's Introduction

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

task-manager's People

Contributors

hugolee003 avatar

Stargazers

Hamza A. K. Matea avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.