alexgtn / supernova

Clean architecture based on best practices (hexagon, Docker, gRPC/Protobuf, middleware, database etc...)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool


Kudos to https://gopherize.me/ for the cute logo

Supernova

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

Start service

make main

gRPC gateway

make http

Protobuf

GRPC Requirements:

go install \
    github.com/bufbuild/buf/cmd/buf@v1.7.0 \
    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

Migrations

make generate-migration
make execute-migration

Optional

make validate-migration
make rehash-migration

TODO


Oasis - Champagne Supernova

About

Clean architecture based on best practices (hexagon, Docker, gRPC/Protobuf, middleware, database etc...)

License:MIT License


Languages

Language:Go 95.0%Language:Makefile 3.5%Language:Dockerfile 1.5%