
Quiz - Real-Time Multiplayer Quiz Platform
A full-stack quiz platform with real-time multiplayer, solo gameplay, role-based access, and concurrency-safe PostgreSQL scoring with sqlc and goose.
Timeline
November 2026
Role
Full Stack Developer
Status
CompletedTechnology Stack
Overview
Quiz brings multiplayer and solo gameplay together in a full-stack platform with role-based access for teachers, students, and guest players. A Go WebSocket game engine coordinates rooms, synchronized timers, and live leaderboards, backed by PostgreSQL 18 (with sqlc and goose) and Redis 8, paired with a React 19 + TypeScript + Vite + Tailwind CSS v4 frontend, and deployed via a single-container multi-stage Docker build on Railway.
Real-Time Gameplay
- Room management for multiplayer sessions with six-character invite codes.
- Synchronized server-owned timers to keep players on the same question schedule.
- Live leaderboards and podium standings that update during gameplay.
- Solo gameplay alongside multiplayer rooms without requiring an account.
Database Layer & Reliable Scoring
- Type-safe queries with sqlc: All PostgreSQL 18 (
pgx/v5) queries are generated viasqlcfor compile-time SQL safety and zero-reflection query execution. - Advisory-locked migrations with goose: Schema evolution is managed with
github.com/pressly/goose/v3running advisory-locked startup migrations so concurrent instances never race during rollout. - Concurrency-safe scoring: PostgreSQL row locks, idempotent answer submissions, and an accepted-answer ledger prevent duplicate submissions from being counted more than once.
Stack & Deployment
- Backend: Go (1.27), WebSockets (
coder/websocket), Gorilla Mux, PostgreSQL 18 (pgx/v5), sqlc, goose, Redis 8 (go-redis/v9). - Frontend: React 19, TypeScript, Vite, Tailwind CSS v4, Playwright (E2E).
- Infrastructure: Single-container multi-stage Docker build deployed with Railway IaC.
Demo & Load Harness
The repository includes a documented 12-client multiplayer demonstration (one browser-driven player and eleven automated guest clients hosted by a teacher account) alongside a Go WebSocket protocol load harness (cmd/loadtest), integration tests, and Playwright E2E tests for verifying concurrent room and scoring behavior.