Complete user API with PostgreSQL database and Kafka for event streaming
- Implement Refresh Session and Token
- Fix Delete method
- Implement Kafka for mail sender
- Docs
- Improve Docker configuration
- Fix token session
- Implement Pagination
- Create one more entity and role for multiple sessions.
Gin is a web framework written in Golang.
Swagger allows you to describe the route structure of your API.
Kafka enables orchestration of event streaming, allowing for automatic and high-performance management of message sending queues.
First, you need to create the Postgres container. To do this, run the following command:
$ docker-compose up postgres -d
Error Tratatives Map
# HTTP Errors
+ 0 - 999
# Functional Errors
+ 1000 - 1999
# Entities Error
+ 2000 - 3999
Will be implemented...
Copy the example variables from the .env.example
file to .env
.
Environment Variables
# API
+ PORT=
+ URL=
# JWT
+ JWT_TOKEN=
# KAFKA (Not Necessary Yet)
- KAFKA_BROKERS=
- KAFKA_CLIENT_ID=
- KAFKA_TOPIC_ISSUE_EMAIL=
- KAFKA_TOPIC_EMAIL_RESPONSE=
# DATABASE
+ PG_USER=
+ PG_PASSWORD=
+ PG_HOST=
+ PG_PORT=
+ PG_DATABASE=
To do this, run the following command:
$ go mod download
After completing the above steps, start the API by running the following command:
$ go run cmd/server/main.go
Or
Lembre-se de ter instalado a CLI do AIR. Link do repositório.
$ air
If you make any changes to the Swagger comments, you need to run the go-swagger
command to generate the documentation files. To do this, run the following command:
Linux
$ scripts/build_docs.sh
Windows
$ bash .\scripts\build_docs.sh