https://github.com/zhashkevych/task-management-microservices
Microservice Architecture Example w/ Go + KrakenD + Postgres
https://github.com/zhashkevych/task-management-microservices
Last synced: 5 months ago
JSON representation
Microservice Architecture Example w/ Go + KrakenD + Postgres
- Host: GitHub
- URL: https://github.com/zhashkevych/task-management-microservices
- Owner: zhashkevych
- Created: 2020-10-18T08:08:13.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2020-10-24T05:24:05.000Z (almost 5 years ago)
- Last Synced: 2025-04-28T11:16:13.625Z (5 months ago)
- Language: Go
- Size: 98.6 KB
- Stars: 14
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Microservices Structure Example (Task Management Software)
## Stack
- Go
- Postgres
- KrakenD as API Gateway
- Lwan (as file server)
- Docker & Docker-Compose## Requirements
- Installed Docker
- Installed `golang-migrate`## CLI Tools
- `make help` to see all available instructions
- `make run` to build & run project
- `make migrate-users` & `make migrate-tasks` to apply database migrations## Build & Run Project
- 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`## TODO
- Inter Process Communication (gRPC / Message Queue)
- Logging & Tracing## Endpoints
### POST /user/sign-upCreate New User
**Example Input**:
```json
{
"first_name": "Albert",
"last_name": "Einstein",
"username": "generalrelativity",
"password": "E=mc2baby"
}
```
**Example Response**:
```json
{
"id": 1
}
```### GET /user/token
Generate JWT Token
**Example Input**:
```json
{
"username": "generalrelativity",
"password": "E=mc2baby"
}
```
**Example Response**:
```json
{
"access_token": "eyJhbGciOiJIUzI1NiIsImtpZCI6IjEifQ.eyJhdWQiOiJodHRwOi8vZ2F0ZXdheTo4MDgwIiwiZXhwIjoxNjAzMzAzMzUyLCJpc3MiOiJodHRwOi8vdXNlcnMtc2VydmljZTo4MDAwIiwidXNlcl9pZCI6MX0.nL3ZtfqxBsgMLFcPrX16MekQWrduWE3dAUGFhm1bZzI"
}
```### GET /user/profile
Return User Info
**HTTP Headers**:
```
Authorization: Bearer
```**Example Response**:
```json
{
"id": 1,
"first_name": "Albert",
"last_name": "Einstein",
"username": "generalrelativity",
"password": "E=mc2baby"
}
```### POST /tasks
Create New Task
**HTTP Headers**:
```
Authorization: Bearer
```**Example Input**:
```json
{
"title": "Task 1"
}
```
**Example Response**:
```json
{
"id": 1
}
```### GET /tasks
Get All Tasks
**HTTP Headers**:
```
Authorization: Bearer
```**Example Response**:
```json
{
"tasks": [
{
"id": 1,
"title": "Task 1",
"created_at": "2020-10-21T06:09:26.654986Z",
"user_id": 1
}
]
}
```### GET /tasks/1
Get Task By Id
**HTTP Headers**:
```
Authorization: Bearer
```**Example Response**:
```json
{
"id": 1,
"title": "Task 1",
"created_at": "2020-10-21T06:09:26.654986Z",
"user_id": 1
}
```