Skip to content

Latest commit

 

History

History
53 lines (37 loc) · 2.34 KB

README.md

File metadata and controls

53 lines (37 loc) · 2.34 KB

Sprout [POC]

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.

What does it generate?

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

The development cycle

  1. Make folder with the name of your project and within that folder execute sprout create [PROJECT_NAME]
  2. A folder will be created and within that update the sprout.yml and then run sprout generate -l=[LANGUAGE OF CHOICE] eg. go
  3. Move back to the root folder and you will see that there is now an idl folder created.
  4. Modify the the protobuf services generated with your desired methods
  5. Either run make generate or return to the application folder and re run sprout generate
  6. Push up the IDL repo
  7. Implement these methods on the main application repo
  8. 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)
  9. 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.

Dependencies

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]

Building locally

As the templates are embeded into the binary you will need to ensure packr2 is installed.

You can run make deps to install this.