# guilletacacho/preguntados-pwii architecture

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

- Interactive diagram: https://gitdiagram.com/guilletacacho/preguntados-pwii
- Repository: https://github.com/guilletacacho/preguntados-pwii

## Overview

Preguntados is a PHP/MySQL trivia site. Players register or sign in, play timed category-based question rounds, and can review results, suggest questions, or report errors; moderators process suggestions and reports and manage questions/categories, while administrators manage accounts and review statistics and administrative history. The graph separates these domain stages and the MVC, routing, and persistence layers. Some capabilities are documented but their implementation was not sampled, so those links are dashed; the README also references SQL and configuration files absent from the supplied tree.

Main entry points: [`app/Configuration.php`](https://github.com/guilletacacho/preguntados-pwii/blob/main/app/Configuration.php) (Controller factory), [`helper/MyDatabase.php`](https://github.com/guilletacacho/preguntados-pwii/blob/main/helper/MyDatabase.php) (MySQL database), [`app/controller/ModeradorPreguntasController.php`](https://github.com/guilletacacho/preguntados-pwii/blob/main/app/controller/ModeradorPreguntasController.php) (Question and category management), [`app/controller/PartidaController.php`](https://github.com/guilletacacho/preguntados-pwii/blob/main/app/controller/PartidaController.php) (Timed gameplay)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime"]
  node_router["Request router<br/>[Router.php]"]
  node_config["Controller factory<br/>[Configuration.php]"]
end

subgraph group_player["Player experience"]
  node_login["Login"]
  node_registration["Registration"]
  node_email["Email verification"]
  node_home["Home and curiosities<br/>[HomeController.php]"]
  node_game["Timed gameplay"]
  node_difficulty["Adaptive difficulty<br/>[Dificultad.php]"]
  node_results["Rankings"]
  node_profile["Player profile"]
  node_presence["Presence"]
  node_suggest["Question suggestions"]
end

subgraph group_moderation["Moderation"]
  node_moderator["Question and category management"]
  node_reports["Question reports"]
  node_suggestions["Suggestion review"]
end

subgraph group_admin["Administration"]
  node_admin["Accounts and statistics"]
end

subgraph group_infra["Application services"]
  node_db[("MySQL database<br/>[MyDatabase.php]")]
  node_render["Template rendering<br/>[MustacheRender.php]"]
  node_mail["SMTP mail<br/>[MailHelper.php]"]
  node_smtp[("SMTP service")]
end

node_visitor(("Site user"))

node_visitor -.->|"sends requests"| node_router
node_router -->|"resolves controller"| node_config
node_config -->|"constructs"| node_login
node_config -->|"constructs"| node_registration
node_config -->|"constructs"| node_email
node_config -->|"constructs"| node_home
node_config -->|"constructs"| node_game
node_config -->|"constructs"| node_results
node_config -->|"constructs"| node_moderator
node_config -->|"constructs"| node_reports
node_config -->|"constructs"| node_suggestions
node_config -->|"constructs"| node_admin
node_config -->|"creates connection"| node_db
node_config -->|"creates renderer"| node_render
node_registration -->|"uses mailer"| node_mail
node_mail -.->|"sends messages"| node_smtp
node_game -->|"uses rules"| node_difficulty
node_router -->|"closes active game"| node_game
node_suggest -.->|"stores suggestions"| node_suggestions
node_moderator -.->|"reviews suggestions"| node_suggestions
node_moderator -.->|"manages reports"| node_reports
node_login -.->|"reads credentials"| node_db
node_registration -.->|"stores account"| node_db
node_game -.->|"stores game data"| node_db
node_results -.->|"reads rankings"| node_db
node_profile -.->|"reads profile"| node_db
node_presence -.->|"updates presence"| node_db
node_moderator -.->|"updates questions"| node_db
node_reports -.->|"updates reports"| node_db
node_admin -.->|"manages accounts"| node_db

click node_router "https://github.com/guilletacacho/preguntados-pwii/blob/main/helper/Router.php"
click node_config "https://github.com/guilletacacho/preguntados-pwii/blob/main/app/Configuration.php"
click node_login "https://github.com/guilletacacho/preguntados-pwii/blob/main/app/controller/LoginController.php"
click node_registration "https://github.com/guilletacacho/preguntados-pwii/blob/main/app/controller/RegistroController.php"
click node_email "https://github.com/guilletacacho/preguntados-pwii/blob/main/app/controller/EmailController.php"
click node_home "https://github.com/guilletacacho/preguntados-pwii/blob/main/app/controller/HomeController.php"
click node_game "https://github.com/guilletacacho/preguntados-pwii/blob/main/app/controller/PartidaController.php"
click node_difficulty "https://github.com/guilletacacho/preguntados-pwii/blob/main/helper/Dificultad.php"
click node_results "https://github.com/guilletacacho/preguntados-pwii/blob/main/app/controller/RankingController.php"
click node_profile "https://github.com/guilletacacho/preguntados-pwii/blob/main/app/controller/PerfilController.php"
click node_presence "https://github.com/guilletacacho/preguntados-pwii/blob/main/app/controller/PresenceController.php"
click node_suggest "https://github.com/guilletacacho/preguntados-pwii/blob/main/app/model/SugerenciaModel.php"
click node_moderator "https://github.com/guilletacacho/preguntados-pwii/blob/main/app/controller/ModeradorPreguntasController.php"
click node_reports "https://github.com/guilletacacho/preguntados-pwii/blob/main/app/controller/ModeradorReportesController.php"
click node_suggestions "https://github.com/guilletacacho/preguntados-pwii/blob/main/app/controller/ModeradorSugerenciasController.php"
click node_admin "https://github.com/guilletacacho/preguntados-pwii/blob/main/app/controller/AdminController.php"
click node_db "https://github.com/guilletacacho/preguntados-pwii/blob/main/helper/MyDatabase.php"
click node_render "https://github.com/guilletacacho/preguntados-pwii/blob/main/helper/MustacheRender.php"
click node_mail "https://github.com/guilletacacho/preguntados-pwii/blob/main/helper/MailHelper.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_config,node_visitor toneBlue
class node_login,node_registration,node_email,node_home,node_game,node_difficulty,node_results,node_profile,node_presence,node_suggest toneAmber
class node_moderator,node_reports,node_suggestions toneMint
class node_admin toneRose
class node_db,node_render,node_mail,node_smtp toneIndigo
```

## Components

### Runtime

- [Request router](https://github.com/guilletacacho/preguntados-pwii/blob/main/helper/Router.php): `helper/Router.php`
- [Controller factory](https://github.com/guilletacacho/preguntados-pwii/blob/main/app/Configuration.php): `app/Configuration.php`

### Player experience

- [Login](https://github.com/guilletacacho/preguntados-pwii/blob/main/app/controller/LoginController.php): `app/controller/LoginController.php`
- [Registration](https://github.com/guilletacacho/preguntados-pwii/blob/main/app/controller/RegistroController.php): `app/controller/RegistroController.php`
- [Email verification](https://github.com/guilletacacho/preguntados-pwii/blob/main/app/controller/EmailController.php): `app/controller/EmailController.php`
- [Home and curiosities](https://github.com/guilletacacho/preguntados-pwii/blob/main/app/controller/HomeController.php): `app/controller/HomeController.php`
- [Timed gameplay](https://github.com/guilletacacho/preguntados-pwii/blob/main/app/controller/PartidaController.php): `app/controller/PartidaController.php`
- [Adaptive difficulty](https://github.com/guilletacacho/preguntados-pwii/blob/main/helper/Dificultad.php): `helper/Dificultad.php`
- [Rankings](https://github.com/guilletacacho/preguntados-pwii/blob/main/app/controller/RankingController.php): `app/controller/RankingController.php`
- [Player profile](https://github.com/guilletacacho/preguntados-pwii/blob/main/app/controller/PerfilController.php): `app/controller/PerfilController.php`
- [Presence](https://github.com/guilletacacho/preguntados-pwii/blob/main/app/controller/PresenceController.php): `app/controller/PresenceController.php`
- [Question suggestions](https://github.com/guilletacacho/preguntados-pwii/blob/main/app/model/SugerenciaModel.php): `app/model/SugerenciaModel.php`

### Moderation

- [Question and category management](https://github.com/guilletacacho/preguntados-pwii/blob/main/app/controller/ModeradorPreguntasController.php): `app/controller/ModeradorPreguntasController.php`
- [Question reports](https://github.com/guilletacacho/preguntados-pwii/blob/main/app/controller/ModeradorReportesController.php): `app/controller/ModeradorReportesController.php`
- [Suggestion review](https://github.com/guilletacacho/preguntados-pwii/blob/main/app/controller/ModeradorSugerenciasController.php): `app/controller/ModeradorSugerenciasController.php`

### Administration

- [Accounts and statistics](https://github.com/guilletacacho/preguntados-pwii/blob/main/app/controller/AdminController.php): `app/controller/AdminController.php`

### Application services

- [MySQL database](https://github.com/guilletacacho/preguntados-pwii/blob/main/helper/MyDatabase.php): `helper/MyDatabase.php`
- [Template rendering](https://github.com/guilletacacho/preguntados-pwii/blob/main/helper/MustacheRender.php): `helper/MustacheRender.php`
- [SMTP mail](https://github.com/guilletacacho/preguntados-pwii/blob/main/helper/MailHelper.php): `helper/MailHelper.php`
- **SMTP service**

### Other components

- **Site user**

## Connections

- Site user → Request router: sends requests
- Request router → Controller factory: resolves controller (evidence: `helper/Router.php`)
- Controller factory → Login: constructs (evidence: `app/Configuration.php`)
- Controller factory → Registration: constructs (evidence: `app/Configuration.php`)
- Controller factory → Email verification: constructs (evidence: `app/Configuration.php`)
- Controller factory → Home and curiosities: constructs (evidence: `app/Configuration.php`)
- Controller factory → Timed gameplay: constructs (evidence: `app/Configuration.php`)
- Controller factory → Rankings: constructs (evidence: `app/Configuration.php`)
- Controller factory → Question and category management: constructs (evidence: `app/Configuration.php`)
- Controller factory → Question reports: constructs (evidence: `app/Configuration.php`)
- Controller factory → Suggestion review: constructs (evidence: `app/Configuration.php`)
- Controller factory → Accounts and statistics: constructs (evidence: `app/Configuration.php`)
- Controller factory → MySQL database: creates connection (evidence: `app/Configuration.php`)
- Controller factory → Template rendering: creates renderer (evidence: `app/Configuration.php`)
- Registration → SMTP mail: uses mailer (evidence: `app/Configuration.php`)
- SMTP mail → SMTP service: sends messages
- Timed gameplay → Adaptive difficulty: uses rules (evidence: `app/controller/PartidaController.php`)
- Request router → Timed gameplay: closes active game (evidence: `helper/Router.php`)
- Question suggestions → Suggestion review: stores suggestions
- Question and category management → Suggestion review: reviews suggestions
- Question and category management → Question reports: manages reports
- Login → MySQL database: reads credentials
- Registration → MySQL database: stores account
- Timed gameplay → MySQL database: stores game data
- Rankings → MySQL database: reads rankings
- Player profile → MySQL database: reads profile
- Presence → MySQL database: updates presence
- Question and category management → MySQL database: updates questions
- Question reports → MySQL database: updates reports
- Accounts and statistics → MySQL database: manages accounts
