Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
241 changes: 239 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,239 @@
# kanban-app
Membuat kanban web app
# Koala-app

 

## Endpoints
````
- POST /register
- POST /login
- POST /googleLogin
- POST /tasks/:id
- GET /tasks
- GET /tasks/:id
- DELETE /tasks/:id
````

## RESTful endpoints

### POST /register

> Create new user to database
_Request Header_
```
not needed
```

_Request Body_
```json
{
"username": "Input username User",
"email": "<email to get insert into>",
"password": "<password to get insert into>",
}
```

_Response (200 - Created)_
```json
{
"message": "ok"
}
```

_Response (400 - Bad Request)_
```json
{
"message": "Please input email format!, Password minimum 4 characters!"
}
```

### POST /login

> Login to kanban
_Request Header_
```
not needed
```

_Request Body_
```json
{
"email": "<email to get insert into>",
"password": "<password to get insert into>"
}
```

_Response (200)_
```json
{
"access_token": "<access_token>"
}
```

_Response (401 - Bad Request)_
```json
{
"message": "Invalid email or password"
}
```

### POST /google-login

> Login to kanban app with your google account
_Request Header_
```
not needed
```

_Request Body_
```json
{
"username": "Input username User",
"email": "<google email insert into>",
"password": "google password insert into"
}
```

_Response (200)_
```json
{
"token": "<access_token>"
}
```

_Response (400 - Bad Request)_
```json
{
"message": "Cannot authorize google account"
}
```

_Response (500 - Internal Server Error)_
```json
{
"message": "Internal Server Error"
}
```

### GET /tasks

> Show all the tasks lists
_Request Header_
```json
{
"access_token": "<your access token>"
}
```
_Request Body_
```
not needed
```

_Response (200)_
```json
{
"<category_name>": [
{
"id": 1,
"title": "<title_name>",
"UserId": 1,
"CategoryId": 1,
"createdAt": "2020-09-09T14:55:06.648Z",
"updatedAt": "2020-09-09T15:30:58.690Z",
"User": {
"id": 1,
"email": "<user_email>",
"password": "<user_password>",
"organization": "<user organization>",
"createdAt": "2020-09-09T05:52:45.218Z",
"updatedAt": "2020-09-09T05:52:45.218Z"
},
"Category": {
"id": 1,
"name": "<category_name>",
"createdAt": "2020-09-09T14:47:18.118Z",
"updatedAt": "2020-09-09T14:47:18.118Z"
}
}
]
}
```

_Response (400)_
```json
{
"message": "invalid input"
}
```

_Response (500 - Internal server error)_
```json
{
"message": "Internal Server Error"
}
```

### POST /tasks/:id
> Create new tasks
_Request Header_
```json
{
"access_token": "<your access token>"
}
```

_Request Body_
```json
{
"title": "<title to get insert into>",
"description": "<Task description>",
"status": "<Task status>"
}
```

_Response (201 - Created)_
```json
"message": "ok"
```
_Response (400 - Bad Request)_
```json
{
"message": "Please fill the title!"
}
```

### DELETE /tasks/:id

> Delete tasks data by ID
_Request Header_
```json
{
"access_token": "<your access token>"
}
```

_Response(200)_
```json
[
{
"id": "<selected id>",
"title": "<tasks title>",
"UserId": "<tasks UserId>",
"CategoryId": "<tasks CategoryId>",
"createdAt": "2020-03-20T07:15:12.149Z",
"updatedAt": "2020-03-20T07:15:12.149Z",
},
]
```
> Error response:
_Response (404 - Not Found)_
```json
{
"message": "Not Found"
}
```
_Response (500 - Internal Server Error)_
```json
{
"message": "Internal Server Error"
}
```
3 changes: 3 additions & 0 deletions client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
dist
.cache
Binary file added client/img/arrow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/img/google.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/img/logo2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/img/plus2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions client/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="style.css">
<link href="https://fonts.googleapis.com/css?family=Play&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<meta name="google-signin-client_id" content="186335441114-7j536mckj8h2c6ipqs7vm3loqoqfdc4g.apps.googleusercontent.com">
<title>NABNAK</title>
<script src="https://kit.fontawesome.com/1c3efbdd40.js" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@9"></script>
</head>
<body>
<div id="app"></div>
<script src="./main.js"></script>
<script src="https://apis.google.com/js/platform.js" async defer></script>
</body>
</html>
10 changes: 10 additions & 0 deletions client/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import Vue from "vue";
import App from "./src/App.vue"
import GoogleSignInButton from 'vue-google-signin-button-directive'


new Vue({
render: ele => ele(App),
GoogleSignInButton,

}).$mount('#app')
Loading