Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Marcel Maruli Pasaribu #31

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
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
1 change: 1 addition & 0 deletions .env-example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
secretCode=cialobaobao
197 changes: 197 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,199 @@
# fancy-to-do
Fancy To-Do List API, Documentation


# FANCY TO-DO LIST API
Fancy To-Do List API

### 1. POST /todos
_Request header:_

```javascript
{
"Content-Type": "application/json"
}
```

<br>

_Example Input (Request Body) :_

```javascript
{
"title": "memasak",
"description": "memasak rendang",
"status": "Belum",
"due_date": "2020-12-12T00:00:00.000Z"
}
```

_Response :_

```javascript
{
"id": 26,
"title": "memasak",
"description": "memasak rendang",
"status": "Belum",
"due_date": "2020-12-12T00:00:00.000Z",
"updatedAt": "2020-02-03T13:03:50.806Z",
"createdAt": "2020-02-03T13:03:50.806Z"
}
```

### 2. GET /todos

<br>

_Response :_

```javascript
{
"id": 26,
"title": "memasak",
"description": "memasak rendang",
"status": "Belum",
"due_date": "2020-12-12T00:00:00.000Z",
"updatedAt": "2020-02-03T13:03:50.806Z",
"createdAt": "2020-02-03T13:03:50.806Z"
}
```

### 3. GET /todos/:id

_Example Input (Request Params) :_

```javascript
localhost:3000/todos/1
```

_Response :_

```javascript
{
"id": 1,
"title": "memasak",
"description": "memasak rendang",
"status": "Belum",
"due_date": "2020-12-12T00:00:00.000Z",
"updatedAt": "2020-02-03T13:03:50.806Z",
"createdAt": "2020-02-03T13:03:50.806Z"
}
```

_If the "id" wasn't found, the response will be :_

```javascript
"ID not found"
```

### 4. PUT /todos/:id

_Example Input (Request Params) :_

```javascript
localhost:3000/todos/1
```

_Example Input (Request Body) :_

```javascript
{
"title": "mandiin buaya",
"description": "mandiin 3 buaya",
"status": "Belum",
"due_date": "2020-12-12T00:00:00.000Z"
}
```

_Response :_

```javascript
{
"id": 1,
"title": "mandiin buaya",
"description": "mandiin 3 buaya",
"status": "Belum",
"due_date": "2020-12-12T00:00:00.000Z",
"updatedAt": "2020-02-03T13:03:50.806Z",
"createdAt": "2020-02-03T13:03:50.806Z"
}
```

### 5. DELETE /todos/:id

_Example Input (Request Params) :_

```javascript
localhost:3000/todos/1
```

_Response :_

```javascript
{
"id": 1,
"title": "mandiin buaya",
"description": "mandiin 3 buaya",
"status": "Belum",
"due_date": "2020-12-12T00:00:00.000Z",
"updatedAt": "2020-02-03T13:03:50.806Z",
"createdAt": "2020-02-03T13:03:50.806Z"
}
```
# Third Party
Google OAUTH
SendGrid

# Server Documentation

## Server

Tools: NodeJS, Express, sequelize, postgresql

### Dependencies
| Package Name | Version |
| --------------- | ------------ |
| bcryptjs | ^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 |

### Example .env

PORT=3000
secretCode="cialobaobao"



### Default Port

3000

# API Documentation

## Todos

| Url | Method | Description |
| ------------- | ------------- | ------------- |
| / | POST | Membuat todo baru
| / | GET | Mendapatkan list todo
| /:id | GET | Mendapatkan data todo berdasarkan id
| /:id | PUT | Mengubah data todo berdasarkan id
| /:id | DELETE | Menghapus data todo berdasarkan id


## Table Responses

| 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 |
81 changes: 81 additions & 0 deletions client/css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/* Coded with love by Mutiullah Samim */
body,
html {
margin: 0;
padding: 0;
height: 100%;
background: #60a3bc !important;
}
.user_card {
height: 500px;
width: 350px;
margin-top: auto;
margin-bottom: auto;
background: #f39c12;
position: relative;
display: flex;
justify-content: center;
flex-direction: column;
padding: 10px;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
-webkit-box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
-moz-box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
border-radius: 5px;

}
.brand_logo_container {
position: absolute;
height: 170px;
width: 170px;
top: -75px;
border-radius: 50%;
background: #60a3bc;
padding: 10px;
text-align: center;
}
.brand_logo {
height: 150px;
width: 150px;
border-radius: 50%;
border: 2px solid white;
}
.form_container {
margin-top: 100px;
}
.login_btn {
width: 100%;
background: #c0392b !important;
color: white !important;
}
.login_btn:focus {
box-shadow: none !important;
outline: 0px !important;
}
.login_container {
padding: 0 2rem;
}
.input-group-text {
background: #c0392b !important;
color: white !important;
border: 0 !important;
border-radius: 0.25rem 0 0 0.25rem !important;
}
.input_user,
.input_pass:focus {
box-shadow: none !important;
outline: 0px !important;
}
.custom-checkbox .custom-control-input:checked~.custom-control-label::before {
background-color: #c0392b !important;
}

table{
font-family:'Calibri';
font-size:15px;
background-color:#fff;
color:#333;
}
.modal-header{
background-color:#333;
color:#fff;
}
Loading