pkcool / fx-trading-system

Forex Automatic Trading System
0 stars 2 forks source link
microservice

Automated Forex Trading System

Summary

a FX trading system based on microservices architecture.

It allows you to run:

All working out of the box !

It provides:

It depends on generator-jhipster-docker-compose to generate a global docker-compose file.

How to test

Setup and build

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

Run everything

Note: At any point in the process you can use docker-compose logs appname to view its logs.

Start the JHipster Eegistry (service discovery and configuration server)

ELK (log centralization)

Gateway and microservices

Start the Gateway with:

It should connect with the registry and show up in the Eureka console.

Also logs should have started to show up in Kibana.

Start fx-price-service with:

Start the other apps:

Scale your apps

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

Then wait for them to show up at http://localhost:8761/ and http://localhost:8080/#/gateway.

Stop an app

Shutdown and clean up

Clean everything

Run cleanup script

./cleanup.sh

Deploy to Google Kubernetes engine

Refer to the doc in docs directory

Setup Intellij

Manual Code Analysis with Sonar Cloud

For sonar.organization and sonar.login, use the organization key and the generated token from the sonar cloud my account area.

TODO