It is a simple web template project, which is written in Go with popular go frameworks. It uses these frameworks. Gin/ Logrus/ Gqlgen/ Oauth2, OIDC, Casbin, GoReleaser
This template shows how to use RestAPI, Graphql, Oauth2, Authentication, Authorization, Database Connection, and build and packaging.
It will build and package in Docker Image. You can configure
.goreleaser.yaml file for further build and package automation.
brew install goenv goreleaser
goenv install 1.20.1
goenv global 1.20.1
git clone [email protected]:gogo-boot/go-boot.git
cd go-boot && go mod tidy && go run .
you can configure the web application.
vi platform/config/config.yml
vi platform/config/authz_model.conf
vi platform/config/authz_policy.csv
you can configure the releaser
vi .goreleaser.yaml
go build .
Deployment test
goreleaser release --clean --snapshot --skip-publish
Deployment on Prod. you need to set a GitHub token
export GITHUB_TOKEN=xxxxxx
git tag 0.0.1
goreleaser release --clean
docker run -p 8080:8080 gogo-boot/go-boot
you can start review from main.go file and follow further for more detail.
This uses several frameworks. RestAPI, Graphql, Oauth2, GORM... If you don't need of it, you can delete the directory and update main.go file.
go get -u
go mod tidy
then the unused framework will be removed and the build package will be slimmer.
- Health check endpoint
- Server-Side Events
- HTML Template
- Rest API
- OpenAPI
- GraphQL
- Logging in Json Format
- Security
- Oauth2
- OIDC
- User Authorization
- Configuration
- Multi architect build
- Dockerizing
# Install by npm
# npm install @openapitools/openapi-generator-cli -g
# Install by brew
# brew install openapi-generator
curl -O https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml
openapi-generator-cli generate -i petstore.yaml -g go-gin-server -o ./opeapi-gen \
--global-property=apiDocs=false,modelDocs=false \
--additional-properties=apiPath=openapi,packageName=openapi
set -o allexport
source test.env
set +o allexport
./dist/go-boot_darwin_amd64_v3/go-boot
adjust router group in the main.go file.
you can open *.http files with IntelliJ and send http request or test by clicking without typing
- DB Connection
- Implement OIDC Logout
- Add Unit Test
- CICD automation
- Refactorings
- Documentation
- Publish Metrics
- Release 1.0
If you like to change configuration or extend it, you can read further document below.
Authorization Code Flow with Proof Key for Code Exchange (PKCE)
Go Authentication Framework / OAuth2 for Go
Go Authentication Framework / Go OIDC
Go Authorization Framework / Casbin