Most online friendship quizzes ask you to create an account, store your friends' names in a database, and bury the page in pop-up ads.
When I built BFF Quiz Maker, I wanted the opposite: zero backend, zero database, and instant browser-only play.
Here are the three tiny architectural tricks that made it work cleanly on static hosting.
1. Encoding the entire quiz into the share URL
Instead of saving quizzes to Postgres or KV, every quiz is serialized into a compact JSON payload ({ n: name, a: "0123...", t: themeCode }) and encoded as base64url in the query string (/bff-test?q=...).
export function encodeQuiz(payload: { name: string; answers: number[]; theme?: QuizThemeId; }): string { const themeCode = payload.theme ? THEME_CODES[payload.theme] : "v"; return toBase64Url( JSON.stringify({ n: payload.name, a: payload.answers.join(""), t: themeCode }), ); } Why I love this pattern:
- Zero server cost & zero maintenance — the entire site is statically prerendered with Next.js App Router.
- Privacy by design — nothing is uploaded, no player list exists on my servers, and deleting the chat message effectively deletes the quiz.
- Instant themes & variable lengths — both 10-question quick quizzes and 15-question full quizzes (plus 4 color themes) fit in a short URL.
2. Generating shareable PNG score cards purely on the client
Friends love posting results to Instagram Stories or group chats, so instead of spinning up a serverless OG/screenshot worker per score, I generate a 1080x1080 PNG score card right inside the browser using the HTML5 <canvas> API and trigger a one-tap download.
3. Avoiding React state bugs when navigating between shared & new quizzes
One subtle bug I hit early: when a friend finished taking a quiz on /bff-test?q=... and clicked "Make your own BFF quiz" (navigating to /bff-test), the client component stayed mounted and kept its old "result" stage.
Keying the inner quiz component by the ?q= param (<BffQuizInner key={code ?? "create"} code={code} />) solved it cleanly with zero useEffect state resets.
Try it out (and roast the UX!)
- Create a free BFF test in ~30 seconds (no signup)
- Or try the clean party & team icebreaker decks like Would You Rather for Work and Charades (with a built-in 60s timer)
- Source code is open on GitHub: zjolnir/bff-quiz-maker
Would love any feedback from fellow devs — especially on mobile UX or other zero-backend browser games worth adding!
