GithubHelp home page GithubHelp logo

marcobramini / task-manager Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 1.0 237 KB

An app to manage your tasks

HTML 2.82% JavaScript 92.73% CSS 4.45%
react task task-list task-management task-manager task-scheduler tasks tasks-app tasks-list tasks-manager

task-manager's Introduction

Task Manager

Authors:

  • CHIMIRRI ARMANDO
  • IAMMARINO SOFIA
  • BRAMINI MARCO
  • DAMINO DESIRE'

Instructions for testing

Environment startup

A script is available to run both the app and its server with a single command:

 npm run start-with-server

Warning: The server will be started using the nodecommand instead of nodemon due to platform compatibility.

Test user credentials

A test user has been created to simplify the testing of the application:

  email: "[email protected]"
  password: "testtest"

List of APIs offered by the server

Auth APIs

Name Description Path Method Authenticated
loginUser Logs the user inside the application /task-manager/apis/sessions POST

Request sample:

POST task-manager/apis/sessions HTTP/1.1
Content-Type: application/json

{
  "username": "[email protected]",
  "password":"ciao"
}

Response sample:

{
  "id": 1,
  "email": "[email protected]",
  "name": "John"
}

Error codes:

  • 500 - Server Error: Something went wrong on the server side. Error is logged on the server.
  • 401 - Unauthorized: The provided credentials are wrong. Caller must fix them and retry.
getCurrentUser Gets the current user authenticated in the session /task-manager/apis/sessions GET

Request sample:

GET task-manager/apis/sessions/current HTTP/1.1

Response sample:

{
  "id": 1,
  "email": "[email protected]",
  "name": "John"
}

Error codes:

  • 500 - Server Error: Something went wrong on the server side. Error is logged on the server.
logoutUser Logs out the user /task-manager/apis/sessions DELETE

Request sample:

DELETE task-manager/apis/sessions/current HTTP/1.1

Error codes:

  • 500 - Server Error: Something went wrong on the server side. Error is logged on the server.

TaskManage APIs

Name Description Path Method Authenticated
CreateTask Creates a new task for the current user, populated with the passed parameters. Returns the id of the newly created task. /task-manager/apis/tasks POST

Request sample:

POST /task-manager/apis/tasks HTTP/1.1
Content-Type: application/json

{
    "description":"Go buy vodka!",
    "isImportant": false,
    "deadline" :"2022-06-22T14:00:00.000Z",
}

Response sample:

{
  "newTaskId": 11
}

Error codes:

  • 500 - Server Error: Something went wrong on the server side. Error is logged on the server.
  • 422 - Unprocessable Entity: There was an error validating the request parameters. Caller must fix them and retry.
GetTask Retrieves the task associated to the passed ID for the current user. /task-manager/apis/tasks/:taskId GET

Request sample:

GET /task-manager/apis/tasks/9 HTTP/1.1

Response sample:

{
  "id": 9,
  "userId": 1,
  "description": "Call Mary",
  "deadline": null,
  "isImportant": 1,
  "isPrivate": 1,
  "isCompleted": 0
}

Error codes:

  • 500 - Server Error: Something went wrong on the server side. Error is logged on the server.
  • 422 - Unprocessable Entity: There was an error validating the request parameters. Caller must fix them and retry.
GetFilteredTasks Retrieves all the tasks that fullfill a given filter for the current user. /task-manager/apis/tasks?filter=:filterId GET

Request sample:

GET /task-manager/apis/tasks?filterId=important HTTP/1.1

Response sample:

[
    {
        "id": 9,
        "userId": 1,
        "description": "Call Mary",
        "deadline": null,
        "isImportant": 1,
        "isPrivate": 1,
        "isCompleted": 0
    },
    ...
]

Error codes:

  • 500 - Server Error: Something went wrong on the server side. Error is logged on the server.
  • 422 - Unprocessable Entity: There was an error validating the request parameters. Caller must fix them and retry.
UpdateTask Updates a existing task, for the current user, using the values passed as parameters. Only the provided fields will be updated. The omitted (undefined) fields will remain untouched. Setting a field to null will provoke it to be set to null in the Task. /task-manager/apis/tasks PUT

Request sample:

PUT /task-manager/apis/tasks/2 HTTP/1.1
Content-Type: application/json

{
    "description": "Go for walk",
    "isCompleted": true,
    "deadline": null,
    "userId": 1
}

Response sample:

{
  "updatedTaskId": 10
}

Error codes:

  • 500 - Server Error: Something went wrong on the server side. Error is logged on the server.
  • 422 - Unprocessable Entity: There was an error validating the request parameters. Caller must fix them and retry.
DeleteTask Deletes an existing task for the current user selected by passing his ID as a parameter /task-manager/apis/tasks/:TaskId DELETE

Request sample:

DELETE /task-manager/apis/tasks/10  HTTP/1.1

Success code:

  • 204 - No Content: The task has been successfully deleted.

Error codes:

  • 500 - Server Error: Something went wrong on the server side. Error is logged on the server.
  • 422 - Unprocessable Entity: There was an error validating the request parameters. Caller must fix them and retry.

task-manager's People

Contributors

marcobramini avatar

Watchers

 avatar  avatar

Forkers

armandochimirri

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.