A party game in plain JavaScript that earned a backend only when it needed one
This started as a game we played at home without any software: someone plays a song, cuts it after a couple of seconds, and the first team to shout has to keep singing. Doing it by hand meant one person stuck on a phone all night, picking tracks and arguing about who shouted first.
So I built the referee. It is the project I am most attached to, because nobody asked for it and real people use it in a living room. It kept growing from there: a solo mode where you guess the title from fragments that get longer, then optional Google accounts and a ranking.
The game is plain JavaScript built with Vite. It has to load instantly on someone's phone over shared mobile data, and every framework is weight plus a future upgrade I would have to do to keep it alive. The constraint also made me learn the platform APIs.
A leaderboard is only worth something if it cannot be cheated from the console. A solo game is recorded in Postgres while it is played, and SQL functions check each step: that the video is in the catalogue, that the title is right, and that enough time has passed. The database computes the points, never the browser.
A Netlify Function verifies the Google token, opens an HttpOnly session and calls the SQL functions, so the browser never sees the database credentials. Without an account the game works exactly the same. The ranking shows a short name; email and photo are not stored.
Players can upload their own MP3 and M4A files, so the game works with music that is not online. Those files are too large for localStorage, and keeping them in IndexedDB is what lets the game run with no connection at all.
The hard part is not playing audio, it is not spoiling the answer: the track name has to stay hidden through selection, playback and the cut, then appear on cue. Getting that flow right is most of what the game does.
The obvious next step now that a backend exists is shared rooms, so teams on different phones see the same cut at the same moment. That means real-time state and reconciling clocks across devices, a harder problem than anything here, and the reason it is not built yet.
Play it