Case study N° 02 · Sports

Titan Stats

Keyboard-first live stat entry and broadcast graphics for a high school football broadcast.

Booth box-score refresh
4s
Updates in place without reloading, and shows RECONNECTING instead of going blank.
Fed by one play log
10pages
Overlay, booth box score, leaders and the public site read the same records.
Stored twice
0stats
Every number is worked out from the play log, so undo and edit always leave it right.
Titancast game page after a final: last down, ball spot and drive summary over a live field graphic, with the final and recent plays
Fig. 1|Titancast, the public game page. Down, ball spot and the drive summary all come from the same log as the broadcast overlay.

Why I built it

The Port Arthur Memorial Titans broadcast wanted live stats on screen, but there was only one person in the press box to log every play. Generic stat apps are slow and full of clicks, and they stop working when the stadium Wi-Fi drops.

What I built

Titan Stats lets one person log a whole game from the keyboard. Each play feeds the broadcast overlay, a live box score for the announcers, leaders pages and the public site at titanstats.app.

  • Plays are typed as short commands. C 81 18 T ⏎ logs an 18-yard touchdown pass to #81. The passer comes from the pinned quarterback, and the cursor moves on as each part is filled in.
  • The booth box score refreshes every 4 seconds without reloading the page. If the connection drops, it says RECONNECTING instead of going blank.
  • Social cards, QR codes and a splash image are generated automatically with resvg.

The tricky part

The only thing Titan Stats stores is the list of plays. Every stat line, team total and feed entry is recalculated from that log. Because nothing is stored twice, undoing or editing a play always leaves the numbers right. A completed pass is a single record that credits both players, so the quarterback’s and receiver’s yards can’t drift apart.

Typing a play and clicking the buttons go through exactly the same code, and a test checks that both produce identical records.

Fan photo wall

Fans scan a QR code on the stream or the stadium screen and send in a photo from their phone. Nothing goes on air until someone approves it.

  • The phone shrinks the photo to 1600 px before sending it, which also removes the camera’s location data. Fans can add a name, a caption and a “Class of” year, which turns it into an alumni check-in.
  • New photos wait as pending in R2 and D1. The public pages only ever read approved photos, so a pending one can’t be seen even by someone who guesses its link. The approval page sits behind Cloudflare Access, and uploads are limited per phone.
  • The wall runs as an OBS browser source. Newly approved photos go up next, and “Show next” bumps one to the front. Once there are 12, the wall switches to a 2×2 grid, and its fades keep running even when the source is in the background.
  • After the game, “Clear for next game” moves everything into Past games. “Delete all for good” only works on that tab, so tonight’s wall can’t be wiped by accident. Tests run the real server code against an in-memory copy of the table.

Built to work offline

During a game, the browser’s own copy of the data is the source of truth, and Cloudflare D1 just holds the published copy. A dropped connection never stops the logging.

Where it stands

It was used on real Friday-night broadcasts during the 2026 season.

Figures

Press-box stat entry screen in the demo: score and clock, the pinned quarterback, the command line, quick-entry buttons and the play feed
  1. The quarterback is pinnedSo a completed pass only needs the receiver, the yards and a result.
  2. Typing and clicking agreeC 81 18 T ⏎ dispatches the same action as the buttons, and a test asserts the records match.
  3. One record, two creditsPasser and receiver yards come from the same entry, so they can never drift apart.
  4. The feed is the logEach card is one record. Undo pops it, and every total recomputes.
Fig. 2|The press-box tracker in the demo, on its sample roster. One typed line logs a whole play.
Fan photo wall on the broadcast (demo, drawn sample photos): a 2×2 grid of fan photos with captions, names and a Class of line, beside a QR code panel reading Get on the big screen
Fig. 3|The fan photo wall as an OBS source, on the demo’s drawn sample photos. Past 12 approved photos it becomes a 2×2 grid, with one tile changing every 5 seconds.
Photo wall approval queue (demo): Pending, On wall, Rejected and Past games tabs, with four pending photos, each with Approve and Reject buttons
Fig. 4|The approval queue, worked through during the game on a phone or laptop. Nothing a fan sends is public until someone approves it here.
titanstats.app public site: “Titans vs. Everybody” header with the 2026 schedule and final scores
Fig. 5|titanstats.app, the public site. Schedule and final scores are published from the same records.

Before

Previous scorebug on the stream: team logos, score 34–0, and "1ST · DOWN 2"

Score, quarter and the current down.

After

New scorebug on the stream: PAM 13, GCM 0, 1st & 10 at the PAM 44, Q2 1:50, with a possession marker

Live game clock, down and distance, ball spot and possession, all fed from the press box by Titan Stats and /clock.

Fig. 6|The broadcast scorebug, before and after.
Records in the log04812Kickoff3 min6 min9 minEnd Q1TD, #11 to #81, 24 ydsINT, #4, 14-yd return12 records6:10 into Q1
Fig. 7|Every record in the demo game’s first quarter, by game clock. The box score, leaders and play feed are all recomputed from these twelve rows, so a correction in one place is a correction everywhere.

Methods

Stack
React 18, TypeScript, Vite, Vitest, Cloudflare Pages Functions, Cloudflare D1, Cloudflare R2, resvg.
Data
The demo runs in your browser on sample data; nothing is sent anywhere.
Tests
Vitest, including a test that typed and clicked entries produce identical records.
Status
Live since Sep 2026. Press box, Friday nights.