Miro Board: https://miro.com/app/board/uXjVKVoZwos=/?share_link_id=718027124865
Make sure you have Go 1.22.2 or higher
Execute
go mod tidy
To correctly use the project, it is necessary to define a .env file, with the values for the envs:
- DB_USERNAME
- DB_PASSWORD
- DB_HOST
- DB_NAME
- DB_PORT
We recommend using for development the following values:
DB_USERNAME=user
DB_PASSWORD=pass
DB_HOST=pgsql
DB_NAME=postgres
DB_PORT=5432
docker-compose build
docker-compose up -d
curl --request GET --url http://localhost:8080/health
## Expected response
= Status Code 200
Go to http://localhost:8080/swagger/index.html#/ after the application is running.
- Go
- Gin Web Framework - Routes, JSON validation, Error management, Middleware support
- PostgreSQL - Database
- swag - Tool to generate swagger documentation
- docker - Containerization tool
- docker-compose - Tool to define and run multi-container Docker applications
The team chose to use Miro to document this deliverable, available at the link.
The diagram contains:
- System documentation in DDD with Event Storm
- Caption for the ubiquitous language used
- Additional details to understand the proposed resolution
- Order fulfillment and payment flow
- Order preparation and delivery flow
This project follows the models proposed by Hexagonal Architecture
This project makes use of the library swag to generate the swagger documentation.
Follow the steps described in the official documentation
swag init -g cmd/rest/main.go
The documentation can be founded at the path /docs/swagger.yaml
or accessing this link.