Try me :) My-Kanban
- Clone this repo
- run
npm install
either in server folder or client folder.
- SERVER
- run
npx sequelize-cli db:create
on server folder
DON'T FORGET TO CONFIG YOUR DB (config.js) - run
npx sequelize-cli db:migrate
then - run
node app.js
on your server folder
( server should behttp://localhost:3000
)
( Hosted serverhttps://vast-wave-36573.herokuapp.com
)
- CLIENT
- Install
parcel-bundler
if you didn't have it yet
(npm install -g parcel-bundler
) - go through
client/public/
folder - run
parcel index.html
( client should behttp://localhost:1234
)
- ___POST/tasks:
- Request header:
{
"Content-Type": "application/json"
}
- Request body:
{
"title":"RestAPI",
"category": "routing",
}
- Response:
Success
{
"status": 201
"message": "Berhasil menambah data"
"data": {
"id": 1,
"title":"RestAPI",
"category": "routing",
"UserId":<integer>
}
}
Error
{
status: 404
"error": "Error message"
}
{
"status": 500
"error": "Internal server error"
}
- GET/tasks:
- Response:
Success
{
"status": 200
"data": [{All data from database}]
}
Error
{
"status": 404
"error": "Error message"
}
{
"status": 500
"error": "Internal server error"
}
- GET/tasks/:id:
- Response:
Success
{
"status": 200
"data": [{ Specified data as requested from database}]
}
Error
{
"status": 404
"error": "Error message"
}
{
"status": 500
"error": "Internal server error"
}
- PUT/tasks/:id:
- Request body:
{
"title":"RestAPI",
"category": "routing",
}
- Response:
Success
{
"status": 201
"message": "Berhasil mengupdate data"
}
Error
{
status: 404
"error": "Error message"
}
{
"status": 500
"error": "Internal server error"
}
- DELETE/tasks/:id_:
- Response:
Success
{
"status": 200
"message": "Berhasil menghapus data"
}
Error
{
"status": 500
"error": "Internal server error"
}
- __POST/register:
- Request header:
{
"Content-Type": "application/json"
}
- Request body:
{
"email": "jhondoe@google.com",
"password":"*******",
}
- Response:
{
"id": 1
"email": "jhondoe@google.com",
"password":"*******"
"organization": "Hactiv8",
}
Success
{
"status": 201
"message": "succesfuly created new user"
}
Error
{
status: 400
"error": "validation error"
}
{
"status": 500
"error": "Internal server error"
}
- POST/login:
- Request header:
{
"Content-Type": "application/json"
}
- Request body:
{
"username":"Jhon Doe",
"password":"*******"
}
- Response:
Success
{
"status": 201
"message": "succesfuly created new user"
"token": "kjashsncfhvoyi38572375nicuelircw"
}
Error
{
status: 400
"error": "Bad request"
}
{
"status": 500
"error": "Internal server error"
}
- POST/todos/google-sign-in:
- Request body:
{
"token": "hancyb8a7aw83n4nx"
}
- Response:
Success
{
"status": 200
"message": "succesfuly signed in"
}
Success
{
"status": 201
"message": "succesfuly created new user"
}
Error
{
status: 400
"error": "Bad request"
}
{
"status": 500
"error": "Internal server error"
}