Auto Tournament

Running locally

Run Auto Tournament from source for development.

What you need

  • Node.js 20. The repository has an .nvmrc, so nvm use picks the right version.
  • Yarn 1 (classic).
  • Docker, for the database.
  • Git.

Run the dev servers

Fork and clone

Fork Auto-Tournament/auto-tournament on GitHub, then clone your fork:

git clone https://github.com/YOUR_USERNAME/auto-tournament.git
cd auto-tournament

Start the database

yarn db

This starts PostgreSQL 16 in a Docker container called matchzy-postgres on port 5432.

Create .env

cp example.env .env

The DB_* values in example.env match yarn db. Set STEAM_API_KEY so you can sign in with Steam, and set the address of the dev server:

.env
FRONTEND_BASE_URL=http://localhost:5173
STEAM_API_KEY=your-steam-web-api-key

Start the API and the web app

yarn dev

This starts the API on port 3000 and the web app on port 5173. The API log is also written to logs/dev-api-<time>.log.

Open the app

Open http://localhost:5173 and sign in with Steam. On an empty database, the first user becomes admin. The dev build also shows Dev Tools in the menu and the Developer / Simulation tab in Settings.

Run a production build

To test the Docker image the way users run it, build it from your checkout:

Set the secrets

Set SESSION_SECRET, SERVER_TOKEN and STEAM_API_KEY in .env. Set FRONTEND_BASE_URL=http://localhost:3069.

Build and start

yarn docker:local:up

This runs docker compose --env-file .env -f docker/docker-compose.local.yml up -d --build. The build has Dev Tools turned on and allows simulation mode.

Open the app

Open http://localhost:3069. Follow the log with yarn docker:local:logs.

Stop it

yarn docker:local:down

This build does not keep the database in a volume. The data is gone when the containers are removed.

Test a pull request

Check out the branch

With the GitHub CLI:

gh pr checkout 123

Run it

Use yarn dev for a quick look, or yarn docker:local:up to test the production build. After a change to the Dockerfile or the dependencies, use yarn docker:local:rebuild.

Useful commands

CommandWhat it does
yarn lintRun ESLint. yarn lint:fix fixes what it can.
yarn typecheckTypecheck the API and the web app.
yarn typecheck:ratchetFail if there are more type errors than in scripts/typecheck-baseline.json. CI runs this one.
yarn docs:apiGenerate docs/API-REFERENCE.md and docs/openapi.json from the routers.
yarn db:resetDelete the dev database container and start a new, empty one.
yarn db:stopStop the dev database.
yarn buildBuild the API and the web app.

To test matches without real players, see Simulation mode.

On this page