[ <- BACK ]

┤ 04 / 06 :: BLINDTEST ├

Blindtest

Real-time multiplayer music quiz: private rooms, daily challenge, vinyl collection and Discord Activity.

blindtest.oliwr.win ->github.com/SwerkF/blindtest ->

Stack

  • React
  • Fastify
  • WebSocket
  • Prisma
  • Bun

What I did

A music quiz to play with friends, right in the browser or as a Discord Activity. Pick a nickname and an avatar, create a room (password-protected if needed) and share the code. Each round plays a 30-second clip: find the artist and the title in a single free-text field, and the year as a bonus.

Three modes: classic, anime (tracks matched with AnimeThemes and AniList) and album, where a blurred cover is revealed bit by bit. Any Deezer playlist works. The daily challenge serves 10 tracks of 20 seconds, the same for everyone, with a single attempt.

With a Discord account, you earn vinyl booster packs (after a game, from the daily challenge, achievements or accepted feedback) and build a public collection, with friends, history and a leaderboard.

blindtest :: architecture

┌ React ┐

Vite + nginx

WebSocket

┌ Fastify ┐

Bun

SQL

┌ SQLite ┐

Prisma

blindtest :: v0.6

3 game modes

28 test files

103 commits

>> Technical highlights

  • Real time over native WebSocket (@fastify/websocket): one socket per game, another per user for presence, invites and notifications.
  • Answers normalized (accents, punctuation, parentheses) then compared with Levenshtein distance, with an adjustable tolerance.
  • Anti-cheat: during a round, the client only gets the audio clip, never the title or artist. Booster draws happen server-side with node:crypto.
  • Deterministic daily challenge: tracks are ranked by a hash of the day, same selection for everyone with nothing stored, and a database unique constraint allows one attempt.
  • Two-phase booster opening: draw outside the transaction, then claim with a conditional update, preventing double spending over a catalog of about one million tracks.
  • Timers aligned on server time, sent over WebSocket, to fix drifting client clocks.