Code Docs

ARBITRE Docs

Deploying Arbitre to production

📘 This page documents how to put Arbitre live on a server running NixOS.

About NixOS

NixOS is a Linux distribution built on top of the Nix package manager. It uses declarative configuration and allows reliable system upgrades.

In development, Arbitre has been deployed using NixOS.

How to deploy Arbitre

Using Ansible

Follow the instructions in config/README.md

Then, run :

ansible-playbook deploy.yaml -i inventory.yaml

Manually

  1. Navigate to the /srv/arbitre directory and run git pull to ensure that the latest version of the code is pulled from the Git repository.

  2. Navigate to the frontend directory.

  3. Check the frontend’s .env file and compare it to the .env.example file to ensure that the environment variables are properly set up.

  4. run npm run build to build the frontend of the platform.

  5. Navigate to the backend directory.

  6. Check the backend’s .env file and compare it to the .env.example file to ensure that the environment variables are properly set up.

  7. Run python manage.py makemigrations to create new migrations based on the changes made to the models.

  8. Run python manage.py migrate to apply the migrations to the database.

  9. Run python manage.py collectstatic to collect the static files from all the applications. They will automatically be put into the STATIC_ROOT directory.

  10. Finally, restart the daphne, celery, celerybeat, and nginx services by running sudo systemctl restart <service-name> for each of them.

Example /etc/nixos/configuration.nix

Setting everything up

Django admin user

Navigate to /backend , and run python [manage.py](<http://manage.py>) createsuperuser

Runner API key

The runners need an API key to be able to access data from the API. Create the API Key from the Django admin panel and write it in /backend/.env, under API_KEY=

Table of Contents