Status: currently poc
Sprout intends to be a multi-language service generator. The intention is to create a modular monolith, which is easy to seperate at a later stage when the boundries are completely understood.
Based on specified config it will generate:
- Proto files [Done]
- Proto libraries [Done]
- GraphQL files [Later]
- GraphQL libraries [Later]
- grpc web [Partial]
- Layout [Done for go]
- Kubernetes manifests [In progress]
It will also live with your project, when you add a new service to the config it will generate everything needed for that new service.
The generation will create 2 folders.
- A repo for the IDL's, this folder will also contain generated artifacts from the IDL under 'gen'
- A repo that implements the interfaces of the generated artifacts
NOTE: It only creates the folders for these repos, you will still need to create the git repos on your respected platform. Aswell as initialise each folder as a git repo and push when there have been changes. (if there is a strong desire we can look at how to make this process easier.)
- Make folder with the name of your project and within that folder execute
sprout create [PROJECT_NAME]
- A folder will be created and within that update the
sprout.yml
and then runsprout generate -l=[LANGUAGE OF CHOICE] eg. go
- Move back to the root folder and you will see that there is now an idl folder created.
- Modify the the protobuf services generated with your desired methods
- Either run
make generate
or return to the application folder and re runsprout generate
- Push up the IDL repo
- Implement these methods on the main application repo
- Push up the IDL repo & remove the replace function in the go.mod in the implementation project (this will swap it over to using the live IDL pushed up to git instead of your local one)
- When you feel the need to add more services add them to the sprout config and re-run
sprout generate
and repeat steps 4 - 7.
In order to use this you need ensure you have these installed.
- protoc
- protoc-gen-go [Go]
- protoc-gen-web [gRPC Web]
- protoc-gen-gateway [Http]
- prooc-gen-swagger [Swagger]
As the templates are embeded into the binary you will need to ensure packr2 is installed.
You can run make deps
to install this.