Commit 102c03d8 authored by Yannick Buron's avatar Yannick Buron

readme

Signed-off-by: Yannick Buron's avatarYannick Buron <[email protected]>
parent be3a441a
Pipeline #99697803 passed with stages
in 12 minutes and 5 seconds
# The Empower Stack Example
This project is an exemple use of the Empower Stack. Please check http://empower.sh to know more about the project.
This project is the examplary project of the Empower Stack. It is designed to be used as a starting point for your own microservice architecture.
It consists of two golang services :
Check the documentation to understand more about what is contained in this project: https://empower.sh/docs/example.
- The invoicing service, which will serve a GRPC api with invoicing related models (Invoices, Customers), connected to a PostgreSQL database.
- The gateway service, which will aggregate GRPC services into a GraphQL public gateway.
You can use the docker-compose.yml to quickly set up a working installation on your local environment: https://empower.sh/docs/local.
The gitlab-ci.yml contains instructions to build the images and deploy them on a Kubernetes cluster. See this page for more instructions to set up your Kubernetes cluster: https://empower.sh/docs/kubernetes.
Pre-requisites
==============
First, you need to have golang installed. You can follow the official procedure for this:
https://golang.org/doc/install
This project heavily use code generation, especially for protobuf.
You'll need to install the protoc binary:
https://grpc.io/docs/quickstart/go/
The protoc plugin for gogo (we use here gogo-faster, check the Readme for installation intructions):
https://github.com/gogo/protobuf/
Installation
============
Finally, go into the example/service-invoicing directory to use the make commands
Install the dependencies:
`make dep`
Generate the code:
`go generate`
This will read the generate command in the main file, which will generate code and protobuf files in gen directory.
Build and install the service:
`make install`
Check the environnement variables in .env file to set up the grpc port and connection to PostgreSQL. The databse must be created the database before.
Finally you can execute your service:
`$GOPATH/bin/service-invoicing`
Then you go into the exemple/gateway directory, check the environnement variables in .env to set up the graphql port, check the graphql folder to verify the grpc port of your invoicing service, and install your gateway service:
`make install`
Please note the gateway service will import some generated file from your invoicing service.
And execute your gateway:
`$GOPATH/bin/gateway`
You shall now be able to connect to the gateway with your browser, which will serve you the GraphiQL interface you can use to test your commands.
One last step, you need to deploy your database schema. You can do this on the GraphiQL interface with the following command:
```
mutation {
initInvoicingSingleTenant()
}
```
The Empower Stack is a set of libraries and examplary code to easily set up your microservice architecture, following state of the art patterns. Please check http://empower.sh to know more about the project.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment