Skip to content

ajengrf/kanban

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

kanban

KANBAN API


POST /register


Create a new user.

Request Body:

  • Schema

    Value:

    • name: string,
    • email: string,
    • password: string,

    Example

    {
    "name": "Ajeng",
    "email": "ajeng@gmail.com"
    "password": "ajenghacktiv8"
    }

Response:

  • 201

    Example:

    {
      "id": 6,
      "name": "Ajeng",
      "email": "ajeng@gmail.com"
      "password": "$2a$10$.nhegcxKFs56KKw1XTOf..fptzznZT4.ZshIwlNz5Uuvg7tGRcrCu",
      "updatedAt": "2020-02-14T17:46:58.266Z",
      "createdAt": "2020-02-14T17:46:58.266Z"
    }
  • 400

    Example:

    {
      "email": "E-mail should not be empty!"
    } 
  • 500


POST /login


User login.

Request Body:

  • Schema

    Value:

    • email: string,
    • password: string,

    Example

    {
    "email": "ajeng@gmail.com"
    "password": "ajenghacktiv8"
    }

Response:

  • 201

    Example:

    {
      "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwiZW1haWwiOiJ0ZXNAZ21haWwuY29tIiwiaWF0IjoxNTgxNzAyMjI2fQ.D44jSOpp5j1yAE_KklMKUYqTc-pwALusakfwWpIdz3M",
      "UserId": 1
    }
  • 400

    Example:

    "Invalid email / password!"
  • 404

    Example:

    "User not found!" 
  • 500


POST /login/google


User login with google.

Request Body:

  • Schema

    Value:

    • email: string,
    • password: string,

    Example

    {
    "email": "ajeng@gmail.com"
    "password": "ajenghacktiv8"
    }

Response:

  • 201

    Example:

    {
      token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6I…cwMX0.FrhEDezYKS6WlHtR7VRj9RtCXLF-CA1diMgLCqsGeG0", 
      UserId: 4
    }
  • 500


POST /kanban


Create a new kanban.

Request Body:

  • Schema

    Value:

    • title: string,
    • description: string,

    Example

    {
      "title": "Create Kanban App",
      "description": "Learn how to create RESTful API"
    }

Response:

  • 201

    Example:

    {
      "id": 13,
      "title": "tes",
      "description": "tes",
      "status": "backlog",
      "UserId": 1,
      "updatedAt": "2020-02-14T17:54:38.632Z",
      "createdAt": "2020-02-14T17:54:38.632Z"
    }
  • 400

    Example:

    {
      "message": "Validation error: Title must be filled!"
    }
  • 500


GET /kanban


Show all kanban list.

Response:

  • 200

    Example:

    {
      "id": 1,
      "title": "Create kanban",
      "description": "Learn how to create RESTful API",
      "status": "backlog"
      "due_date": "2020-02-08"
    },
    {
      "id": 2,
      "title": "Create kanban",
      "description": "Learn how to create RESTful API",
      "status": "backlog"
      "due_date": "2020-02-08"
    } 
  • 500



GET /kanban/:id


Show kanban list by id.

Request Params:

id: integer
example: http://localhost:3000/kanban/2


Response:

  • 200

    Example:

    {
      "id": 2,
      "title": "Create kanban",
      "description": "Learn how to create RESTful API",
      "status": "backlog",
      "due_date": "2020-02-08"
    }
  • 404

    Example:

    {
      "message": "Error 404, command not found!"
    }

PUT /kanban/:id


Update kanban list by id.

Request params:

id: integer
example: http://localhost:3000/kanban/2


Request Body:

  • Schema

    Value:

    • title: string,
    • description: string,
    • status: string,

    Example

    {
      "title": "Create kanban",
      "description": "Learn how to create RESTful API",
      "status": "todo"
      "due_date": "2020-02-08"
    }

Response:

  • 200

    Example:

    {
      "id": 2,
      "title": "Create kanban",
      "description": "Learn how to create RESTful API",
      "status": "todo",
      "due_date": "2020-02-08"
    }
  • 404

    Example:

    {
      "message": "Validation error: Title must be filled!"
    }
  • 400

    Example:

    {
      "message": "Error 404, command not found!"
    }
  • 500


DELETE /kanban/:id


Delete kanban list by id.

Request params:

id: integer
example: http://localhost:3000/kanban/3


Response:

  • 200

    Example:

    {
      "id": 2,
      "title": "Create kanban",
      "description": "Learn how to create RESTful API",
      "status": "done",
      "due_date": "2020-02-08"
    }
  • 404

    Example:

    {
      "message": "Error 404, command not found!"
    }
  • 500

Releases

No releases published

Packages

No packages published

Languages

  • Vue 49.7%
  • JavaScript 41.2%
  • CSS 5.5%
  • HTML 3.6%