Database Schema
TriviaFlow uses a relational database model to track quizzes, sessions, and live gameplay data.
Core Models
Quiz
The top-level container.
title: Name of the quiz.description: Optional text.
Question
Stores the actual trivia content.
quiz: FK to Quiz.text: The question string.image/resolution_image: FKs toQuizImage.correct_option: CharField ('A', 'B', 'C', 'D').duration: Integer (Seconds).
QuizImage
A centralized library for media assets.
title: Internal name for searching.image: Path to the file on disk.
Session Models
GameSession
Represents a running lobby.
room_code: Unique 4-6 char string (e.g.,XY123).state: 'LOBBY', 'QUESTION', 'INTERMEDIATE', 'END'.quiz_queue: Comma-separated list of Quiz IDs (Playlist).
Player
A participant in a session.
nickname: Display name.score: Current points.token: UUID used for reconnection if the browser is closed.
PlayerExclusion
Manages handicaps or exclusions.
- Links
PlayerandQuestion. compensate_points: Boolean. If true, player gets points automatically.