Overview
Summit is a vertical climbing game where the whole hook is how high did you get. That makes the leaderboard the beating heart of the product — and leaderboards are deceptively hard to do well. I built a "soft, honestly-named" global best-height board on a self-hosted Supabase stack, with the integrity model thought through rather than bolted on.
The interesting part: the backend
- Anonymous-first identity — players get an anonymous JWT and a unique handle instantly, with a clean path to link Sign in with Apple later without losing their progress.
- Monotonic write path — a database trigger clamps every submission to the player's best height, so a stale or duplicated offline submit is a harmless no-op. That's what makes offline-flush idempotent.
- RLS as anti-griefing — row-level security constrains every write to the player's own row; public reads go through a locked-down view, never the table.
- Tested for real — the whole schema is covered by 24 pgTAP assertions, all green, including the RLS policies and the trigger's clamp/reject behavior.
Why it matters
Most indie leaderboards are one INSERT away from being meaningless. I treated the write path like production software — modeled the integrity rules explicitly, wrote the tests first, and caught a real spec contradiction (revoked SELECT vs. an upsert that needs to read its own row) before it shipped.
Screens
screenshot slot
screenshot slot
Screenshot placeholders — drop real images into assets/summit/ and swap these in.