Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add template for monorepo of go microservices #6

Merged

Conversation

emanguy
Copy link
Collaborator

@emanguy emanguy commented Mar 30, 2024

This PR adds a template for a monorepo-based Go Microservices project. It includes the following:

  • A common library full of re-usable components among microservices
  • Documentation on the intended patterns within the microservices and conventions for API endpoints
  • An example microservice that builds off the common library, using the conventions from the documentation
  • A dockerfile to build the example microservice
  • A docker compose file to start both the database and the example microservice, so the whole thing can be started in one command
  • A set of example database migrations specifically for the sample microservice, which are run with DBMate

I also added in some entries to the wiki to help direct users to the template.

Overview of added files

Because the diff looks so massive, here's an outline of the included files under practices/development/examples/go-microservice-monorepo so you can figure out where to start:

  • The top level contains a docker-specific environment file, the go.mod/go.sum manifests for the dependencies, the dockerfile for the microservice, the docker compose file for starting the microservice, and the main README.
  • The doc directory contains documentation on best practices, the layout of the repo, architectural patterns, API conventions, and more. Basically a handbook for adding code to this template.
  • The commonlib directory contains a set of re-usable components that can be composed into microservices in the monorepo.
  • The microsvc directory contains the code for the example microservice
  • The vendor directory contains vendored dependencies which are checked into the repository. This allows one to build the code without an internet connection, which may be useful for requirements on certain projects. You can probably avoid looking over anything in this directory.

@emanguy emanguy self-assigned this Mar 30, 2024
@emanguy emanguy requested a review from mikewolfd March 30, 2024 20:50
@emanguy emanguy marked this pull request as ready for review March 30, 2024 20:50
@mikewolfd mikewolfd merged commit 100ef4f into FearlessSolutions:main Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants