Golang REST API boilerplate for typical project, including interactive API documentation.
- Interactive API documentation
- Features
- Quick run
- How to use it
- Comfortable development
- Links
- Database
- Tests
- License
- Database (entgo).
- Migration (atlas).
- Config
- Admin and User roles. (Casbin Rbac)
- Mailing
- Sign in and sign up via email.
- Redis
- Social sign in (Apple, Facebook, Google, Twitter).
- I18N
- File uploads. Support local and Amazon S3 drivers.
- Swagger.
- nginx.
- Adminer(Adminer)
- Docker.
- CI (Github Actions).
- Monitoring (Grafana)
- Unit Test(Testify)
git clone --depth 1 https://github.com/201R/golang_restapi_boilerplate.git my-app
cd my-app/
cp .ini.exemple .ini
docker-compose up -d
For check status run
docker-compose logs
- Install Gin Hot reload
Assuming you have a working Go environment and GOPATH/bin
is in your
PATH
, gin
is a breeze to install:
go get github.com/codegangsta/gin
- Pull code
git clone --depth 1 https://github.com/201R/golang_restapi_boilerplate.git my-app
cd my-app/
cp .ini.exemple .ini
- Update .ini file
change Host=postgres
to Host=localhost
- Run additional container
docker-compose up -d postgres adminer redis
- Start App
go mod download
go run -mod=mod ariga.io/atlas/cmd/atlas@master migrate apply \
--dir "file://migrations"
--url "postgres://postgres:password@localhost:6001/db?sslmode=disable"
gin -a 3000 -p 8090 -i
- Swagger: http://localhost:8090/swagger/index.html
- Adminer: http://localhost:8080/
This project is licensed under the terms of the MIT license.