Use of Fiber Web Framework, hexagonal architecture, dependency injection, unit test and very good practices.
This project has enough foundation to understand Fiber, it should be noted that this project is written in golang and effectively uses clean architecture like hexagonal.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
Go v1.16 or higher
go version
Configure the variables environment in docker-compose, reference the config structure inside the cmd/api/boostrap.go
file.
type config struct {
// Server configuration
Host string `default:"localhost"`
Port uint `default:"4000"`
ShutdownTimeout time.Duration `default:"10s"`
// Database configuration
DbUser string `default:"test"`
DbPass string `default:"test"`
DbHost string `default:"localhost"`
DbPort uint `default:"3306"`
DbName string `default:"test"`
DbTimeout time.Duration `default:"5s"`
}
api:
build: .
environment:
FIBER_HOST: 0.0.0.0
FIBER_DBHOST: mysql
ports:
- 8080:4000
Add project dependencies
go get
Run the application in development
go run ./cmd/api/main.go
If all went well visit the next page
localhost:{your_port}
run the tests
go test
To view and interact with API REST visit the documentation.
localhost:{your_port}/api-docs
docker-compose up -d
- @ArthurDev - Idea & Initial work