a FX trading system based on microservices architecture.
It allows you to run:
It provides:
.yo-rc.json
files in fx-price-service directory that will be used to generate appscentral-server-config/
directory that can be used to edit the registry's config server configuration but only in dev profile (a git repository is used in prod profile)It depends on generator-jhipster-docker-compose to generate a global docker-compose file.
First, generate all apps from their .yo-rc.json. (Run the command from devops-scripts directory)
./setup-apps.sh
Then, generate samples entities from the entities.jh JDL file in each app's directory
./setup-entities.sh
Then, generate entities for front end gateway. This step needs to be done manually. "cd gateway" & generate entities one by one (check the command in the below script).
./setup-gateway-entities.sh
Finally, build apps and generate docker images for them. mvn package docker:build -DskipTests=true
./build-apps.sh
This script runs mvn package docker:build -DskipTests=true
for all apps, the app/src/main/docker/Dockerfile
is used by maven-docker plugin to build the docker image.
Generate a Docker-compose file:
mkdir docker-compose
cd docker-compose
yo jhipster:docker-compose
And answer the questions.
To run all apps:
docker-compose up
To shut down all apps:
docker-compose down
Note: At any point in the process you can use docker-compose logs appname
to view its logs.
docker-compose up -d jhipster-registry
: launch the registryhttp://localhost:8761/
to view the Eureka console (new microservices instances will automatically register themselves and show up here)http://localhost:8761/config/application-dev.yml
to have a look at the properties that are transfered to all apps in the dev profile. You can edit them in the /central-server-config
directory.docker-compose up -d elk-elasticsearch elk-logstash elk-kibana
http://localhost:5601
, all logs will show up here.Start the Gateway with:
docker-compose up -d gateway
It should connect with the registry and show up in the Eureka console.
http://localhost:8080/#/gateway
(log in with admin/admin)Also logs should have started to show up in Kibana.
Start fx-price-service with:
docker-compose up -d fx-price-service
Start the other apps:
docker-compose up -d supplier-service invoice-service
You can scale an app by creating multiple instances of it (doesn't work on the gateway or other apps that have their ports binded to localhost):
docker-compose scale fx-price-service=2
docker-compose scale fx-price-service=3
Then wait for them to show up at http://localhost:8761/
and http://localhost:8080/#/gateway
.
docker-compose stop appname
docker-compose down
The following commands may prove useful:docker stop $(docker ps -a -q)
: Stop all running containersdocker rm $(docker ps -a -q)
: Remove all containersRun cleanup script
./cleanup.sh
Refer to the doc in docs directory
For sonar.organization and sonar.login, use the organization key and the generated token from the sonar cloud my account area.