A real-time quiz platform built on .NET and PostgreSQL, engineered to handle 1,000 concurrent users. Quiz sessions are synchronized live via SignalR, while post-session processing is offloaded to a RabbitMQ-backed background worker — keeping the API responsive under load.
- 1,000 concurrent users — Kestrel + SignalR keep all clients in sync without polling
- Event-driven finalization — quiz results are processed asynchronously via RabbitMQ, decoupling submission from scoring
- Server-authoritative timing —
TimeHubbroadcasts server time to every client, preventing clock-skew cheating - Clean Architecture + CQRS — domain logic is isolated from infrastructure; every operation is a MediatR command or query
- Fully containerized — one
docker compose upspins up the entire stack
PuzzleLab/
├── src/
│ ├── PuzzleLab.API # ASP.NET Core REST API + SignalR hub (port 3000)
│ ├── PuzzleLab.Web # Blazor frontend (port 8000)
│ ├── PuzzleLab.Domain # Entities, repository interfaces, domain events
│ ├── PuzzleLab.Application # MediatR command/query handlers (CQRS)
│ ├── PuzzleLab.Infrastructure # EF Core, PostgreSQL, RabbitMQ, JWT
│ ├── PuzzleLab.Shared # Shared DTOs
│ └── PuzzleLab.BackgroundWorker # Async quiz finalization consumer
└── diagram/ # Entity Relationship Diagram
Browser (Blazor)
│ REST + SignalR
▼
PuzzleLab.API ──── PostgreSQL
│
│ publishes domain event on quiz completion
▼
RabbitMQ Queue
│
▼
BackgroundWorker ── finalizes scores ──► PostgreSQL
| Layer | Technology |
|---|---|
| Backend | ASP.NET Core 8.0 |
| Frontend | Blazor (Server-Side Rendering) |
| Database | PostgreSQL |
| ORM | Entity Framework Core 9.0 |
| Messaging | RabbitMQ |
| Real-time | SignalR |
| Auth | JWT Bearer |
| Containerization | Docker Compose |
docker compose up --build| Service | Port | Description |
|---|---|---|
| Web (Blazor) | 8000 | Frontend UI |
| API | 3000 | REST API + SignalR hub |
| Background Worker | — | Quiz finalization consumer |
| PostgreSQL | 5432 | Database |
| RabbitMQ | 5672 / 15672 | Message broker + management UI |
Open http://localhost:8000. The database is seeded with sample users, questions, and quizzes on first run.
Requirements: .NET SDK 8.0 (see global.json), PostgreSQL, RabbitMQ
dotnet run --project src/PuzzleLab.API
dotnet run --project src/PuzzleLab.Web
dotnet run --project src/PuzzleLab.BackgroundWorkerAdmin
- Manage users and assign quizzes
- Create question packages with optional image support
- Schedule quizzes with enforced start/end time windows
- View results and per-participant statistics
User
- View and take assigned quizzes within their scheduled window
- Real-time countdown timer synchronized from the server
- Personal quiz history and performance statistics
Swagger UI: http://localhost:3000/swagger
See diagram/PuzzleLab_ERD.jpg for the full entity relationship diagram.