- Clean Architecture in Golang
- Fiber framework
- Docker
- docker compose
- PostgreSQL (dockerized; with test data)
- pgx
- OpenAPI 3.0 (generating the specification)
- Nomad
- Consul
- HAProxy
- Docker installed, Docker daemon is running
- PostgreSQL daemon must be disabled
Warning: if you don't have PostgreSQL Docker images on your machine, the start of the project can be long; first instances of "empls" can be unhealthy
docker compose up
Generate the OpenAPI 3.0 specification:
go run main.go -gen
Start Nomad, using the provided configuration:
sudo nomad agent -config=nomad_cfg.hcl -dev
View Nomad in browser: http://localhost:4646
Start Consul:
consul agent -dev
View Consul in browser: http://localhost:8500
Start the project:
nomad run start_project.hcl
URL to check the project with curl, Insomnia, Postman, Advanced REST Client, etc.:
http://localhost:port/find/mikhail
(simple GET request without the body)
The port can be found in the Nomad UI (http://localhost:4646/ui/jobs)
Start HAProxy: use the provided configuration haproxy/haproxy.cfg
Put the file haproxy.cfg into the /etc/haproxy directory and then run:
systemctl restart haproxy
or
systemctl start haproxy
if HAProxy isn't still running.
Then, you can access the project with the following URL: