# alexandreriff/quiz-web-app architecture

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

- Interactive diagram: https://gitdiagram.com/alexandreriff/quiz-web-app
- Repository: https://github.com/alexandreriff/quiz-web-app

## Overview

Quiz is a PHP/MySQL multiple-choice quiz application with a participant interface and an authenticated question-administration panel. Participants open a quiz, retrieve category questions, answer them, and receive a score; administrators sign in and manage questions. The graph includes routing, controllers, data access, and the user-facing pages. README capabilities help identify product branches, but frontend implementation details were not excerpted, so links from those pages to backend handlers are left unasserted.

Main entry points: [`http/Router.php`](https://github.com/alexandreriff/quiz-web-app/blob/master/http/Router.php) (HTTP router), [`controller/AdminPanel.php`](https://github.com/alexandreriff/quiz-web-app/blob/master/controller/AdminPanel.php) (Admin handler), [`controller/Login.php`](https://github.com/alexandreriff/quiz-web-app/blob/master/controller/Login.php) (Login handler), [`controller/Quiz.php`](https://github.com/alexandreriff/quiz-web-app/blob/master/controller/Quiz.php) (Quiz handler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Request handling"]
  node_router["HTTP router<br/>[Router.php]"]
  node_request["Request filters<br/>[Request.php]"]
  node_home["Home handler<br/>[Home.php]"]
  node_login["Login handler<br/>[Login.php]"]
  node_view["View renderer<br/>[View.php]"]
end

subgraph group_quiz["Quiz experience"]
  node_quizpage["Quiz interface<br/>[quiz.html]"]
  node_quizui["Quiz interaction<br/>[quiz.js]"]
  node_quizhandler["Quiz handler<br/>[Quiz.php]"]
  node_quizdao["Quiz lookup<br/>[QuizDao.php]"]
  node_score["Answer scoring<br/>[quiz.js]"]
end

subgraph group_admin["Administration"]
  node_adminpage["Admin interface<br/>[admin-panel.html]"]
  node_adminui["Admin interaction<br/>[admin-panel.js]"]
  node_adminhandler["Admin handler<br/>[AdminPanel.php]"]
end

subgraph group_data["Domain and storage"]
  node_question["Question model<br/>[Question.php]"]
  node_questiondao["Question access<br/>[QuestionDao.php]"]
  node_user["User model<br/>[User.php]"]
  node_userdao["User access<br/>[UserDao.php]"]
  node_database[("MySQL database<br/>[Database.php]")]
  node_environment["Environment config<br/>[Environment.php]"]
end

node_participant(("Participant"))
node_adminuser(("Administrator"))

node_participant -->|"opens app"| node_router
node_adminuser -->|"opens admin"| node_router
node_router -->|"reads URI"| node_request
node_router -->|"routes default"| node_home
node_home -->|"loads quiz data"| node_quizdao
node_home -->|"renders page"| node_view
node_router -.->|"dispatches"| node_login
node_login -.->|"reads credentials"| node_request
node_login -->|"checks account"| node_userdao
node_login -->|"uses user data"| node_user
node_router -.->|"dispatches"| node_quizhandler
node_quizhandler -->|"sets category"| node_question
node_quizhandler -->|"loads category questions"| node_questiondao
node_quizhandler -->|"renders quiz"| node_view
node_participant -->|"answers questions"| node_quizpage
node_quizpage -.->|"uses interactions"| node_quizui
node_quizui -->|"evaluates answers"| node_score
node_router -.->|"dispatches"| node_adminhandler
node_adminhandler -->|"reads inputs"| node_request
node_adminhandler -->|"builds question"| node_question
node_adminhandler -->|"manages questions"| node_questiondao
node_adminhandler -->|"renders panel"| node_view
node_adminuser -->|"manages questions"| node_adminpage
node_adminpage -.->|"uses interactions"| node_adminui
node_questiondao -->|"queries questions"| node_database
node_questiondao -->|"reads and writes"| node_question
node_quizdao -.->|"queries quiz"| node_database
node_userdao -->|"queries users"| node_database
node_userdao -->|"reads user"| node_user
node_database -.->|"reads connection settings"| node_environment

click node_router "https://github.com/alexandreriff/quiz-web-app/blob/master/http/Router.php"
click node_request "https://github.com/alexandreriff/quiz-web-app/blob/master/http/Request.php"
click node_home "https://github.com/alexandreriff/quiz-web-app/blob/master/controller/Home.php"
click node_login "https://github.com/alexandreriff/quiz-web-app/blob/master/controller/Login.php"
click node_view "https://github.com/alexandreriff/quiz-web-app/blob/master/utils/View.php"
click node_quizpage "https://github.com/alexandreriff/quiz-web-app/blob/master/resources/pages/quiz.html"
click node_quizui "https://github.com/alexandreriff/quiz-web-app/blob/master/resources/js/quiz.js"
click node_quizhandler "https://github.com/alexandreriff/quiz-web-app/blob/master/controller/Quiz.php"
click node_quizdao "https://github.com/alexandreriff/quiz-web-app/blob/master/dao/QuizDao.php"
click node_score "https://github.com/alexandreriff/quiz-web-app/blob/master/resources/js/quiz.js"
click node_adminpage "https://github.com/alexandreriff/quiz-web-app/blob/master/resources/pages/admin-panel.html"
click node_adminui "https://github.com/alexandreriff/quiz-web-app/blob/master/resources/js/admin-panel.js"
click node_adminhandler "https://github.com/alexandreriff/quiz-web-app/blob/master/controller/AdminPanel.php"
click node_question "https://github.com/alexandreriff/quiz-web-app/blob/master/model/Question.php"
click node_questiondao "https://github.com/alexandreriff/quiz-web-app/blob/master/dao/QuestionDao.php"
click node_user "https://github.com/alexandreriff/quiz-web-app/blob/master/model/User.php"
click node_userdao "https://github.com/alexandreriff/quiz-web-app/blob/master/dao/UserDao.php"
click node_database "https://github.com/alexandreriff/quiz-web-app/blob/master/utils/Database.php"
click node_environment "https://github.com/alexandreriff/quiz-web-app/blob/master/utils/Environment.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_router,node_request,node_home,node_login,node_view toneBlue
class node_quizpage,node_quizui,node_quizhandler,node_quizdao,node_score toneAmber
class node_adminpage,node_adminui,node_adminhandler toneMint
class node_question,node_questiondao,node_user,node_userdao,node_database,node_environment toneRose
class node_participant,node_adminuser toneIndigo
```

## Components

### Request handling

- [HTTP router](https://github.com/alexandreriff/quiz-web-app/blob/master/http/Router.php): `http/Router.php`
- [Request filters](https://github.com/alexandreriff/quiz-web-app/blob/master/http/Request.php): `http/Request.php`
- [Home handler](https://github.com/alexandreriff/quiz-web-app/blob/master/controller/Home.php): `controller/Home.php`
- [Login handler](https://github.com/alexandreriff/quiz-web-app/blob/master/controller/Login.php): `controller/Login.php`
- [View renderer](https://github.com/alexandreriff/quiz-web-app/blob/master/utils/View.php): `utils/View.php`

### Quiz experience

- [Quiz interface](https://github.com/alexandreriff/quiz-web-app/blob/master/resources/pages/quiz.html): `resources/pages/quiz.html`
- [Quiz interaction](https://github.com/alexandreriff/quiz-web-app/blob/master/resources/js/quiz.js): `resources/js/quiz.js`
- [Quiz handler](https://github.com/alexandreriff/quiz-web-app/blob/master/controller/Quiz.php): `controller/Quiz.php`
- [Quiz lookup](https://github.com/alexandreriff/quiz-web-app/blob/master/dao/QuizDao.php): `dao/QuizDao.php`
- [Answer scoring](https://github.com/alexandreriff/quiz-web-app/blob/master/resources/js/quiz.js): `resources/js/quiz.js`

### Administration

- [Admin interface](https://github.com/alexandreriff/quiz-web-app/blob/master/resources/pages/admin-panel.html): `resources/pages/admin-panel.html`
- [Admin interaction](https://github.com/alexandreriff/quiz-web-app/blob/master/resources/js/admin-panel.js): `resources/js/admin-panel.js`
- [Admin handler](https://github.com/alexandreriff/quiz-web-app/blob/master/controller/AdminPanel.php): `controller/AdminPanel.php`

### Domain and storage

- [Question model](https://github.com/alexandreriff/quiz-web-app/blob/master/model/Question.php): `model/Question.php`
- [Question access](https://github.com/alexandreriff/quiz-web-app/blob/master/dao/QuestionDao.php): `dao/QuestionDao.php`
- [User model](https://github.com/alexandreriff/quiz-web-app/blob/master/model/User.php): `model/User.php`
- [User access](https://github.com/alexandreriff/quiz-web-app/blob/master/dao/UserDao.php): `dao/UserDao.php`
- [MySQL database](https://github.com/alexandreriff/quiz-web-app/blob/master/utils/Database.php): `utils/Database.php`
- [Environment config](https://github.com/alexandreriff/quiz-web-app/blob/master/utils/Environment.php): `utils/Environment.php`

### Other components

- **Participant**
- **Administrator**

## Connections

- Participant → HTTP router: opens app (evidence: `README.MD`)
- Administrator → HTTP router: opens admin (evidence: `README.MD`)
- HTTP router → Request filters: reads URI (evidence: `http/Router.php`)
- HTTP router → Home handler: routes default (evidence: `http/Router.php`)
- Home handler → Quiz lookup: loads quiz data (evidence: `controller/Home.php`)
- Home handler → View renderer: renders page (evidence: `controller/Home.php`)
- HTTP router → Login handler: dispatches
- Login handler → Request filters: reads credentials (evidence: `controller/Login.php`)
- Login handler → User access: checks account (evidence: `controller/Login.php`)
- Login handler → User model: uses user data (evidence: `controller/Login.php`)
- HTTP router → Quiz handler: dispatches
- Quiz handler → Question model: sets category (evidence: `controller/Quiz.php`)
- Quiz handler → Question access: loads category questions (evidence: `controller/Quiz.php`)
- Quiz handler → View renderer: renders quiz (evidence: `controller/Quiz.php`)
- Participant → Quiz interface: answers questions (evidence: `README.MD`)
- Quiz interface → Quiz interaction: uses interactions
- Quiz interaction → Answer scoring: evaluates answers (evidence: `README.MD`)
- HTTP router → Admin handler: dispatches
- Admin handler → Request filters: reads inputs (evidence: `controller/AdminPanel.php`)
- Admin handler → Question model: builds question (evidence: `controller/AdminPanel.php`)
- Admin handler → Question access: manages questions (evidence: `controller/AdminPanel.php`)
- Admin handler → View renderer: renders panel (evidence: `controller/AdminPanel.php`)
- Administrator → Admin interface: manages questions (evidence: `README.MD`)
- Admin interface → Admin interaction: uses interactions
- Question access → MySQL database: queries questions (evidence: `dao/QuestionDao.php`)
- Question access → Question model: reads and writes (evidence: `dao/QuestionDao.php`)
- Quiz lookup → MySQL database: queries quiz (evidence: `dao/QuizDao.php`)
- User access → MySQL database: queries users (evidence: `dao/UserDao.php`)
- User access → User model: reads user (evidence: `dao/UserDao.php`)
- MySQL database → Environment config: reads connection settings
