- Installed Docker
- Installed
golang-migrate
make help
to see all available instructionsmake run
to build & run projectmake migrate-users
&make migrate-tasks
to apply database migrations
- Run
make run
in terminal window - If you are running project locally for the first time, open new window and run
make migrate-users && make migrate-tasks
- Inter Process Communication (gRPC / Message Queue)
- Logging & Tracing
Create New User
Example Input:
{
"first_name": "Albert",
"last_name": "Einstein",
"username": "generalrelativity",
"password": "E=mc2baby"
}
Example Response:
{
"id": 1
}
Generate JWT Token
Example Input:
{
"username": "generalrelativity",
"password": "E=mc2baby"
}
Example Response:
{
"access_token": "eyJhbGciOiJIUzI1NiIsImtpZCI6IjEifQ.eyJhdWQiOiJodHRwOi8vZ2F0ZXdheTo4MDgwIiwiZXhwIjoxNjAzMzAzMzUyLCJpc3MiOiJodHRwOi8vdXNlcnMtc2VydmljZTo4MDAwIiwidXNlcl9pZCI6MX0.nL3ZtfqxBsgMLFcPrX16MekQWrduWE3dAUGFhm1bZzI"
}
Return User Info
HTTP Headers:
Authorization: Bearer <access_token>
Example Response:
{
"id": 1,
"first_name": "Albert",
"last_name": "Einstein",
"username": "generalrelativity",
"password": "E=mc2baby"
}
Create New Task
HTTP Headers:
Authorization: Bearer <access_token>
Example Input:
{
"title": "Task 1"
}
Example Response:
{
"id": 1
}
Get All Tasks
HTTP Headers:
Authorization: Bearer <access_token>
Example Response:
{
"tasks": [
{
"id": 1,
"title": "Task 1",
"created_at": "2020-10-21T06:09:26.654986Z",
"user_id": 1
}
]
}
Get Task By Id
HTTP Headers:
Authorization: Bearer <access_token>
Example Response:
{
"id": 1,
"title": "Task 1",
"created_at": "2020-10-21T06:09:26.654986Z",
"user_id": 1
}