๐ป Website | โ๏ธ Design | ๐ Brainstorm Doc
Score and stats tracker for the Waterloo Warriors badminton team.
Make a Copy of .env.sample, name it .env and move it the root dir.
From the root dir, run ./devops/init.sh
When the script finishes, verify that it has been setup properly by visiting localhost:8000.
Q: I get a db error at the end of the init.sh script
A: Go the terminal of the app container, and run python3 app/scripts/createTables.py
, and python3 -m app.scripts.add_prod_data
If all else fails, run ./devops/nuke.sh from the root, and re-run init.sh.
The frontend is built using React.js. You will need npm to get started. After downloading, you can get the frontend server working locally by running:
cd front-end
npm install
npm start
Note: The frontend queries the production backend APIs and data. To change this, you must edit the DomainName
in API.js
to point to your local server (usually https://localhost:5000
)
Our application uses PostgreSQL to store the backend data. Setting up the database can be done as follows:
Mac
brew install postgresql
pg_ctl -D /usr/local/var/postgres/ start
createdb <name>
psql <name>
Windows
Download postgresql from https://www.postgresql.org/
Run installation, with all defaults
Open psql command line, from start menu
CREATE DATABASE <name>;
To ensure that the applicattion reads from the database correctly, you will need to set up environment variables. Make a copy of .env.sample
and rename it to .env
in the root directory. Set the database to the scripts/createTables.py
to create the required tables. For now, you will need to populate the data manually.
The backend is created using Flask. You will need Python3 to get started. Afterwards, the application can be run as follows:
Mac
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
FLASK_APP=app.main flask run
Windows
python3 -m venv venv
venv\scripts\activate
venv\scripts\pip.exe install -r requirements.txt
setx FLASK_APP "app.main"
flask run
Several scripts were created to help set up the local environment using Docker