# mstar13-sys/cez_techtrivia architecture

> Architecture diagram of the GitHub repository mstar13-sys/cez_techtrivia, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mstar13-sys/cez_techtrivia
- Repository: https://github.com/mstar13-sys/cez_techtrivia

## Overview

TechTrivia is a PHP web quiz platform. Players register or sign in, choose a category and difficulty, answer questions, and receive game results with XP and achievement progression; users can also view leaderboards and manage account settings. Admin views support question and account administration, deleted-item restoration, and notifications. The graph reflects calls and dependencies shown in excerpts and the SOURCE INDEX; frontend asset wiring and unsampled implementation details are omitted where relationships cannot be verified.

Main entry points: [`models/User.php`](https://github.com/mstar13-sys/cez_techtrivia/blob/main/models/User.php) (Player Domain), [`controllers/QuizController.php`](https://github.com/mstar13-sys/cez_techtrivia/blob/main/controllers/QuizController.php) (Quiz Runtime), [`models/Question.php`](https://github.com/mstar13-sys/cez_techtrivia/blob/main/models/Question.php) (Question Domain), [`core/SoftDeleteStore.php`](https://github.com/mstar13-sys/cez_techtrivia/blob/main/core/SoftDeleteStore.php) (Soft Delete Store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Player Experience"]
  node_landing["Landing Page<br/>[index.php]"]
  node_auth_entry["Authentication Entry<br/>[login.php]"]
  node_dashboard["Dashboard<br/>[dashboard.php]"]
  node_quiz_setup["Quiz Selection<br/>[select_quiz.php]"]
  node_quiz_view["Question View<br/>[quiz.php]"]
  node_game_over["Game Over<br/>[game_over.php]"]
  node_results["Results<br/>[results.php]"]
  node_leaderboard["Leaderboard<br/>[leaderboard.php]"]
  node_achievements["Achievements<br/>[achievements.php]"]
  node_settings_view["Account Settings<br/>[settings.php]"]
end

subgraph group_operations["Admin Operations"]
  node_admin_view["Admin Console<br/>[admin.php]"]
  node_admin_settings["Admin Settings<br/>[admin_settings.php]"]
  node_deleted_view["Deleted Items<br/>[deleted.php]"]
  node_notifications_view["Notifications<br/>[notifications.php]"]
end

subgraph group_domain["Application Logic"]
  node_auth_controller["Authentication<br/>[AuthController.php]"]
  node_quiz_controller["Quiz Runtime<br/>[QuizController.php]"]
  node_settings_controller["Settings Actions"]
  node_user_model["Player Domain<br/>[User.php]"]
  node_question_model["Question Domain<br/>[Question.php]"]
  node_session_model["Game Session<br/>[GameSession.php]"]
  node_base_model["Model Base<br/>[Model.php]"]
  node_session_helper["Session Helpers<br/>[session_helper.php]"]
  node_bootstrap["Application Bootstrap<br/>[autoload.php]"]
end

subgraph group_persistence["Persistence"]
  node_database["PDO Database<br/>[Database.php]"]
  node_db_config["Database Config<br/>[database.php]"]
  node_soft_delete[("Soft Delete Store")]
  node_notification_store[("Notification Store")]
end

node_player(("Player"))

node_player -->|"visits"| node_landing
node_landing -->|"loads leaderboard"| node_user_model
node_player -->|"signs in"| node_auth_entry
node_auth_entry -->|"submits action"| node_auth_controller
node_auth_controller -->|"authenticates"| node_user_model
node_auth_controller -->|"records recovery"| node_notification_store
node_player -->|"chooses quiz"| node_quiz_setup
node_quiz_setup -->|"starts quiz"| node_quiz_controller
node_quiz_controller -->|"fetches questions"| node_question_model
node_quiz_controller -->|"saves game"| node_user_model
node_quiz_controller -->|"routes to question"| node_quiz_view
node_quiz_controller -->|"routes at completion"| node_game_over
node_dashboard -->|"loads player data"| node_user_model
node_quiz_view -->|"submits answers"| node_quiz_controller
node_quiz_view -->|"reads question data"| node_question_model
node_user_model -->|"queries player data"| node_database
node_user_model -->|"tracks deleted records"| node_soft_delete
node_user_model -->|"writes notifications"| node_notification_store
node_question_model -->|"extends"| node_base_model
node_question_model -->|"marks questions deleted"| node_soft_delete
node_base_model -->|"uses connection"| node_database
node_database -->|"loads settings"| node_db_config
node_session_helper -->|"checks account status"| node_soft_delete
node_settings_controller -->|"updates account"| node_user_model
node_settings_controller -->|"redirects to"| node_settings_view
node_settings_view -->|"submits changes"| node_settings_controller
node_admin_view -->|"manages players"| node_user_model
node_admin_view -->|"manages questions"| node_question_model
node_admin_settings -->|"uses settings actions"| node_settings_controller
node_deleted_view -->|"manages deleted records"| node_user_model
node_deleted_view -->|"manages deleted questions"| node_question_model
node_notifications_view -->|"reads notifications"| node_notification_store
node_notifications_view -->|"reads deletion metadata"| node_soft_delete
node_leaderboard -->|"loads rankings"| node_user_model
node_achievements -->|"loads achievements"| node_user_model
node_bootstrap -->|"loads"| node_database
node_bootstrap -->|"loads"| node_soft_delete
node_bootstrap -->|"loads"| node_notification_store
node_session_model -->|"extends"| node_base_model

click node_landing "https://github.com/mstar13-sys/cez_techtrivia/blob/main/index.php"
click node_auth_entry "https://github.com/mstar13-sys/cez_techtrivia/blob/main/login.php"
click node_auth_controller "https://github.com/mstar13-sys/cez_techtrivia/blob/main/controllers/AuthController.php"
click node_dashboard "https://github.com/mstar13-sys/cez_techtrivia/blob/main/views/dashboard.php"
click node_quiz_setup "https://github.com/mstar13-sys/cez_techtrivia/blob/main/views/select_quiz.php"
click node_quiz_controller "https://github.com/mstar13-sys/cez_techtrivia/blob/main/controllers/QuizController.php"
click node_quiz_view "https://github.com/mstar13-sys/cez_techtrivia/blob/main/views/quiz.php"
click node_game_over "https://github.com/mstar13-sys/cez_techtrivia/blob/main/views/game_over.php"
click node_results "https://github.com/mstar13-sys/cez_techtrivia/blob/main/views/results.php"
click node_leaderboard "https://github.com/mstar13-sys/cez_techtrivia/blob/main/views/leaderboard.php"
click node_achievements "https://github.com/mstar13-sys/cez_techtrivia/blob/main/views/achievements.php"
click node_settings_view "https://github.com/mstar13-sys/cez_techtrivia/blob/main/views/settings.php"
click node_settings_controller "https://github.com/mstar13-sys/cez_techtrivia/blob/main/controllers/SettingsController.php"
click node_admin_view "https://github.com/mstar13-sys/cez_techtrivia/blob/main/views/admin.php"
click node_admin_settings "https://github.com/mstar13-sys/cez_techtrivia/blob/main/views/admin_settings.php"
click node_deleted_view "https://github.com/mstar13-sys/cez_techtrivia/blob/main/views/deleted.php"
click node_notifications_view "https://github.com/mstar13-sys/cez_techtrivia/blob/main/views/notifications.php"
click node_user_model "https://github.com/mstar13-sys/cez_techtrivia/blob/main/models/User.php"
click node_question_model "https://github.com/mstar13-sys/cez_techtrivia/blob/main/models/Question.php"
click node_session_model "https://github.com/mstar13-sys/cez_techtrivia/blob/main/models/GameSession.php"
click node_base_model "https://github.com/mstar13-sys/cez_techtrivia/blob/main/models/Model.php"
click node_database "https://github.com/mstar13-sys/cez_techtrivia/blob/main/core/Database.php"
click node_db_config "https://github.com/mstar13-sys/cez_techtrivia/blob/main/config/database.php"
click node_soft_delete "https://github.com/mstar13-sys/cez_techtrivia/blob/main/core/SoftDeleteStore.php"
click node_notification_store "https://github.com/mstar13-sys/cez_techtrivia/blob/main/core/NotificationStore.php"
click node_session_helper "https://github.com/mstar13-sys/cez_techtrivia/blob/main/helpers/session_helper.php"
click node_bootstrap "https://github.com/mstar13-sys/cez_techtrivia/blob/main/autoload.php"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_landing,node_auth_entry,node_dashboard,node_quiz_setup,node_quiz_view,node_game_over,node_results,node_leaderboard,node_achievements,node_settings_view toneBlue
class node_admin_view,node_admin_settings,node_deleted_view,node_notifications_view toneAmber
class node_auth_controller,node_quiz_controller,node_settings_controller,node_user_model,node_question_model,node_session_model,node_base_model,node_session_helper,node_bootstrap toneMint
class node_database,node_db_config,node_soft_delete,node_notification_store toneRose
class node_player toneIndigo
```

## Components

### Player Experience

- [Landing Page](https://github.com/mstar13-sys/cez_techtrivia/blob/main/index.php): `index.php`
- [Authentication Entry](https://github.com/mstar13-sys/cez_techtrivia/blob/main/login.php): `login.php`
- [Dashboard](https://github.com/mstar13-sys/cez_techtrivia/blob/main/views/dashboard.php): `views/dashboard.php`
- [Quiz Selection](https://github.com/mstar13-sys/cez_techtrivia/blob/main/views/select_quiz.php): `views/select_quiz.php`
- [Question View](https://github.com/mstar13-sys/cez_techtrivia/blob/main/views/quiz.php): `views/quiz.php`
- [Game Over](https://github.com/mstar13-sys/cez_techtrivia/blob/main/views/game_over.php): `views/game_over.php`
- [Results](https://github.com/mstar13-sys/cez_techtrivia/blob/main/views/results.php): `views/results.php`
- [Leaderboard](https://github.com/mstar13-sys/cez_techtrivia/blob/main/views/leaderboard.php): `views/leaderboard.php`
- [Achievements](https://github.com/mstar13-sys/cez_techtrivia/blob/main/views/achievements.php): `views/achievements.php`
- [Account Settings](https://github.com/mstar13-sys/cez_techtrivia/blob/main/views/settings.php): `views/settings.php`

### Admin Operations

- [Admin Console](https://github.com/mstar13-sys/cez_techtrivia/blob/main/views/admin.php): `views/admin.php`
- [Admin Settings](https://github.com/mstar13-sys/cez_techtrivia/blob/main/views/admin_settings.php): `views/admin_settings.php`
- [Deleted Items](https://github.com/mstar13-sys/cez_techtrivia/blob/main/views/deleted.php): `views/deleted.php`
- [Notifications](https://github.com/mstar13-sys/cez_techtrivia/blob/main/views/notifications.php): `views/notifications.php`

### Application Logic

- [Authentication](https://github.com/mstar13-sys/cez_techtrivia/blob/main/controllers/AuthController.php): `controllers/AuthController.php`
- [Quiz Runtime](https://github.com/mstar13-sys/cez_techtrivia/blob/main/controllers/QuizController.php): `controllers/QuizController.php`
- [Settings Actions](https://github.com/mstar13-sys/cez_techtrivia/blob/main/controllers/SettingsController.php): `controllers/SettingsController.php`
- [Player Domain](https://github.com/mstar13-sys/cez_techtrivia/blob/main/models/User.php): `models/User.php`
- [Question Domain](https://github.com/mstar13-sys/cez_techtrivia/blob/main/models/Question.php): `models/Question.php`
- [Game Session](https://github.com/mstar13-sys/cez_techtrivia/blob/main/models/GameSession.php): `models/GameSession.php`
- [Model Base](https://github.com/mstar13-sys/cez_techtrivia/blob/main/models/Model.php): `models/Model.php`
- [Session Helpers](https://github.com/mstar13-sys/cez_techtrivia/blob/main/helpers/session_helper.php): `helpers/session_helper.php`
- [Application Bootstrap](https://github.com/mstar13-sys/cez_techtrivia/blob/main/autoload.php): `autoload.php`

### Persistence

- [PDO Database](https://github.com/mstar13-sys/cez_techtrivia/blob/main/core/Database.php): `core/Database.php`
- [Database Config](https://github.com/mstar13-sys/cez_techtrivia/blob/main/config/database.php): `config/database.php`
- [Soft Delete Store](https://github.com/mstar13-sys/cez_techtrivia/blob/main/core/SoftDeleteStore.php): `core/SoftDeleteStore.php`
- [Notification Store](https://github.com/mstar13-sys/cez_techtrivia/blob/main/core/NotificationStore.php): `core/NotificationStore.php`

### Other components

- **Player**

## Connections

- Player → Landing Page: visits (evidence: `index.php`)
- Landing Page → Player Domain: loads leaderboard (evidence: `index.php`)
- Player → Authentication Entry: signs in (evidence: `login.php`)
- Authentication Entry → Authentication: submits action (evidence: `login.php`)
- Authentication → Player Domain: authenticates (evidence: `controllers/AuthController.php`)
- Authentication → Notification Store: records recovery (evidence: `controllers/AuthController.php`)
- Player → Quiz Selection: chooses quiz (evidence: `views/select_quiz.php`)
- Quiz Selection → Quiz Runtime: starts quiz (evidence: `controllers/QuizController.php`)
- Quiz Runtime → Question Domain: fetches questions (evidence: `controllers/QuizController.php`)
- Quiz Runtime → Player Domain: saves game (evidence: `controllers/QuizController.php`)
- Quiz Runtime → Question View: routes to question (evidence: `controllers/QuizController.php`)
- Quiz Runtime → Game Over: routes at completion (evidence: `controllers/QuizController.php`)
- Dashboard → Player Domain: loads player data (evidence: `views/dashboard.php`)
- Question View → Quiz Runtime: submits answers (evidence: `views/quiz.php`)
- Question View → Question Domain: reads question data (evidence: `views/quiz.php`)
- Player Domain → PDO Database: queries player data (evidence: `models/User.php`)
- Player Domain → Soft Delete Store: tracks deleted records (evidence: `models/User.php`)
- Player Domain → Notification Store: writes notifications (evidence: `models/User.php`)
- Question Domain → Model Base: extends (evidence: `models/Question.php`)
- Question Domain → Soft Delete Store: marks questions deleted (evidence: `models/Question.php`)
- Model Base → PDO Database: uses connection (evidence: `models/Model.php`)
- PDO Database → Database Config: loads settings (evidence: `core/Database.php`)
- Session Helpers → Soft Delete Store: checks account status (evidence: `helpers/session_helper.php`)
- Settings Actions → Player Domain: updates account (evidence: `controllers/SettingsController.php`)
- Settings Actions → Account Settings: redirects to (evidence: `controllers/SettingsController.php`)
- Account Settings → Settings Actions: submits changes (evidence: `views/settings.php`)
- Admin Console → Player Domain: manages players (evidence: `views/admin.php`)
- Admin Console → Question Domain: manages questions (evidence: `views/admin.php`)
- Admin Settings → Settings Actions: uses settings actions (evidence: `views/admin_settings.php`)
- Deleted Items → Player Domain: manages deleted records (evidence: `views/deleted.php`)
- Deleted Items → Question Domain: manages deleted questions (evidence: `views/deleted.php`)
- Notifications → Notification Store: reads notifications (evidence: `views/notifications.php`)
- Notifications → Soft Delete Store: reads deletion metadata (evidence: `views/notifications.php`)
- Leaderboard → Player Domain: loads rankings (evidence: `views/leaderboard.php`)
- Achievements → Player Domain: loads achievements (evidence: `views/achievements.php`)
- Application Bootstrap → PDO Database: loads (evidence: `autoload.php`)
- Application Bootstrap → Soft Delete Store: loads (evidence: `autoload.php`)
- Application Bootstrap → Notification Store: loads (evidence: `autoload.php`)
- Game Session → Model Base: extends (evidence: `models/GameSession.php`)
