Skip to content
leve.devFull-Stack·Case Study 1 / 3
Full-Stack·2026·Live

Cuppr

Beer-pong tournaments live and die on the day: registrations, group stages, knockout brackets, a big screen everyone watches. Cuppr runs all of it in real time — hardened against every race condition a room full of players can trigger.

Next.js 16SupabaseStripeTailwind v4Visit site
43
DB migrations
42
E2E test specs
100
teams in one test run
7
tournament phases
9
email templates
cuppr.de landing: bold 'Bierpong am Strand' headline with a live countdown to the next tournament
400 teams, 5 tournaments, one champion — the 2026 season on cuppr.de.
01 — The Story

From Lovable prototype to production rewrite.

Cuppr started in 2025 as a quick Lovable prototype — back then for table football. When it needed to actually run real tournaments with real money on the line, I rewrote it from scratch: tests, row-level security, Stripe, and a realtime layer built to survive a live event.

It now covers the full lifecycle across seven phases — from draft and open registration through the group stage and knockout bracket to a completed tournament with a season ranking.

02 — The Hard Part

A room full of people, all writing at once.

Live tournaments are a concurrency nightmare — scores entered simultaneously, registrations racing for the last slot. The engineering is all about making that safe:

  • Score entry uses optimistic locking: the client sends the timestamp it last saw, and stale writes are rejected instead of silently overwriting.
  • Registration, team creation and the knockout start all run through Postgres procedures with row locks — the app layer only validates and audits.
  • Realtime channels push updates to admins (2s debounce) and public viewers (3s) without hammering the database.
  • One test spec runs a complete 100-team tournament end to end; 42 E2E specs and 166 unit tests guard the whole flow.
  • The projector mode runs without auth for the big screen; a season ranking is computed live from a single source-of-truth procedure.
Race-safety through database procedures — the app layer only does validation, snapshotting and audit. Payments and refunds are the single source of truth.
engineering notes from the project

Planning something similar?

I design and ship AI agent systems, data platforms and full-stack products — from first idea to production.

Get in touch