Skip to content
/ readysetgo Public template
forked from stabai/readysetgo

Starter template for a monorepo for Go microservices using gRPC, Bazel, and Tilt

License

Notifications You must be signed in to change notification settings

commure-stabai/readysetgo

 
 

Repository files navigation

readysetgo

Starter template for a monorepo for Go microservices using gRPC, Bazel, and Tilt

License Last Commit

Build System Service Transport Go Version

Build Test Buf Lint Tilt Buildifier

Prerequisites

Nix (recommended)

If you want to use Nix, all you need to do is install Nix. Then, just run nix-shell from the repository root to get a fully-configured shell.

However, some of your tools (e.g. IDE) might behave better if you also install things locally using the directions below.

Homebrew

If you're using macOS or Linux, you can install all required tools easily using the Homebrew bundle defined in Brewfile:

brew bundle install

Note: Even if you're using Windows, you should probably use the Windows Subsystem for Linux and just run everything on a Linux terminal.

Manual

If for any reason you need to install them manually, this table contains all of the required tools:

Tool Install instructions
Bazelisk instructions
Buf instructions
Tilt instructions
Kubernetes CLI (kubectl) instructions
Docker instructions
minikube instructions
grpc_cli instructions
buildifier instructions

Initializing your repository

Run the tidy.sh script to initialize your repository after cloning and installing prerequisites:

bazel run //:tidy

You should also run this script after doing any of the following:

  • Modifying protobuf files
  • Adding/remove dependencies to Go code

Running the environment with Tilt

If you haven't already, start up a Kubernetes cluster:

minikube start

Then, run Tilt and follow the instructions in the terminal to open the web console:

tilt up

Running servers individually

gRPC Server

bazel run //src/example/service:server

HTTP Server

bazel run //src/example/web/server

Testing the gRPC Server

grpc_cli is an easy way to issue requests to the gRPC server:

grpc_cli call localhost:50051 ExampleService/GetExample "id: 'foo'"
grpc_cli call localhost:50051 ExampleService/SetExample "id: 'foo', data: {text: 'bar'}"
grpc_cli call localhost:50051 ExampleService/GetExample "id: 'foo'"

To-do list for this repository

Near term tasks:

  • Add code quality scan to CI
  • Add code coverage to CI
  • Add Gazelle to CI
  • Add PR comments for CI errors wherever possible
  • Add git hooks and repository setup script
  • Generify HTTP server
  • Add documentation for CI

Potential future projects:

  • Add service resource dependencies to Tilt environment
  • Add project configuration/generator/wizard so people don't get features they don't want
  • Add TypeScript React app to example HTTP server
  • Add support for other backend languages
  • Add Deno scripts to simplify custom workflows
  • Add production deployment examples
  • Add database to environment
  • Add dynamic configs to environment
  • Add ORM to any example server
  • Add pubsub to any example server
  • Add cache to any example server
  • Add authentication to generic server
  • Add authorization to generic server
  • Add auditing to generic server
  • Add monitoring to generic server
  • Add distributed tracing to generic server
  • Add API simulation tests
  • Add end-to-end tests
  • Add new service setup wizard

About

Starter template for a monorepo for Go microservices using gRPC, Bazel, and Tilt

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Starlark 80.3%
  • Go 12.0%
  • Nix 2.7%
  • Shell 2.2%
  • Ruby 1.5%
  • HTML 1.3%