Skip to content
/ GoArcc Public

Go monolith with embedded microservices including GRPC,REST,GraphQL and The Clean Architecture.

License

Notifications You must be signed in to change notification settings

deqode/GoArcc

Repository files navigation

GoArcc - Go monolith with embedded microservices including GRPC,REST, graphQL and The Clean Architecture.

GitHub CI PkgGoDev Go Report Card Project Layout GitHub last commit GitHub go.mod Go version

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.

It supports 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).

Read more about GoArcc

Structure of Go packages

  • client/* - clients for server dialing
    • grpcClient - grpcClient dials grpc server
  • cmd/* - main application(s)
  • config - application related configs
  • db - postgres DB connection and adapters
  • logger - global zap logger
  • modules/* - embedded microservices, with structure:
    • external-svc - exposed apis logic implementation
    • internal-svc - unexposed apis logic implementation
    • models - database models, operations using gorm
    • pb - autogenerated files from .proto file
  • protos - External required protos for internal protos
    • types - application related common proto types
  • servers - all running servers
    • graphql - ms graphql registration and server invoke
    • grpc - ms grpc registration and server invoke
    • rest - 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:
  • 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

Build from source

  1. Clone the repo:
git clone git@github.com:deqode/GoArcc.git
  1. After cloning the repo, review config.yml and update for your system as needed
  2. Build to create GoArcc binary
make build
  1. Run unit tests with
make test

Run

You can find all the running servers at:

Jaeger UI:

http://localhost:16686

Health Trace:

http://localhost:8083/health/

Prometheus UI:

http://localhost:9090

Prometheus UI Metrics:

http://localhost:9090/metrics

Grpc Server:

http://localhost:8080

Graphql Server:

http://localhost:8081

Rest Server:

http://localhost:8082

License

Copyright 2021, DeqodeLabs (https://deqode.com/)

Licensed under the MIT License(the "License");

About

Go monolith with embedded microservices including GRPC,REST,GraphQL and The Clean Architecture.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages