Skip to content
Switch branches/tags
Go to file

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

parity-server Build Status

OCUA Parity League server code.


Server Setup

  1. You will need python (version 3) (with pip) and docker (with docker-compose) on your local machine.
  2. To install python dependencies run pip install -r requirements.txt (You may need run as administrator depending on your security settings)
  3. Start the required services run sudo docker-compose up -d
  4. Run the python server with this command python server/
  5. Create your database by running python server/ init-db and then populate it with:
    • python server/ create-leagues
    • python server/ zuluru-sync
    • python server/ game-sync
  6. You can inspect available leagues at at http://localhost:5000/api/leagues
  7. Then league API calls like http://localhost:5000/api/10/weeks/1 and http://localhost:5000/api/10/stats (where 10 is the league_id) etc.

Roster sync requires certain zuluru privileges and some offline saved player data. If you need a full database ask for in #parity-dev and someone will help you out.

On production the python server serves a static build of the client. This can be tested locally by running yarn build and then visiting localhost:5000 (note that you need to run the server from inside the server folder or the relative path to the client won't work. e.g. cd server && python

Client Setup

  1. You will need to install node on your computer
  2. Install yarn by running the command npm install -g yarn
  3. Install the javascript dependencies by running yarn install
  4. Start the client by running yarn start. It will open a browser window with the app running on your computer. If you make changes to the code the window will reload with the changes.

Note that the client connects to the production server by default. This is safe to do because the client is read-only. This enables an easier development experience for anyone working only on the frontend. If you need to connect to a local server update the proxy to point to the local server http://localhost:5000 in the web/package.json file.


To test locally by uploading a json file run:

curl -X POST --data @data/test/one.json -H "Content-Type: application/json" http://localhost:5000/submit_game

To reset your local database you can remove the docker volume or delete server/postgres and restart the python server.

There is also an automated test suite which can be run using the python


This app is deployed to Heroku via a git push. This happens automatically when a branch is merged into master.


To sync teams from Zuluru:

heroku run python server/ zuluru-sync

To correct errors in the most recent week of stats do the following:

1. First backup the data locally `python server/ backup --week 6`

2. Connect to the production database

heroku pg:psql --app parity-server

Then remove the data from the production database:

DELETE FROM stats WHERE game_id IN (SELECT id FROM game WHERE week = 9 AND league_id = 10);
DELETE FROM game WHERE week = 9 AND league_id = 10;

3. Lastly re-seed the given week after making the edits `python3 server/ re-upload --prod True --week 9`

To create a dump of the postgres database locally:

sudo docker exec parity-server_db_1 pg_dump -Fc --no-acl --no-owner -U postgres postgres > pgdump_name

To restore a pg_dump on prod:

# uploaded the pg backup to google cloud in a public bucket
#  allUsers
#  Storage Object Viewer

heroku pg:backups:restore '' DATABASE_URL --app parity-server --confirm=parity-server


PRs welcome!

If you are interested in contributing (especially if you play in the league!) Feel free to contact me first if you need any help or have questions.



OCUA Parity League backend and public interface



No releases published


No packages published