- MacOS
- Python >= 3.6
- npm
- node
- redis
- Homebrew
- Chrome web browser
First you need to download the databases for our project, make sure the project folder is on the desktop on your mac because the command I use assumes you have put the project on the desktop.
-
Download
db.sqlite3
from "https://drive.google.com/open?id=1lGICmbDGhoVapLBg-pnXoCA-cYAGcjhH" andstockDB.zip
from "https://drive.google.com/open?id=1QKZbwWsxqr1iQ9Ht9bQOqqka_lSNp2Nu" in share google drive and then put them inproject/backend/src
folder, unzipstockDB.zip
into that directory. -
Download
node_modules.zip
from share google drive "https://drive.google.com/open?id=1NGG4-y6Y4K_Sud-ovLI7nBpDPbcW2SUl" and then put it inproject/frontend
folder, unzipnode_modules.zip
into that directory. -
Download
stock_ml.zip
from share google drive "https://drive.google.com/open?id=1mgtLtxOHt5YXAriqupscx3J51N7TIew5" and then put it inproject
folder, unzipstock_ml.zip
into that directory.
- First we need to install
homebrew
on mac, open your macterminal
and input the following command (since the pdf file cannot display the full length of the command, you can either type each character in the terminal or open readme.md file on the project root folder and copy the text):
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
During installation you need to press enter
and may need to enter your mac login password.
- Then we need to setup
redis
cache server. Type the following command:
brew install redis
- After that, start
redis
server:
redis-server /usr/local/etc/redis.conf
When the server is running, do not close the terminal window!
- Then open another terminal, you need to use
homebrew
to installpython3
in the terminal:
brew install python3
After installation, check the python version using the following command:
python3 --version
which give you
Python 3.7.4 or some version >= 3.6
Then check whether you are using the correct python package from homebrew (this is required because if you have install anaconda then the default python will be using anaconda rather than homebrew):
which python3
which should give you
/usr/local/bin/python3
- Now you can use
pip3
to installvirtualenv
to setup virtual environment:
/usr/local/bin/pip3 install virtualenv
- Then go to
project/backend
folder, and setup virtual environment:
cd ~/Desktop/project/backend
/usr/local/bin/virtualenv -p /usr/local/bin/python3 env
- Activate virtual environment:
source env/bin/activate
Now you can type the following command to check whether you have activated successfully:
which pip3
which python3
which gives
.../project/backend/env/bin/pip3
.../project/backend/env/bin/python3
- Then you need to install python packages using the following command:
pip3 install -r requirements.txt
- After all the packages are installed, you can start the server in the
project/backend/src
folder:
cd ~/Desktop/project/backend/src
python3 manage.py runserver
When the server is running, do not close the terminal window!
- Now we need to open another terminal window, and install
node js
andnpm
:
brew install node
- Then go to frontend directory and start frontend server:
cd ~/Desktop/project/frontend
npm start
Now you can see the application is running on localhost:3000
. Note that the default size of fronts in different computer may vary, in order to have better user experience, we recommend that you can shrink your browser to 90% using the following command: command
+ -
key on your keyboard.