Project status: Seeking community reviews (feel free to open issues!)
The goal of this repo is to serve as boilerplate for a Go API. User authentication and interactive Swagger documentation is set up and working out of the box.
- Add more documentation to
README.md
- Copy
docker-compose.example.ymlto a new file calleddocker-compose.yml - Edit the environment variables in
docker-compose.yml docker compose up -d- Visit
{FQDN}:{PORT}/swagger/index.htmlfor interactive documentation
- Copy
.env.exampleto.envand adjust as needed - Spin up a postgres instance:
docker run --name demo-postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_USER=postgres -e POSTGRES_DB=dev -p 5432:5432 -d postgres - Spin up a Redis instance:
docker run --name demo-redis -p 6379:6379 -d redis - Download swag (generates
docspackage):go get -u github.com/swaggo/swag/cmd/swag - Install swag:
go install github.com/swaggo/swag/cmd/swag@latest - Download air (live-reload app runner, using this to generate Swagger docs on save)
go get -u github.com/cosmtrek/air - Install air:
go install github.com/cosmtrek/air@latest - Install dependencies:
go mod download - Start server:
air - Visit http://localhost:8080/swagger/index.html for interactive documentation
Swagger notation docs: https://github.com/swaggo/swag#api-operation