How to install and run the backend
If you’ve never used git or github before, here is the tutorial on how to download, install and configure git.
Clone our repository into a local directory. Open a terminal/shell and go to a convenient directory and then type:
$ git clone https://github.com/cse112-sp20/nitro-server.git
or$ git clone git@github.com:cse112-sp20/nitro-server.git
- Install Docker
- Copy .env file from slack and put it in same directory as app.py
- initialize a virtual enviornment
python3 -m venv venv
- start virtual enviornment and install dependencies
source venv/bin/activate
pip3 install -r requirments.txt
- Start Mongo Docker container
sudo docker run -d -p 27017:27017 -v ~/data:/data/db mongo
python3 app.py
docker ps
docker exec -it <container name or id> bin/bash
mongo
ssh -i east2.pem ec2-user@ec2-54-227-1-34.compute-1.amazonaws.com
cd /var/www/nitro-server/ && gunicorn -b 0.0.0.0:8000 app:APP --daemon