Go Standard Modular Boilerplate
The various packages used are as follows:
- Gin Gonic - HTTP handler framework
- PGX - PostgreSQL database driver
- Squirrel - SQL query builder
- Scany - Database scanner helper from data to structs
- Kin OpenAPI - OpenAPI 3.0 / Swagger specifications generator from code
- CORS - Gin Gonic CORS middleware
- Go Dot ENV - Dot ENV vars loader
- Zap - Logger package
This boilerplate follows the idiomatic Go code rules, related references below:
- Effective Go - Official Go documentation
This boilerplate requires Golang v1.17+ to run.
Clone the repository then change your current directory to the repository
cd go-standard-modular-boilerplate
Copy the example env file and make the required configuration changes in the .env file
cp .env.example .env
Start the REST server.
make rest
Open the development server by navigating to your server address in your preferred browser.
Go Standard Modular Boilerplate is implementing tools as dependencies with go modules. Instructions on how to use them in the application are linked below.
Tools | Repository |
---|---|
Migrate | https://github.com/golang-migrate/migrate |
SQLC | https://github.com/kyleconroy/sqlc |
Run database migrations up.
make migrate-up
Run database migrations down.
make migrate-down