Code for the website aocrecs.com. Includes both the server component and website interface.
Define the following environmental variables:
Variable | Purpose | Example |
---|---|---|
MGZ_DB |
URL to MGZ database. | postgresql://username:password@localhost:5432/mgzdb |
MGZ_GTM |
Google Tag Manager ID. | UA-10051774-7 |
AWS_ACCESS_KEY_ID |
AWS access key ID. | |
AWS_SECRET_ACCESS_KEY |
AWS secret access key. | |
VOOBLY_USERNAME |
Voobly username (to access metadata while uploading). | |
VOOBLY_PASSWORD |
Voobly password. |
The AWS keys provide access to the S3 bucket storing the compressed recorded games. The Voobly credentials are used to fetch account metadata when adding uploaded matches.
SSL certificate data must exist at data/
. Follow the guide here. docker-compose.yaml
is pre-configured.
docker-compose build
will build all required images.
docker-compose up -d
will launch three containers:
- Python server
- nginx (reverse proxy in front of server; host for static Javascript assets)
- certbot (for SSL certificate renewal)
Create a Python virtual environment (Python 3.6+) and enter it: python3 -m venv venv && venv/bin/activate
Install dependencies: pip install -e .
Launch the Python server:
uvicorn aocrecs.main:APP
(specify --host
and --port
as necessary)
Ensure that node
and yarn
are installed.
Install dependencies: yarn
Launch the create-react-app
development server (from js/
):
REACT_APP_API="http://<server_host>:<server_port>/api" REACT_APP_GTM="<gtm_id>" yarn start
(set HOSTNAME
and PORT
as necessary)
Pull requests are welcome. If you want to add a feature that requires access to the data, contact me on Discord (happyleaves#4133
) to arrange read-only database access.