Skip to content

Latest commit

 

History

History

Instruction for setting up Backend server

  1. Create a .env file that contains a variable of SQLALCHEMY_DATABASE_URI, GMAIL_ACCOUNT, GMAIL_PASSWORD, RECEIVER_EMAIL_LIST, and ADMIN_EMAIL_LIST.
SQLALCHEMY_DATABASE_URI=mysql+pymysql://<username>:<password>@127.0.0.1:3306/superb
GMAIL_ACCOUNT=<sender_account>
GMAIL_PASSWORD=<sender_password>
RECEIVER_EMAIL_LIST=<receiver_1>,<receiver_2>,...
ADMIN_EMAIL_LIST=<admin_1>,<admin_2>,...
  1. Install requirements and unzip required files
./prepare.sh
  1. In backend/ run
  • For development
python3 app.py
  • For production (w/o independent environment)
uwsgi --ini app.ini
  • For production (w/ independent environment) [Recommended]
  1. Install pipenv
pip3 install pipenv
pipenv --three
pipenv install
  1. Get the path of virtual env directory
pipenv --venv
  1. Append app.ini with the virtual env directory
virtualenv = <path to the virtual directory>
  1. Start server with
<path to the virtual directory>/bin/uwsgi --ini app.ini