Tournament platform · Web app
Ordinalturf Bracket
Free tournament bracket platform for the Ordinalturf community: five formats, live scores for spectators and auto-generated posters.

Overview
A full-stack web app for running tournaments end to end. Organisers sign up, create a tournament, register participants, generate the bracket and enter scores from the sidelines, while spectators follow the live bracket on their phones without logging in or refreshing. It supports single and double elimination, round robin, Swiss, and group stage + knockout, and the Ordinalturf community uses it to run its Mobile Legends tournaments.
Architecture
Clients (Organiser dashboard, Public live view (3 s polling)) → HTTPS · ETag/304 → Route handlers (Auth, role & origin checks, Zod validation) → Commands → Services (Transaction + row lock, Pure bracket engine, Audit log & version bump) → Writes → Data (Neon Postgres, Prisma)
Key features
- Five formats: single elimination, double elimination, round robin, Swiss, and group stage + knockout
- Pure bracket engine — no database, clock or randomness, enforced by ESLint — covered by 245 unit tests
- Live spectator view: clients poll a version endpoint every 3 seconds with ETag/304 and refresh only when the bracket changes
- Concurrency-safe writes: per-tournament row locks inside transactions, an audit log and a version bump on every change
- Interactive SVG bracket with zoom and pan, plus match list, participants and standings with score-based tiebreaks
- Auto-generated posters for every round and e-certificates for the top three, downloadable as images
- Organiser accounts with public sign-up (Better Auth), per-match schedules, best-of-aware score entry and team logos
- Automatic retention: finished tournaments are deleted 12 days after finalisation by a Vercel cron job
Tech stack
- Next.js
- TypeScript
- PostgreSQL
- Prisma
- Neon
- Better Auth
- Tailwind CSS
- Vitest
- Playwright
Screenshots
Want the details behind this project?
I'm happy to walk through the architecture, trade-offs and what I'd do differently.