Olimpijski Kviz — Milano-Cortina 2026
Real-time quiz platform for 25,000 concurrent viewers during live Olympic broadcasts
Real-time quiz platform for 25,000 concurrent viewers during live Olympic broadcasts
A real-time interactive quiz platform built for the Milano-Cortina 2026 Winter Olympics. Every evening during the Games (Feb 6–21), TV Slovenia 2 broadcast a QR code and up to 25,000 viewers joined a live quiz on their phones — answering 16 timed questions about Olympic history, Slovenian athletes, and winter sports trivia, competing for a trip to the LA 2028 Summer Olympics.
16 daily quizzes. 15 seconds per question. Time-based scoring. Live leaderboards. All synchronized without WebSockets.
A poll-based state synchronization architecture: HTMX morph-swaps poll the server every 1–2 seconds, and a Redis-cached quiz state machine drives phase transitions automatically via BullMQ workers.
State machine with 6 phases manages each quiz:
LOBBY → QUESTION → SPONSOR_EXPOSITION → WAITING → STANDINGS → COMPLETED
Caching layer with 95%+ Redis hit rate eliminates database pressure — leaderboard queries reduced from ~25,000 to 1 per question round (25,000× improvement). TTL jitter prevents cache stampedes.
Idempotent submissions via Prisma transactions prevent double-counting. Distributed Redis locks prevent race conditions during phase transitions.
| Metric | Value |
|---|---|
| Concurrent users | 25,000 |
| Throughput | 2,959 req/sec sustained |
| Median latency | 108 ms |
| Requests under load test | 1,066,605 (zero failures) |
| HTTP success rate | 100% |
| Cache hit rate | 95%+ |
| N+1 query elimination | 25,000× reduction |
| Quizzes delivered | 16 (daily, Feb 6–21) |
| Questions per quiz | 16 (4 choices, 15 sec timer) |
| TypeScript files | 141 (43,044 LOC) |
| JavaScript (k6 load tests) | 13 (2,132 LOC) |
| Total lines | 58,226 |
| Test files | 34 (19,000+ LOC) |
| Prisma models | 13 |
| Database indexes | 30+ strategic |
| k6 load test scenarios | 13 |


Aggregate leaderboard: "Best 10 of 16" scoring — must complete 10+ quizzes to appear in final standings.
| Question Screen | Standings Screen |
|---|---|
![]() |
![]() |
| Component | Spec |
|---|---|
| App servers | 3–6 × 8vCPU (Digital Ocean) |
| Database | PostgreSQL Premium 4vCPU / 16GB |
| Cache | Redis Premium 4GB |
| Load balancer | DO LB + Cloudflare Pro |
| Monthly cost | €713–€1,351 (~€0.06/user) |
| Deployment | GitLab CI/CD, zero-downtime PM2 reload |
Load tested with k6 on local MacBook Pro M1 (4,000 VUs):
Operations dashboard for a Slovenian property inspection company
National innovation awards platform for Slovenia's Chamber of Commerce
Event carpooling platform with real-time CO2 impact tracking