Google OAUTH
Package Name | Version |
---|---|
bcrypt | ^2.4.3 |
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 |
Package Name | Version |
---|---|
dotenv | ^8.2.0 |
secret=cialobaobao
SENDGRID_API_KEY='SG.yW5JelmwQYCo6Dg6znEtCQ ZVmHemhvg0dKz22wvkJ2I6Xt9MoY5bPB6F-2WpVmzQw' PORT=3000
SERVER = https://protected-savannah-10852.herokuapp.com
CLIENT = https://kanfun-1584103939567.firebaseapp.com/
Tools: NodeJS, Express, sequelize, postgresql
Code | Description |
---|---|
200 | Response Sukses |
201 | Data berhasil ditambahkan |
400 | Request yang diberikan tidak lengkap atau salah |
403 | Tidak memiliki otoritas |
404 | Data tidak ditemukan / tidak ada |
500 | Error dari sisi server / tidak diduga-duga :v |
Url | Method | Description |
---|---|---|
/users/register | POST | Menambahkan User baru |
/users | GET | Mencari atau Melihat daftar Semua User |
/users/login | POST | Mendapatkan token dan mengirim token ke client |
Request header:
{
"Content-Type": "application/json"
}
Example Input (Request Body) :
{
"username": "marcel",
"email": "[email protected]",
"password": "123",
}
Response (201, Data berhasil ditambahkan):
{
"username": "marcel",
"email": "[email protected]",
"password": "1aojadoa2sdasd4adplalaxlasclsml",
"updatedAt": "2020-02-03T13:03:50.806Z",
"createdAt": "2020-02-03T13:03:50.806Z"
}
Example Input (Request Body) :
{
"username": "marcel",
"email": "[email protected]",
"password": "",
}
Response ERROR (400, Request tidak lengkap):
{
status: 400,
msg: "Bad Request"
}
Request header:
{
"Content-Type": "application/json"
}
Example Input (Request Body) :
{
"email": "[email protected]",
"password": "123",
}
Response (200, Respon Sukses ):
{
"username": "marcel",
"email": "[email protected]",
"password": "1aojadoa2sdasd4adplalaxlasclsml",
"updatedAt": "2020-02-03T13:03:50.806Z",
"createdAt": "2020-02-03T13:03:50.806Z"
}
Example Error Input (Request Body) :
{
"username": "marcel",
"email": "[email protected]",
"password": "",
}
Response ERROR(400, Data tidak lengkap):
{
status: 400,
msg: "Password cannot empty."
}
Response (200, Respon Sukses):
[
{
"id": 1,
"username": "marcelus",
"email": "[email protected]",
"password": "$2b$10$I2JXLSnEFazR50WQ4EiMPuNsYlOgoQBwJMgqG33Q0IrFEZY8HlrFG",
"createdAt": "2020-03-05T10:51:42.750Z",
"updatedAt": "2020-03-05T10:51:42.750Z"
},
{
"id": 2,
"username": "marcellll",
"email": "[email protected]",
"password": "$2b$10$WVYzEHBXfwd1X75iNUmA6OQMN80nrpXnp1VB7VZR/Gf8zGf3vGWlO",
"createdAt": "2020-03-05T12:51:42.921Z",
"updatedAt": "2020-03-05T12:51:42.921Z"
}
]
If the "data" was empty, the response will be :
"[]";
Request header:
{
"Content-Type": "application/json",
}
Example Input (Request Body) :
{
"email": "[email protected]",
"password": "123",
}
Response (200, Respon Sukses):
{
"username": "marcel",
"email": "[email protected]",
"password": "1aojadoa2sdasd4adplalaxlasclsml",
"updatedAt": "2020-02-03T13:03:50.806Z",
"createdAt": "2020-02-03T13:03:50.806Z"
}
Example Error Input (Request Body) :
{
"username": "marcel",
"email": "[email protected]",
"password": "",
}
Response ERROR(400, Data tidak lengkap):
{
status: 400,
msg: "Password cannot empty."
}
Url | Method | Description |
---|---|---|
/kanbans | POST | Menambahkan kanbans baru kedalam kanbans list |
/kanbans | GET | Mencari atau Melihat kanbans punya user |
/kanbans/:id | GET | Mencari atau Melihat kanbans berdasarkan id |
/kanbans/:id | PUT | Mengedit Data kanbans |
/kanbans/:id | DELETE | Menghapus kanbans dari table favorite |
Example Input (Request Body) :
{
"name": "Mandi"
"CategoryId": 1,
}
Response (201, data berhasil ditambahkan):
{
"id": 26,
"name": "mandi",
"UserId": 1,
"CategoryId": 1,
"updatedAt": "2020-03-16T09:33:50.071Z",
"createdAt": "2020-03-16T09:33:50.071Z"
}
Example ERROR Input (Request Body) :
{
"name": ""
"CategoryId": 1,
}
Response (400, Bad Request):
[
"Kanban's Cannot Empty."
]
Response (200, response sukses):
[
{
"id": 22,
"name": "Mengayak Tepung",
"CategoryId": null,
"UserId": 1,
"createdAt": "2020-03-16T09:20:29.722Z",
"updatedAt": "2020-03-16T09:20:29.722Z",
"Category": null
},
{
"id": 25,
"name": "Owyeaaahhh!",
"CategoryId": 3,
"UserId": 1,
"createdAt": "2020-03-16T09:25:29.123Z",
"updatedAt": "2020-03-16T09:25:29.123Z",
"Category": {
"id": 3,
"title": "Done",
"createdAt": "2020-03-13T13:56:56.877Z",
"updatedAt": "2020-03-13T13:56:56.877Z"
}
},
{
"id": 26,
"name": "mandi",
"CategoryId": null,
"UserId": 1,
"createdAt": "2020-03-16T09:33:50.071Z",
"updatedAt": "2020-03-16T09:33:50.071Z",
"Category": null
}
]
Example Input (Request Body) :
{
"name": "Mandi",
"CategoryId": 2
}
Response (200, response sukses):
{
{
"id": 26,
"name": "mandi",
"UserId": 1,
"CategoryId": 2,
"updatedAt": "2020-03-16T09:33:50.071Z",
"createdAt": "2020-03-16T09:33:50.071Z"
}
}
If the ID wasn't found the respond will be (404, data not found):
{
status: 404,
msg: "data not found"
}
Example Input (Request Body) :
{
"name": "",
}
Response ERROR (400, data tidak lengkap):
{
"status": 400,
"msg": "Kanban cannot be empty."
}
Example Input (Request Params) :
req.params.id = 2
Response (200, response if success):
1
Example Error Input (Request Body) :
req.params.id = 2
Response ERROR (404, data not found):
{
status: 404
msg: 'Data not found'
}
Example Input (Request Params) :
req.params.id = 2
Response (200, response if success):
{
{
"id": 25,
"name": "Owyeaaahhh!",
"CategoryId": 3,
"UserId": 1,
"createdAt": "2020-03-16T09:25:29.123Z",
"updatedAt": "2020-03-16T09:25:29.123Z",
"Category": {
"id": 3,
"title": "Done",
"createdAt": "2020-03-13T13:56:56.877Z",
"updatedAt": "2020-03-13T13:56:56.877Z"
}
}
}
Example Error Input (Request Body) :
req.params.id = 2
Response ERROR (404, data not found):
{
status: 404
msg: 'Data not found'
}
Url | Method | Description |
---|---|---|
/Categories | POST | Menambahkan Categories baru kedalam Categories list |
/Categories | GET | Mencari atau Melihat Categories punya user |
/Categories/:id | GET | Mencari atau Melihat Categories berdasarkan id |
/Categories/:id | PUT | Mengedit Data Categories |
/Categories/:id | DELETE | Menghapus Categories dari table favorite |
Example Input (Request Body) :
{
"title": "masyukk",
}
Response (201, data berhasil ditambahkan):
{
"id": 5,
"title": "masyukk",
"updatedAt": "2020-03-16T09:44:26.188Z",
"createdAt": "2020-03-16T09:44:26.188Z"
}
Response (200, response sukses):
[
{
"id": 1,
"title": "Backlog",
"createdAt": "2020-03-13T13:56:56.877Z",
"updatedAt": "2020-03-13T13:56:56.877Z",
"Kanbans": []
},
{
"id": 2,
"title": "Todo",
"createdAt": "2020-03-13T13:56:56.877Z",
"updatedAt": "2020-03-13T13:56:56.877Z",
"Kanbans": []
},
{
"id": 3,
"title": "Done",
"createdAt": "2020-03-13T13:56:56.877Z",
"updatedAt": "2020-03-13T13:56:56.877Z",
"Kanbans": [
{
"id": 25,
"name": "Owyeaaahhh!",
"CategoryId": 3,
"UserId": 1,
"createdAt": "2020-03-16T09:25:29.123Z",
"updatedAt": "2020-03-16T09:25:29.123Z"
}
]
},
{
"id": 4,
"title": "Completed",
"createdAt": "2020-03-13T13:56:56.877Z",
"updatedAt": "2020-03-13T13:56:56.877Z",
"Kanbans": []
},
{
"id": 5,
"title": "masyukk",
"createdAt": "2020-03-16T09:44:26.188Z",
"updatedAt": "2020-03-16T09:44:26.188Z",
"Kanbans": []
}
]
Example Input (Request Body) :
{
"title": "coba"
}
Response (200, response sukses):
[
1,
[
{
"id": 5,
"title": "coba",
"createdAt": "2020-03-16T09:44:26.188Z",
"updatedAt": "2020-03-16T09:48:53.277Z"
}
]
]
If the ID wasn't found the respond will be (404, data not found):
{
status: 404,
msg: "data not found"
}
Example Input (Request Body) :
{
"title": "Summer Paradise",
"artist": ""
}
Response ERROR (400, data tidak lengkap):
{
"status": 400,
"msg": "Artist cannot be empty."
}
Example Input (Request Params) :
req.params.id = 2
Response (200, response if success):
1
Example Error Input (Request Body) :
req.params.id = 2
Response ERROR (404, data not found):
{
status: 404
msg: 'Data not found'
}
Example Input (Request Params) :
req.params.id = 5
Response (200, response if success):
{
"id": 5,
"title": "coba",
"createdAt": "2020-03-16T09:44:26.188Z",
"updatedAt": "2020-03-16T09:48:53.277Z"
}
Example Error Input (Request Body) :
req.params.id = 5
Response ERROR (404, data not found):
{
status: 404
msg: 'Data not found'
}