GoArcc - Go monolith with embedded microservices including GRPC,REST, graphQL and The Clean Architecture.
Description
When you start writing a Go project, GoArcc helps to set up all the initial code boilerplate for your project. Initial boilerplate code means how you should organize your codebase and how you can write multiple services. We have support for REST, Graphql as well as gRPC.
We have implemented logging, tracing, health check, Jaeger, etc so that any developer will come and write services within a minute.
In short, GoArcc is a boilerplate setup codebase for any monolithic(Architecture) based web/mobile applications which later converted into microservices(Architecture).
Structure of Go packages
client/*
- clients for server dialinggrpcClient
- grpcClient dials grpc server
cmd/*
- main application(s)config
- application related configsdb
- postgres DB connection and adapterslogger
- global zap loggermodules/*
- embedded microservices, with structure:external-svc
- exposed apis logic implementationinternal-svc
- unexposed apis logic implementationmodels
- database models, operations using gormpb
- autogenerated files from .proto file
protos
- External required protos for internal protostypes
- application related common proto types
servers
- all running serversgraphql
- ms graphql registration and server invokegrpc
- ms grpc registration and server invokerest
- ms rest registration and server invoke
Features
- Project structure (mostly) follows Standard Go Project Layout.
- Easily testable code (thanks to The Clean Architecture).
- Graceful shutdown support.
- Example gRPC API:
- External and internal APIs on different host/port.
- gRPC services with and without token-based authentication.
- API design (mostly) follows Google API Design Guide and Google API Improvement Proposals.
- Example graphQL API:
- Example REST API:
- Example tests, both unit and integration.
- Production logging using zap.
- Production metrics using Prometheus.
- Docker and docker-compose support.
- Smart test coverage report
- CI/CD setup for GitHub Actions.
Development
Requirements
- Go 1.16
- Docker 19.03+
- Docker Compose 1.25+
Build from source
- Clone the repo:
git clone [email protected]:deqode/GoArcc.git
- After cloning the repo, review
config.yml
and update for your system as needed - Build to create GoArcc binary
make build
Run
Jaeger UI:
Health Trace:
Prometheus UI:
Prometheus UI Metrics:
Grpc Server:
Graphql Server:
Rest Server:
License
Copyright 2021, DeqodeLabs (https://deqode.com/)
Licensed under the MIT License(the "License");