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

Alfian Tirta #1

Open
wants to merge 37 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
671de08
first commit
alftirta Nov 20, 2020
d89b02e
initialized users rest api document
alftirta Nov 21, 2020
0cd906a
update users service db schema
alftirta Nov 21, 2020
aa51a44
added users service api doc, users endpoint, bcrypt, jwt, mailgun, er…
alftirta Nov 23, 2020
9f98e03
covered ElephantSQL URL
alftirta Nov 23, 2020
3900801
user registration & verification features done
alftirta Nov 24, 2020
5020ecb
fixed bugs on user verification feature
alftirta Nov 24, 2020
12a5851
user login feature done
alftirta Nov 24, 2020
90d449c
added posts endpoints, updated users service api doc, added authentic…
alftirta Nov 24, 2020
ae49198
added posts validation
alftirta Nov 25, 2020
f6996d6
added authorization middleware, implemented authorization in edit and…
alftirta Nov 25, 2020
2d2bdd5
added likes endpoints along with constraints and validations; added a…
alftirta Nov 25, 2020
7963265
opened http get methods to public (including unregistered user)
alftirta Nov 25, 2020
8c89d99
added comments endpoints with validation
alftirta Nov 25, 2020
4f66270
added sub-comments endpoints, updated get users, updated users servic…
alftirta Nov 25, 2020
8bd0cd4
updated erd, changed name db_schema to blog_app_erd
alftirta Nov 25, 2020
839edad
added send notification email when someone gave like or commented on …
alftirta Nov 25, 2020
4d1aea5
added send notification email when someone commented on a comment; ed…
alftirta Nov 25, 2020
cb3dd4e
post search with filter feature done, include validation
alftirta Nov 26, 2020
793926d
logs service done, updated api doc
alftirta Nov 27, 2020
d4afc4c
updated blog_app_erd.png
alftirta Nov 27, 2020
166754a
development done, deploy on progress
alftirta Nov 30, 2020
fdd846d
fixed redis
alftirta Nov 30, 2020
0a77d3a
fixed typo: "seconds" to "milliseconds" in logs_api.md
alftirta Nov 30, 2020
f59b358
modified
alftirta Dec 1, 2020
db555fa
fixed logs API bugs in graphqlOrchestrator
alftirta Dec 1, 2020
2211094
modified
alftirta Dec 1, 2020
f3c9a15
deployed users api to https://blog-users-api-alftirta.herokuapp.com
alftirta Dec 1, 2020
9c8af8e
changed logs localhost to online in users api; deployed logs api to h…
alftirta Dec 1, 2020
5af816a
made logger url dynamic between production and development stage
alftirta Dec 1, 2020
4cc5a3c
added get all users feature; updated users api doc
alftirta Dec 1, 2020
777fc94
connected get all users feature to graphqlOrchestrator with caching u…
alftirta Dec 1, 2020
4e32fd6
deleted unused console.log line
alftirta Dec 1, 2020
bcf7eaa
made base url and port dynamic between development and production stage
alftirta Dec 1, 2020
7d24a59
deployed graphqlOrchestrator with playground enabled
alftirta Dec 1, 2020
c7e004d
set redis only on development stage
alftirta Dec 1, 2020
acd77c2
fixed typo: changed "users" to "logs" in logsAPI.js file
alftirta Dec 1, 2020
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
Binary file added blog_app_erd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
200 changes: 200 additions & 0 deletions logs_api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
# Blog App - Logs Service API
Blog App is an application to manage your blog. It has two services : Users & Logs.

This document explains the Logs services.

The Logs service has :

* RESTful endpoints for create, read, delete, and reset operations of blog access logs.
* JSON formatted response.

 

## Endpoints
```
- POST /logs
- GET /logs
- DELETE /posts/:id
- DELETE /logs
```

## RESTful endpoints
### POST /logs

> Create blog access log

_Request Header_
```
not needed
```

_Request Body_
```
{
"path": "<api path>",
"user_detail": {user detail object},
"api_access_time": <api access time in milliseconds>,
"request_object": {api request object},
"response_object": {api response object}
}
```

_Response (201 - Created)_
```
{
"_id": "<log id>"
"path": "<api path>",
"user_detail": {user detail object},
"api_access_time": <api access time in seconds>,
"request_object": {api request object},
"response_object": {api response object},
"createdAt": "<the time when the log was created>",
"updatedAt": "<the time when the log was updated>",
"__v": <version key that represents the path to use for versioning>
}
```

_Response (400 - Bad Request)_
```
[
"<error message>",
...
]
```

_Response (500 - Internal Server Error)_
```
[
"Internal Server Error"
]
```
---
### GET /logs

> Get all blog access logs

_Request Header_
```
not needed
```

_Request Body_
```
not needed
```

_Response (200 - OK)_
```
[
{
"_id": "<log id>"
"path": "<api path>",
"user_detail": {user detail object},
"api_access_time": <api access time in seconds>,
"request_object": {api request object},
"response_object": {api response object},
"createdAt": "<the time when the log was created>",
"updatedAt": "<the time when the log was updated>",
"__v": <version key that represents the path to use for versioning>
},
...
]
```

_Response (400 - Bad Request)_
```
[
"<error message>",
...
]
```

_Response (500 - Internal Server Error)_
```
[
"Internal Server Error"
]
```
---
### DELETE /logs/:id

> Delete a blog access log by its id

_Request Header_
```
not needed
```

_Request Body_
```
not needed
```

_Response (200 - OK)_
```
{
"message": "Delete Log Success",
"deleted_log": {
"_id": "<log id>"
"path": "<api path>",
"user_detail": {user detail object},
"api_access_time": <api access time in milliseconds>,
"request_object": {api request object},
"response_object": {api response object},
"createdAt": "<the time when the log was created>",
"updatedAt": "<the time when the log was updated>",
"__v": <version key that represents the path to use for versioning>
}
}
```

_Response (400 - Bad Request)_
```
[
"<error message>",
...
]
```

_Response (500 - Internal Server Error)_
```
[
"Internal Server Error"
]
```
---
### DELETE /logs

> Delete all (reset) blog access logs by its id

_Request Header_
```
not needed
```

_Request Body_
```
not needed
```

_Response (200 - OK)_
```
{
"message": "Reset Logs Success"
}
```

_Response (400 - Bad Request)_
```
[
"<error message>",
...
]
```

_Response (500 - Internal Server Error)_
```
[
"Internal Server Error"
]
```
2 changes: 2 additions & 0 deletions server/orchestrators/graphqlOrchestrator/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
.env
Loading