- A player's deck for a night is edited in a single form and written to their match rows and their standings row, so the two can't disagree. Matches, standings and hand imports all fill blank decks from the decks already entered, whatever order the files are imported in. The imported standings table shows decks read-only. - Admins can rename a league. - test/e2e.sh runs end-to-end checks against the local podman stack (fixtures by default, or real exports: test/e2e.sh sampledata). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
33 lines
1.4 KiB
Markdown
33 lines
1.4 KiB
Markdown
# MTG league tracker
|
|
|
|
Leaderboard and results dashboard for a Magic league run on melee.gg. See `CLAUDE.md` for design notes.
|
|
|
|
## Run
|
|
```
|
|
cp .env.example .env # fill in DB_PASSWORD, SECRET_KEY (openssl rand -hex 32), ADMIN_PASSWORD (10+ chars)
|
|
docker compose up -d --build
|
|
```
|
|
Listens on `${BIND_ADDR:-127.0.0.1}:${HOST_PORT:-8888}`. Put a reverse proxy in front and set `COOKIE_SECURE=true` once on https.
|
|
Sub-path hosting: set `BASE_PATH=/mtg` and proxy with Caddy `handle_path /mtg/*`.
|
|
|
|
## Develop
|
|
```
|
|
npm install
|
|
npm test # parser + standings tests
|
|
npm run check # type-check
|
|
scripts/local.sh up && test/e2e.sh [sampledata] # end-to-end checks against the local podman stack
|
|
DATABASE_URL=postgres://... SECRET_KEY=... ADMIN_PASSWORD=... npm run dev
|
|
```
|
|
Whole stack locally with podman (own `.env.local` with generated secrets, own project/volume, port 8889):
|
|
```
|
|
scripts/local.sh up # build + start, prints URL and admin password
|
|
scripts/local.sh logs | ps | down
|
|
scripts/local.sh reset # down and delete the local database
|
|
```
|
|
Needs `podman compose` (podman 4.7+ with docker-compose or podman-compose) and the user socket:
|
|
`systemctl --user enable --now podman.socket`.
|
|
|
|
## Using it
|
|
Admin login, create a league (set how many top sessions count), add a session per night, then upload the Melee
|
|
matches export (one per round) or standings export on the session page, and set each player's deck.
|