Skip to content

Commit

Permalink
edit readmes
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastienBtr committed Nov 14, 2020
1 parent 71ee983 commit 8d3c5c0
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 10 deletions.
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,26 @@
Example of a specs driven development microservices (SDD) architecture using code generation.
The project is keeping simple but includes all the necesary tools to be production ready. The business logic implemented does not really matter, the goal is to demonstrate how a SDD can be organized and the good pratices of a microservices architecture.

![](schema.png)
![](diagram.png)

# Quick start

* Docker installed
* Run: `./services/launcher.sh`
* Run: `./services/gateway-launcher.sh`
* Play with the API ! see documentation at [http://localhost:9898/documentation](http://localhost:9898/documentation) and use the postman files in [services/documentation/postman](services/documentation/postman)
* see: [services](services) for more information

What you can do:

* Create/update/get articles
* Add articles in the cart, update/get cart items
* Delete an article that is in the cart: will delete the article from the cart thanks to a kafka event
* Checkout the cart: will edit the stock of articles with a kafka event
* If you don't have an auth token you can do nothing on user service
* Signup and login (auth service) to get a token
* You can now access the user service except deleting a user: requires a special role in the token


# Project structure

Expand Down
2 changes: 1 addition & 1 deletion generator/generators/app/templates/README.md.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ To run this service use the [launcher script](../launcher.sh) as described in th
* Run `prisma generate`

These steps are necessary to have autocompletion.
Now you can start coding but make sure to not edit code that will be overriden by the generator. In case you want to do any change in the service contracts, you need to do it through the [specification](../specification).
Now you can start coding but make sure to not edit code that will be overriden by the generator. In case you want to do any change in the service contracts, you need to do it through the [specification](../../specification).

# Documentation

Expand Down
9 changes: 5 additions & 4 deletions services/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ There is a `launcher.sh` script to launch the desired services with docker.

* To launch all: `./launcher.sh`

* To launch specific services: `./launcher.sh <service_name> <service_name_2>`. The "service_name" is the same as the service's directory and the services will be launched in the order you pass them to the script. The kafka (exept in "prod" env) and api-gateway services will be launched automatically.
* To launch specific services: `./launcher.sh <service_name> <service_name_2>`. The "service_name" is the same as the service's directory and the services will be launched in the order you pass them to the script. The kafka service (exept in "prod" env) and api-gateway services will be launched automatically.

* A "`-e`" option can be added to the command to precise the environment: "dev", "test", "prod", the default value is "dev". When you switch between environments, make sure to call the `stop-all.sh` script before.

* To lauch the API gateway, use the `gateway-launcher.sh` script, it is important that the `auth` service is already running, otherwise the the gateway wont be able to sign tokens.
* To launch the API gateway, use the `gateway-launcher.sh` script, it is important that the `auth` service is already running, otherwise the the gateway wont be able to sign tokens.

To stop all the services, you can use the `stop-all.sh` script.

Expand All @@ -32,11 +32,12 @@ In production you will need to have hosted databases and a kafka service. You ne

* Create its specification (see [specification](../specification)).
* Generate the service with the generator (see [generator](../generator)).
* Add the new documentation endpoints [here](documention/index.js).
* Add the new documentation endpoint [here](documention/index.js).
* Add the new documentation endpoint to the api gateway [here](api-gateway/settings/documentation.json)
* Edit all the `.sh` scripts to add this new service.
* Implement the "TODOs" by following the bellow information about editing a service.
* Use `yarn lint-check` to make sure there is no style issues, you can also install the eslint plugin in your editor if it is available
* You might want to expose some routes with the [API gateway](../services/api-gateway).
* You might want to expose some routes with the [API gateway](api-gateway).

**Edit a service**

Expand Down
2 changes: 1 addition & 1 deletion services/article/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Service to manage articles, an article is an item of an e-commerce website.
* Run `prisma generate`

These steps are necessary to have autocompletion.
Now you can start coding but make sure to not edit code that will be overriden by the generator. In case you want to do any change in the service contracts, you need to do it through the [specification](../specification).
Now you can start coding but make sure to not edit code that will be overriden by the generator. In case you want to do any change in the service contracts, you need to do it through the [specification](../../specification).

# Documentation

Expand Down
2 changes: 1 addition & 1 deletion services/auth/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This service is an orchestrator and needs `user` service to work.
* Run `prisma generate`

These steps are necessary to have autocompletion.
Now you can start coding but make sure to not edit code that will be overriden by the generator. In case you want to do any change in the service contracts, you need to do it through the [specification](../specification).
Now you can start coding but make sure to not edit code that will be overriden by the generator. In case you want to do any change in the service contracts, you need to do it through the [specification](../../specification).

# Documentation

Expand Down
2 changes: 1 addition & 1 deletion services/cart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Service to manage carts, to simplify the POC, we consider that there is only one
* Run `prisma generate`

These steps are necessary to have autocompletion.
Now you can start coding but make sure to not edit code that will be overriden by the generator. In case you want to do any change in the service contracts, you need to do it through the [specification](../specification).
Now you can start coding but make sure to not edit code that will be overriden by the generator. In case you want to do any change in the service contracts, you need to do it through the [specification](../../specification).

# Documentation

Expand Down
2 changes: 1 addition & 1 deletion services/user/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Service to manage users
* Run `prisma generate`

These steps are necessary to have autocompletion.
Now you can start coding but make sure to not edit code that will be overriden by the generator. In case you want to do any change in the service contracts, you need to do it through the [specification](../specification).
Now you can start coding but make sure to not edit code that will be overriden by the generator. In case you want to do any change in the service contracts, you need to do it through the [specification](../../specification).

# Documentation

Expand Down

0 comments on commit 8d3c5c0

Please sign in to comment.