PrimeTime Trivia
A pub trivia system built for a real weekly game night.
Every Thursday a room of people plays trivia on their own phones while the questions run on a television. There is no app to install and nothing on anyone's phone but a web page. The MC runs the whole night from a phone in their hand.
I wrote it because the commercial options all assumed something that was not true of this room: reliable internet, a venue that would let devices talk to each other, or a host willing to stand at a laptop all evening. What follows is one question, from a player tapping join to the scores going up, screen by screen.
One question, five screens
Joining
A player opens the address on the big screen and lands here. The choice matters more than it looks: a couple sharing one phone should be one entry, not two, and four people at a table who each brought a phone usually want to be one team. Asking once, in plain words, removes an argument later.
The question, in two places at once
The same question renders on the television and in every hand. The TV carries the things a room reads together: the category, the clock, the points, who is winning. The phone carries only what you tap.
What the MC sees
This is the screen that decides whether a night runs well, and it is the one nobody designs. The answer and the fact to read aloud are here, on the host's phone, and nowhere else until the reveal.
The reveal
The correct answer lights up, the wrong ones drain of colour, and the room gets told why.
Between questions
Standings, and a countdown so the room knows whether there is time to go to the bar.
Where the questions come from
The bank holds just under two thousand questions across several decks, and the hard part was never writing them. It was writing ones that are true. An authoring tool drafts questions against a category and a difficulty, and then a second pass, with no sight of the prompt that produced them, is handed the claims cold and asked to break them. Anything it doubts is rejected before a human ever reviews it.
Difficulty across a night is deliberately not flat. It ramps, because rounds that are uniformly easy are what make the strong players stop coming back, and a weekly trivia night lives or dies on whether the regulars return.
How it is built
- Server · Node and TypeScript, websockets throughout. Game state lives in one engine with pure scoring functions, so a night can be replayed and tested without a browser.
- Client · Preact. The player bundle is about 21 KB gzipped, because some of these phones are old and the venue wifi is doing its best.
- Footprint · Measured, not guessed: 119 MB of RAM idle, 121 MB with a hundred players mid-question. A hundred players cost under 3 MB. A sixty-question night moves about 13 MB in total.
- Hosting · A Jetson Orin Nano in a cupboard at my house, reached through a Cloudflare Tunnel. No cloud bill, no inbound ports, no certificate to renew.
- Tests · 168 of them, run against a real build rather than mocks, because the bug that ends a trivia night is never the one a mock would catch.
Seeing it
The game is at trivia.gmdeckard.com and it is genuinely running right now. Fair warning before you click: joining needs the room code shown on the big screen in the room, and the host and MC screens are behind a password, so from outside you will reach a join form you cannot complete. That is the point of the room code. The screens above are the honest version of what a night looks like.
The source is on GitHub.