Kudos to https://gopherize.me/ for the cute logo
This repo provides:
- boilerplate code based on best practices for kickstarting go projects
- clean architecture based on hexagonal architecture
- gRPC API, Protobuf, HTTP gateway, codegen with buf, API documentation, go-grpc-middleware logging w/ zap, message validation
- Cobra and Viper integration
- golang-ci linter
- CI config for Gitlab (wake me up when september.. when Github Actions catches up)
- Docker & docker-compose: traefik proxy, Postgres w/ auto-backup to S3, Datadog metrics, Watchtower auto-deploy
- ent ORM, codegen, migrations
make main
gRPC gateway
make http
GRPC Requirements:
protoc-gen-go
protoc-gen-go-grpc
https://grpc.io/docs/languages/go/quickstart/protoc-gen-validate
https://github.com/envoyproxy/protoc-gen-validate- grpc gateway https://github.com/grpc-ecosystem/grpc-gateway
go install \
github.com/bufbuild/buf/cmd/[email protected] \
github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@latest \
github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@latest \
google.golang.org/protobuf/cmd/protoc-gen-go@latest \
google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest \
github.com/envoyproxy/protoc-gen-validate@latest
Generate ent db code
make gen-schema
Generate protobuf and API docs
make gen-buf
make generate-migration
make execute-migration
Optional
make validate-migration
make rehash-migration
- Cobra CMD for prod/dev env
- Auth/AuthZ with Auth0 and grpc_auth middleware, or Auth https://casdoor.org/ AuthZ https://casbin.org/en/, or https://github.com/ory/keto
- Viper config
- gRPC request validation https://github.com/envoyproxy/protoc-gen-validate
- linter
- db transactions
- Gitlab CI