Skip to content

erlangamara/kanban

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

kanban

Deploy Link

https://kanban-1584035163065.firebaseapp.com/

Third Party

Google OAUTH

Server Documentation

Dependencies

Package Name Version
cors ^2.8.5
dotenv ^8.2.0
express 4.17.1
googleapis ^39.2.0
jsonwebtoken ^8.5.1
pg ^7.18.1
sequelize ^5.21.3
mailgun-js ^5.21.5
bcrypt ^4.0.1
google-auth-library ^5.10.1

Example .env

DB_USERNAME = 
DB_PASSWORD = 
SECRET =
CLIENT_ID =

Default Port

SERVER = https://damp-oasis-32768.herokuapp.com
CLIENT = https://kanban-1584035163065.firebaseapp.com/

Server

Tools: NodeJS, Express, sequelize, postgresql

USER

Url Method Description
/users/register POST Menambahkan user baru
/users/login POST Melakukan login dan mendaptkan token
/users/googleSignin POST Melakukan login dengan Google

1. POST /users/register

Example Input (Request Body):

{
    "email": "example@expample.com",
    "password": "123"
}

Response (201):

{
    "email": "example@expample.com",
    "password": "123",
    "updatedAt": "2020-03-07 13:47:28.607+07",
    "createdAt": "2020-03-07 13:47:28.607+07"
}

Example Input (Request Body) :

{
    "email": ,
    "password": "123",	
}

Response ERROR (400):

{
	"Validation error: Email is empty"
}

2. POST /users/login

Example Input (Request Body):

{
    "email": "example@expample.com",
    "password": "123"
}

Response (201):

    "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MTAsImVtYWlsIjoiZXhwYW1wbGVAZXhhbXBsZS5jb20iLCJpYXQiOjE1ODM1NjQyODF9.jvh2CegZlsax09Cp_wcSiOed_84BUJTHJuC1IDAiTXs"

Example Input (Request Body) :

{
    "email": "example@expample.com",
    "password": ,	
}

Response ERROR (400):

{
	error: "wrong password"
}

Todo

Url Method Description
/tasks/ POST Menambahkan task baru
/tasks/ GET Menampilkan list task
/tasks/:id GET Menampilkan list task berdasarkan id
/tasks/:id PUT Melakukan edit ke task
/tasks/:id DELETE Menghapus task dari list

1. POST /tasks

Example Input (Request Headers):

{
    eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwiZW1haWwiOiJmYXV6YW5AZW1haWwuY29tIiwiaWF0IjoxNTgzMjI0NDUzfQ.f9xFh_GctsZvEDEgdlmMYU13CPOlOdD4Btme8oi0tgA

}

Example Input (Request Body):

{
	"title" : "Belajar",
	"description" : "Vue Js"
}

Response (201):

{
    "title": "Belajar",
    "description": "Vue Js",
    "category": "backlog",
    "due_date": "15-05-2020",
    "userId": 1
}

Example Input:

{
	"title" : null,
	"description" : "Vue Js",
	"due_date" : "15-05-2020"
}

Response ERROR (400):

{
	"Validation error: Title is empty"
}

2. GET /tasks

Example Input (Request Headers):

{
    eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwiZW1haWwiOiJmYXV6YW5AZW1haWwuY29tIiwiaWF0IjoxNTgzMjI0NDUzfQ.f9xFh_GctsZvEDEgdlmMYU13CPOlOdD4Btme8oi0tgA

}

Response (200):

{
    "title": "Belajar",
    "description": "Vue Js",
    "category": "backlog",
    "due_date": "15-05-2020",
    "userId": 1
}

Example Input (Request Headers) :

{
    "token": 	
}

Response ERROR (500):

{
	"jwt must be provided"
}

3. GET /tasks/:id

Example Input (Request Headers):

{
    eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwiZW1haWwiOiJmYXV6YW5AZW1haWwuY29tIiwiaWF0IjoxNTgzMjI0NDUzfQ.f9xFh_GctsZvEDEgdlmMYU13CPOlOdD4Btme8oi0tgA
}

Response (201):

{
    "id": 1,
    "title": "Belajar",
    "description": "Vue Js",
    "category": "backlog",
    "due_date": "15-05-2020",
    "createdAt": "2020-03-07T07:15:12.149Z",
    "updatedAt": "2020-03-07T07:15:12.149Z",
    "userId": 1
}

Example Input (Request Headers):

{
    "token":  	
}

Response ERROR (404):

{
	"error not found"
}

4. PUT /tasks/:id

Example Input (Request Headers):

{
    eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwiZW1haWwiOiJmYXV6YW5AZW1haWwuY29tIiwiaWF0IjoxNTgzMjI0NDUzfQ.f9xFh_GctsZvEDEgdlmMYU13CPOlOdD4Btme8oi0tgA
}

Example Input (Request Body):

{
	"title" : "Belajar",
	"description" : "Vue Js",
	"category" : "todo",
	"due_date" : "15-05-2020"
}

Response (200):

{
    "title": "Belajar",
    "description": "Vue Js",
    "status": "todo",
    "due_date": "15-05-2020"
}

Response ERROR (404):

	"error not found"

5. DELETE /tasks/:id

Example Input (Request Headers):

{
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwiZW1haWwiOiJmYXV6YW5AZW1haWwuY29tIiwiaWF0IjoxNTgzMjI0NDUzfQ.f9xFh_GctsZvEDEgdlmMYU13CPOlOdD4Btme8oi0tgA
}

Response (200):

{
    "id": 1,
    "title": "Belajar",
    "description": "Vue Js",
    "status": "todo",
    "due_date": "15-05-2020",
    "createdAt": "2020-03-07T07:15:12.149Z",
    "updatedAt": "2020-03-07T07:20:48.109Z",
    "userId": 1
}

Response ERROR (404):

{
	"error not found"
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Vue 35.9%
  • JavaScript 34.1%
  • HTML 30.0%