3540 Cryptocurrency Trading System
Please stop existing mysql client running (use terminal mysqld stop
OR MAC: System Preferences last row go into MySQL to turn off)
Since the Flask depends on a Mysql server, its a big overhead for users to install their own mysql servers and populate them with their own data. We created 2 containers (1 for python code, 1 for the mysqlserver) and linked them through docker-composer to be able to communicate with each other. The setup code in db/init.sql automatically populates the database with sufficient data to test and run the Flask app
- install Docker and docker-compose for your operation system
cd
into TradingSystem directory (one that contains docker-compose.yml)- Run
docker-compose build
thendocker-compose up
to set up both python and mysql containers and connect them together - If you make any changes to the python code, you can use
ctrl-c
to stop both services, rundocker-compose build app
to build the latest python app imagedocker-compose up
to deploy the latest app image into a container - If you want to use your own python app.py which is eaiser to debug and develop in. I recommend doing only the
docker-compose build db
anddocker-compose start db
. This way you can connect to the mysql image that is in your container without having your own mysql server in your localhost. Then you can usepython app.py
to run your Flask app. Make sure to update your mysqlConfig.py with (host="127.0.0.1" instead)
- Register Page - Register
- Login Page - Login: Please use the password you input when you register; Session lasts 10 mins;
- Account Page - Deposit: to make sure you have enough money to buy crypto;
- Overview Page - Overview: Check the lastest page, updated every 2 seconds;
- Trading Page - Buy: Please follow the rules for trading: you have enough cash, not lower than the ask price, and not 10% higher than the ask price;
- Trading Page - Sell: Please follow the rules for trading: you have enough coins, not exceeds the bid price, and not 10% lower than the bid price;
- Trading Page & Account Page - Blotter and P&L Reporting: See the blotter and P&L for your account (link the db using userId);