Problem
Running an inter-school league across multiple regions means juggling tournament structure, fixtures, live results, league tables, team rosters, and announcements — work that usually lives in spreadsheets and manual brackets. Standings drift out of sync with results, playoff seeding is recomputed by hand, every region needs its own scoped public view and its own scoped admin, and there is no single public home where players, parents, and fans can follow their team's season.
Approach
We built one Next.js 15 application on a Drizzle + Neon Postgres backend, split into a public-facing experience and a region-scoped admin console over a single BetterAuth model. Access is role-based: a super-admin manages users and admin invitations, while region-admins are scoped to the regions they manage. The data model is multi-sport (sport-tagged teams over a sport-agnostic engine), currently running soccer. The core is a configurable tournament engine: an operator sets group count, teams-qualifying-per-group, single- or two-leg playoff format, and whether draws are allowed; the platform auto-distributes teams into groups, generates the full round-robin fixture list, records results, and auto-recomputes standings on every result (P/W/D/L, goals for/against, goal difference, points on 3-for-a-win, position, last-5 form, and a qualification flag, ranking on points → goal difference → goals scored). When the group stage completes it auto-seeds a playoff bracket sized to the qualifier count, drawing winners against runners-up; two-leg ties resolve on aggregate with away goals as tiebreak, and rounds advance automatically through a draft → group stage → playoffs → completed lifecycle. Around that sits the full domain — regions, seasons, teams (with coaches and logos), fixtures, public standings, a Tiptap news system with YouTube-aware media, a podcasts/videos updates module, sponsorships, and a coaches' corner. OpenAI assists content authoring (icon names for resources, titles for updates, each with a deterministic fallback); media runs through UploadThing and transactional email through Resend.
Outcome
The platform is deployed and publicly live, giving each region a branded public home — teams, fixtures, standings, news, and podcasts/videos — while operators run a soccer season from a single admin console: create a tournament, register teams into groups, enter results, and let standings and the playoff bracket compute and seed themselves instead of being maintained by hand. Region-admins are confined to their own regions while a super-admin invites and manages the operator team.