OCUA Parity League code.
production: https://parity.ocua.ca
- You will need
uvto runpython - To install python dependencies run
uv sync - Run the python server with this command
uv run fastapi dev server/app.py - You can inspect available leagues at at
http://localhost:5000/api/leagues - Then league API calls like
http://localhost:5000/api/10/weeks/1andhttp://localhost:5000/api/10/stats(where10is the league_id) etc.
On production the python server serves a static build of the client. This can be used/tested locally by running yarn build and then visiting http://localhost:8000.
- You will need to install node and
yarnon your computer - Install the javascript dependencies by running
yarn installin thewebdirectory - Start the client by running
yarn devin thewebdirectory. If you make changes to the code the window will reload with the changes.
Note that the client requires a local server. It is possible to configure the proxy in web/vite.config.js to point the development client at the production API for doing read only frontend work.
To test locally by uploading a json file run:
curl -X POST --data @data/test/one.json -H "Content-Type: application/json" http://localhost:8000/submit_gameTo reset your local database you can reset the db file using git restore.
There is also an automated test suite which can be run using uv run pytest.
By default it will run e2e tests. For quick python only dev work use uv run pytest -k 'not e2e'
PRs welcome!
If you are interested in contributing (especially if you play in the league!) Feel free to contact me first on slack or by email if you need any help or have questions.