-
Notifications
You must be signed in to change notification settings - Fork 18
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
Muhamad Fadhil Surya Putra #9
Open
fadhilsurya
wants to merge
10
commits into
humble-fox-2019:master
Choose a base branch
from
fadhilsurya:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
2ba1b20
fadhilsurya
fadhilsurya 2e81ff4
fadhilsurya
fadhilsurya ab27333
fadhilsurya
fadhilsurya d1932ce
.env include in .txt
fadhilsurya b0acde8
env fixed
fadhilsurya 3b29ed6
Delete .env
fadhilsurya 93da066
update to deploy
fadhilsurya 83d5794
update to deploy
fadhilsurya 1dfbb23
update client
fadhilsurya dc8c6fc
update client
fadhilsurya File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,252 @@ | ||
# fancy-todo | ||
# fancy-todo | ||
|
||
All the APIs endpoint using base URL: | ||
```javascript | ||
http://localhost:3000 | ||
``` | ||
|
||
## Index of Reference: | ||
* [User]() | ||
* [Todo]() | ||
|
||
## User API | ||
| HTTP | Endpoint | Headers | Body | Description | | ||
|--------|----------|---------|------|-------------| | ||
| POST | /user/signup | none | name: string<br>email: string<br>password: string | Register new user | | ||
| POST | /user/signin | none | email: string<br>password: string | Login user | | ||
| POST | /user/signInGoogle | none | log in using user google account | Login user | | ||
|
||
## Todo API | ||
| HTTP | Endpoint | Headers | Body | Description | | ||
|--------|----------|---------|------|-------------| | ||
| GET | /todo | {token: JWT token} | none | get user todo list | | ||
| POST | /todo| {token: JWT token} | todo : string<br>description : string<br>dueDate : date | create todo list | | ||
| GET | /todo/search | {token: JWT token, id : userId, todo : string} | none | find user todo and display | | ||
| GET | /todo/:id | {token: JWT token, id:todoId} | none | find user todo for to be display for update requirements | | ||
| PUT | /todo/:id | {token: JWT token, id : todoId} | {todo :string, description :string, dueDate :date} | update todo that matches with | | ||
| DELETE | /todo/:id | {token: JWT token, id : userId} | none | get global published articles | | ||
|
||
# Request & Response Details | ||
|
||
## User | ||
+ ### Register | ||
method: `POST`<br> | ||
endpoint: `/user/signup` | ||
|
||
#### _Request_ : | ||
* body: | ||
```javascript | ||
name: String, required | ||
email: String, required | ||
password: String, required | ||
``` | ||
|
||
#### _Response_ : | ||
- 201 | ||
```javascript | ||
{code: 201, message: "Berhasil SignUp"} | ||
|
||
``` | ||
- 400 | ||
```javascript | ||
{ | ||
"code": 400, | ||
"message": "Mohon Maaf Nama Harus di Isi" | ||
} | ||
``` | ||
|
||
+ ### Login | ||
method: `POST`<br> | ||
endpoint: `/users/login` | ||
|
||
#### _Request_ : | ||
* body: | ||
```javascript | ||
email: String, required | ||
password: String, required | ||
``` | ||
|
||
#### _Response_ : | ||
- 200 | ||
```javascript | ||
Get an access token (JWT Token) | ||
{token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI1Z…DIxfQ.rCDMqKOnNie3UktVbTbwayGzUiN3_SoHT6qlk15RYvI"} | ||
``` | ||
- 401 | ||
```javascript | ||
{"code":401,"message":"Mohon Maaf Password Salah"} | ||
``` | ||
|
||
## Todo | ||
+ ### find all Todo | ||
method: `GET`<br> | ||
endpoint: `/todo` | ||
|
||
#### _Request_ : | ||
* body: | ||
```javascript | ||
todo: "foo", | ||
desc: "bar, | ||
due_date: "2019-10-10", | ||
token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwidXNlcm5hbWUiOiJiYWR1IiwiZW1haWwiOiJiYWR1QG1haWwuY29tIiwiaWF0IjoxNTY0OTkzNzgxfQ.Q4JKT7BRNCPOGUgTF-9NQTU2YASPRg7a3kO72fpPRY8 | ||
``` | ||
|
||
#### _Response_ : | ||
- 201 | ||
```javascript | ||
status: false, | ||
_id: 5d757aed076a72e08de1817e, | ||
userId: 5d757585076a72e08de1817b, | ||
todo: 'cemilan', | ||
description: 'macaroni maicih', | ||
dueDate: 2019-09-16T00:00:00.000Z, | ||
createdAt: 2019-09-08T22:04:29.632Z, | ||
updatedAt: 2019-09-08T22:04:29.632Z | ||
``` | ||
- 400 | ||
```javascript | ||
{ | ||
"code": 403 | ||
} | ||
``` | ||
|
||
+ ### create Todo | ||
method: `POST`<br> | ||
endpoint: `/todo` | ||
|
||
#### _Request_ : | ||
* body: | ||
```javascript | ||
todo: 'halooo', | ||
description: 'asfqwreqwr', | ||
dueDate: '2019-09-10' | ||
``` | ||
|
||
#### _Response_ : | ||
- 201 | ||
```javascript | ||
createdAt: "2019-09-08T23:21:52.329Z" | ||
description: "asfqwreqwr" | ||
dueDate: "2019-09-10T00:00:00.000Z" | ||
status: false | ||
todo: "halooo" | ||
updatedAt: "2019-09-08T23:21:52.329Z" | ||
userId: "5d757585076a72e08de1817b" | ||
_id: "5d758d10a528cb008eb62228" | ||
``` | ||
- 400 | ||
```javascript | ||
{ | ||
"code": 401 | ||
} | ||
``` | ||
+ ### create Todo | ||
method: `POST`<br> | ||
endpoint: `/todo` | ||
|
||
#### _Request_ : | ||
* body: | ||
```javascript | ||
todo: 'halooo', | ||
description: 'asfqwreqwr', | ||
dueDate: '2019-09-10' | ||
``` | ||
|
||
#### _Response_ : | ||
- 201 | ||
```javascript | ||
createdAt: "2019-09-08T23:21:52.329Z" | ||
description: "asfqwreqwr" | ||
dueDate: "2019-09-10T00:00:00.000Z" | ||
status: false | ||
todo: "halooo" | ||
updatedAt: "2019-09-08T23:21:52.329Z" | ||
userId: "5d757585076a72e08de1817b" | ||
_id: "5d758d10a528cb008eb62228" | ||
``` | ||
- 400 | ||
```javascript | ||
{ | ||
"code": 401 | ||
} | ||
``` | ||
+ ### search Todo | ||
method: `GET`<br> | ||
endpoint: `/todo/search` | ||
|
||
#### _Request_ : | ||
* body: | ||
```javascript | ||
{todo: todo} | ||
``` | ||
|
||
#### _Response_ : | ||
- 201 | ||
```javascript | ||
createdAt: "2019-09-08T23:12:41.959Z" | ||
description: "suryaaa" | ||
dueDate: "2019-09-23T00:00:00.000Z" | ||
status: false | ||
todo: "fadhil" | ||
updatedAt: "2019-09-08T23:12:41.959Z" | ||
userId: "5d757585076a72e08de1817b" | ||
_id: "5d758ae9560c27fb8b3141e0" | ||
``` | ||
- 403 | ||
```javascript | ||
{ | ||
"code": 403 | ||
} | ||
``` | ||
|
||
+ ### update Todo | ||
method: `PUT`<br> | ||
endpoint: `/todo/:id` | ||
|
||
#### _Request_ : | ||
* body: | ||
```javascript | ||
{id: todoId} | ||
``` | ||
|
||
#### _Response_ : | ||
- 201 | ||
```javascript | ||
n: 1 | ||
nModified: 1 | ||
ok: 1 | ||
``` | ||
- 403 | ||
```javascript | ||
{ | ||
"code": 401 | ||
} | ||
``` | ||
+ ### delete Todo | ||
method: `DELETE`<br> | ||
endpoint: `/todo/:id` | ||
|
||
#### _Request_ : | ||
* body: | ||
```javascript | ||
{id: todoId} | ||
``` | ||
|
||
#### _Response_ : | ||
- 201 | ||
```javascript | ||
n: 1 | ||
nModified: 1 | ||
ok: 1 | ||
``` | ||
- 403 | ||
```javascript | ||
{ | ||
"code": 401 | ||
} | ||
``` | ||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
body { | ||
min-height: 100vh; | ||
position: relative; | ||
margin: 0; | ||
} | ||
|
||
footer { | ||
position: absolute; | ||
bottom: 0; | ||
} | ||
|
||
thead { | ||
background-color: grey; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | ||
<script src="https://apis.google.com/js/platform.js" async defer></script> | ||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" | ||
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous"> | ||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" | ||
integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"> | ||
</script> | ||
<meta name="google-signin-client_id" | ||
content="895491504741-7fvkjjp5p3fa3jn3hljfl4juhcrqde4h.apps.googleusercontent.com"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | ||
<link rel="stylesheet" href="./css/main.css"> | ||
|
||
|
||
|
||
<title>Fadhil Todos</title> | ||
</head> | ||
|
||
<body> | ||
<!-- INI BAGIAN NAVBARNYA --> | ||
<div class="navbarout" id="navbarTokenFalse"> | ||
|
||
<nav class="navbar navbar-expand-lg navbar-dark bg-dark"> | ||
<a class="navbar-brand" href="#">Simple Todo</a> | ||
|
||
|
||
<div class="btn-group ml-auto "> | ||
<form action="" class="mr-5 formbar"> | ||
<input type="text" placeholder="search" name="search" class="searchbar" id="search"> | ||
<button type="submit" id="submitsearch" class="searchButton" | ||
style="border-radius: 10%">Submit</button> | ||
|
||
</form> | ||
<!-- <a href="#" onclick="signOut();" class="btn btn-outline-warning ml-2 rounded-lg">Sign out</a> --> | ||
<a href="#" onclick="signOut();" id="logOut" class="btn-logout">Sign out</a> | ||
<a href="" id="login" class="signin-form btn btn-login ml-4 " style="color: white">Sign In</a> | ||
<a href="" id="home" class="btn btn-warning ml-4 home-btn">Home</a> | ||
</div> | ||
|
||
</div> | ||
|
||
|
||
<div class="todo-form"> | ||
</div> | ||
<!-- INI ISINYA --> | ||
<div class=" container homepage mt-5"> | ||
<div class="banner-outer register-form align-items-center col-5"> | ||
<div class="banner-inner"> | ||
<h1 class="welcome-register">Welcome to Fancy Todo</h1> | ||
<h2 class="motto">ready to Organized your life?</h2> | ||
<form action=""> | ||
<table> | ||
<tr> | ||
<td>Name</td> | ||
<td><input type="text" name="name" id="name" placeholder="your username" required> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td>Email</td> | ||
<td><input type="text" name="email" id="email" placeholder="your email" required> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td>Password</td> | ||
<td><input type="password" name="password" id="password" placeholder="your password" | ||
required> | ||
</td> | ||
</tr> | ||
</table> | ||
<br> | ||
<div class="btn-group ml-3"> | ||
<a href="" class="btn-register btn btn-success">Register</a> | ||
<div class="g-signin2 signin" data-onsuccess="onSignIn"></div> | ||
|
||
</div> | ||
|
||
|
||
<br> | ||
</form> | ||
<br> | ||
|
||
|
||
</div> | ||
</div> | ||
</div> | ||
|
||
|
||
<div id="otherLogin"> | ||
|
||
|
||
</div> | ||
|
||
<!-- script --> | ||
|
||
<script src="https://code.jquery.com/jquery-3.4.1.min.js" | ||
integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script> | ||
<script src="./index.js"></script> | ||
|
||
|
||
<div class="d-flex justify-content-center"> | ||
<footer class="page-footer font-small blue "> | ||
<div class=" footer-copyright text-center py-3">© 2019 Copyright: | ||
<a href="https://mdbootstrap.com/education/bootstrap/"> fadhilsurya</a> | ||
</div> | ||
</footer> | ||
</div> | ||
|
||
</body> | ||
|
||
</html> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
biasanya ada di folder server
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PASSWORD="susumurninasional"
JWT_SALT="garam"
GOOGLE_CLIENT_ID="895491504741-7fvkjjp5p3fa3jn3hljfl4juhcrqde4h.apps.googleusercontent.com"
MONGOATLAS=mongodb+srv://fadhilsurya:[email protected]/test?retryWrites=true&w=majority
berikut mas untuk envnya