How Hot Shots is built

The code runs in four places: the Tipster's browser, the TanStack Start server on Vercel, the Supabase database, and Squiggle, the AFL data service. Click a box on the map, or a topic under it, to open that part of the system.

The browser only ever talks to the site's own server, plus a Realtime WebSocket during Games. Only the two sync endpoints call Squiggle, and Supabase's own scheduler starts them. Every other read comes from the site's own tables.

The Demo

The public Demo is the same site, built with VITE_DEMO=true. It runs entirely in the visitor's browser over a 2026 snapshot, with no Supabase, no Squiggle and no sign-in.

Same pages, hooks and queriesnothing here knows which site it isService registryrouter.tsx registersstart-demo.ts registersLIVE SITEGames → server functions → tablesLive scores → Supabase RealtimeDEMO · VITE_DEMO=trueGames → bundled Season snapshotLive scores → no-op; the Demo clock
The swap happens in one place. The Demo's Games finish as the Demo clock passes them, so the visitor plays through a whole Season against made-up Tipsters.

How it works

  • New data has to reach components through the service registry, or the Demo won't have it.
  • A Demo-only import is gated with the condition written out (import.meta.env.VITE_DEMO === "true"), so the live build drops it.
  • The Demo keeps no query cache in the browser. Each visit starts fresh.

Why

A Demo with no server, database or sign-in can't leak real Tips, costs nothing to run, and can't break the live site.

Decision record: ADR 0004

Stack and testing

Built with

  • React 19, the interface
  • TanStack Start and Router, file-based routes and server functions
  • TanStack Query, server state, cached in the browser
  • Supabase, Postgres, Auth and Realtime
  • Vercel, hosting for the server
  • Tailwind CSS v4 and shadcn/ui, styling and components
  • Zod, validating what Squiggle sends and what the server receives

How it's tested

  • Vitest unit and component tests, next to the code they cover.
  • Storybook stories for components and diagrams, including this page's.
  • The Demo: the whole site running in the browser over a snapshot, so every page can be exercised end to end with no accounts or live data.

Read the code in the repository, the decision records, or AGENTS.md, the guide the project's contributors and coding agents work from.

Decisions

Each decision record explains what was chosen and the alternatives it beat.