This repository contains a general mono-repo microservice boilerplate. This is not an official repository and is meant to provide a basic project structure with some additional build scripts for convenience.
- Support multiple microservices in a single repository
- Support hot-reloading of all microservices on saved changes in a dev environment
- Support generation of docker images for all microservices
Note: All `make` commands should be run from the project's root directory
Note: To support hot-reloading install the fswatch dependency via homebrew:
brew install fswatch
This command is meant to have minimal build log output. If a build error occurs run make build
to debug.
make
make build
make test
make test_report
make clean
make docker_build
This project structure was influenced by the golang-standards layout:
https://github.com/golang-standards/project-layout
Temporary build directory containing all generated executables.
Main applications for this project.
The directory name for each application should match the name of the executable you want to have (e.g., /cmd/myapp
).
Don't put a lot of code in the application directory. If you think the code can be imported and used in multiple services, then it should live in the /internal
directory.
Database scripts, schema, migrations, etc.
Design and user documents (in addition to your godoc generated documentation).
Private reuseable application and library code.
Note that this layout pattern is enforced by the Go compiler itself. See the Go 1.4 release notes
for more details. Note that you are not limited to the top level internal
directory. You can have more than one internal
directory at any level of your project tree.
Scripts to perform various build, install, analysis, etc operations.
Additional external test apps and test data. Feel free to structure the /test
directory anyway you want.
Please see the code of conduct form.
Please see the contributing form.
Please see the pull request form.
Copyright © 2019-present Eric Dobyns.