# ixchelchvz/escape-room architecture

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

- Interactive diagram: https://gitdiagram.com/ixchelchvz/escape-room
- Repository: https://github.com/ixchelchvz/escape-room

## Overview

HERACLES.EXE is a Flask-backed digital escape room: a team identifies itself, explores a map and completes twelve browser minigames, submits progress for server validation, and enters the assembled password to restore the site. The backend tracks team sessions and results; an administrator can monitor teams and grant trials. The README documents additional QR/oracle, leaderboard, and restored-site features. Some frontend and backend files were not excerpted, so their documented capabilities are included, while unsupported internal call paths are omitted.

Main entry points: [`heracles/blueprints/api.py`](https://github.com/ixchelchvz/escape-room/blob/main/heracles/blueprints/api.py) (Gameplay API), [`heracles/blueprints/main.py`](https://github.com/ixchelchvz/escape-room/blob/main/heracles/blueprints/main.py) (Page routes), [`static/js/main.js`](https://github.com/ixchelchvz/escape-room/blob/main/static/js/main.js) (Map and progress UI), [`heracles/models.py`](https://github.com/ixchelchvz/escape-room/blob/main/heracles/models.py) (Game data models)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Player experience"]
  node_landing["Broken landing<br/>[index.html]"]
  node_intro["Terminal intro<br/>[terminalIntro.js]"]
  node_team_login["Team identification<br/>[login.html]"]
  node_map_ui["Map and progress UI<br/>[main.js]"]
  node_restored["Restored site<br/>[webRestaurada.html]"]
  node_search["Restored-site search<br/>[webRestaurada_2.js]"]
end

subgraph group_gameplay["Trials and progression"]
  node_trial_ui["Trial minigames<br/>[juegos.js]"]
  node_trial_catalog["Trial definitions<br/>[game_data.py]"]
  node_oracle["Hesperides oracle<br/>[oraculo.html]"]
end

subgraph group_backend["Backend and persistence"]
  node_api["Gameplay API<br/>[api.py]"]
  node_views["Page routes<br/>[main.py]"]
  node_services["Shared queries<br/>[services.py]"]
  node_models["Game data models<br/>[models.py]"]
  node_database[("Game database")]
  node_config["Application configuration<br/>[config.py]"]
  node_app["Flask app setup<br/>[app.py]"]
end

subgraph group_operations["Administration"]
  node_admin_panel["Admin panel<br/>[admin.py]"]
  node_qr["Oracle QR<br/>[admin_qr.html]"]
end

node_player(("Player team"))
node_admin_user(("Administrator"))

node_player -->|"opens"| node_landing
node_landing -->|"starts intro"| node_intro
node_player -->|"identifies team"| node_team_login
node_team_login -->|"registers or selects"| node_api
node_player -->|"plays map"| node_map_ui
node_map_ui -->|"opens trial"| node_trial_ui
node_trial_ui -->|"reports completion"| node_map_ui
node_map_ui -->|"validates and syncs"| node_api
node_api -->|"checks answers"| node_trial_catalog
node_api -->|"updates progress"| node_models
node_models -->|"persists records"| node_database
node_views -->|"loads trials and podium"| node_services
node_services -->|"queries teams and trials"| node_models
node_views -->|"loads team state"| node_models
node_map_ui -->|"verifies final password"| node_api
node_api -->|"enables victory view"| node_restored
node_views -->|"renders restored page"| node_restored
node_restored -->|"shows leaderboard"| node_services
node_restored -->|"uses search"| node_search
node_admin_user -->|"manages teams"| node_admin_panel
node_admin_panel -->|"grants or resets trials"| node_models
node_admin_panel -->|"generates QR"| node_qr
node_qr -->|"opens token page"| node_oracle
node_views -->|"renders oracle"| node_oracle
node_app -->|"loads settings"| node_config
node_app -->|"registers routes"| node_views
node_app -->|"registers routes"| node_api
node_app -->|"registers routes"| node_admin_panel

click node_landing "https://github.com/ixchelchvz/escape-room/blob/main/templates/index.html"
click node_intro "https://github.com/ixchelchvz/escape-room/blob/main/static/js/terminalIntro.js"
click node_team_login "https://github.com/ixchelchvz/escape-room/blob/main/templates/login.html"
click node_map_ui "https://github.com/ixchelchvz/escape-room/blob/main/static/js/main.js"
click node_trial_ui "https://github.com/ixchelchvz/escape-room/blob/main/static/js/juegos.js"
click node_trial_catalog "https://github.com/ixchelchvz/escape-room/blob/main/heracles/game_data.py"
click node_api "https://github.com/ixchelchvz/escape-room/blob/main/heracles/blueprints/api.py"
click node_views "https://github.com/ixchelchvz/escape-room/blob/main/heracles/blueprints/main.py"
click node_services "https://github.com/ixchelchvz/escape-room/blob/main/heracles/services.py"
click node_models "https://github.com/ixchelchvz/escape-room/blob/main/heracles/models.py"
click node_restored "https://github.com/ixchelchvz/escape-room/blob/main/templates/webRestaurada.html"
click node_search "https://github.com/ixchelchvz/escape-room/blob/main/static/js/webRestaurada_2.js"
click node_oracle "https://github.com/ixchelchvz/escape-room/blob/main/templates/oraculo.html"
click node_admin_panel "https://github.com/ixchelchvz/escape-room/blob/main/heracles/blueprints/admin.py"
click node_qr "https://github.com/ixchelchvz/escape-room/blob/main/templates/admin_qr.html"
click node_config "https://github.com/ixchelchvz/escape-room/blob/main/heracles/config.py"
click node_app "https://github.com/ixchelchvz/escape-room/blob/main/app.py"

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_intro,node_team_login,node_map_ui,node_restored,node_search toneBlue
class node_trial_ui,node_trial_catalog,node_oracle toneAmber
class node_api,node_views,node_services,node_models,node_database,node_config,node_app toneMint
class node_admin_panel,node_qr toneRose
class node_player,node_admin_user toneIndigo
```

## Components

### Player experience

- [Broken landing](https://github.com/ixchelchvz/escape-room/blob/main/templates/index.html): `templates/index.html`
- [Terminal intro](https://github.com/ixchelchvz/escape-room/blob/main/static/js/terminalIntro.js): `static/js/terminalIntro.js`
- [Team identification](https://github.com/ixchelchvz/escape-room/blob/main/templates/login.html): `templates/login.html`
- [Map and progress UI](https://github.com/ixchelchvz/escape-room/blob/main/static/js/main.js): `static/js/main.js`
- [Restored site](https://github.com/ixchelchvz/escape-room/blob/main/templates/webRestaurada.html): `templates/webRestaurada.html`
- [Restored-site search](https://github.com/ixchelchvz/escape-room/blob/main/static/js/webRestaurada_2.js): `static/js/webRestaurada_2.js`

### Trials and progression

- [Trial minigames](https://github.com/ixchelchvz/escape-room/blob/main/static/js/juegos.js): `static/js/juegos.js`
- [Trial definitions](https://github.com/ixchelchvz/escape-room/blob/main/heracles/game_data.py): `heracles/game_data.py`
- [Hesperides oracle](https://github.com/ixchelchvz/escape-room/blob/main/templates/oraculo.html): `templates/oraculo.html`

### Backend and persistence

- [Gameplay API](https://github.com/ixchelchvz/escape-room/blob/main/heracles/blueprints/api.py): `heracles/blueprints/api.py`
- [Page routes](https://github.com/ixchelchvz/escape-room/blob/main/heracles/blueprints/main.py): `heracles/blueprints/main.py`
- [Shared queries](https://github.com/ixchelchvz/escape-room/blob/main/heracles/services.py): `heracles/services.py`
- [Game data models](https://github.com/ixchelchvz/escape-room/blob/main/heracles/models.py): `heracles/models.py`
- **Game database**
- [Application configuration](https://github.com/ixchelchvz/escape-room/blob/main/heracles/config.py): `heracles/config.py`
- [Flask app setup](https://github.com/ixchelchvz/escape-room/blob/main/app.py): `app.py`

### Administration

- [Admin panel](https://github.com/ixchelchvz/escape-room/blob/main/heracles/blueprints/admin.py): `heracles/blueprints/admin.py`
- [Oracle QR](https://github.com/ixchelchvz/escape-room/blob/main/templates/admin_qr.html): `templates/admin_qr.html`

### Other components

- **Player team**
- **Administrator**

## Connections

- Player team → Broken landing: opens (evidence: `README.md`)
- Broken landing → Terminal intro: starts intro (evidence: `README.md`)
- Player team → Team identification: identifies team (evidence: `README.md`)
- Team identification → Gameplay API: registers or selects (evidence: `README.md`)
- Player team → Map and progress UI: plays map (evidence: `README.md`)
- Map and progress UI → Trial minigames: opens trial (evidence: `static/js/main.js`)
- Trial minigames → Map and progress UI: reports completion (evidence: `README.md`)
- Map and progress UI → Gameplay API: validates and syncs (evidence: `static/js/main.js`)
- Gameplay API → Trial definitions: checks answers (evidence: `heracles/blueprints/api.py`)
- Gameplay API → Game data models: updates progress (evidence: `heracles/blueprints/api.py`)
- Game data models → Game database: persists records (evidence: `README.md`)
- Page routes → Shared queries: loads trials and podium (evidence: `heracles/blueprints/main.py`)
- Shared queries → Game data models: queries teams and trials (evidence: `heracles/services.py`)
- Page routes → Game data models: loads team state (evidence: `heracles/blueprints/main.py`)
- Map and progress UI → Gameplay API: verifies final password (evidence: `README.md`)
- Gameplay API → Restored site: enables victory view (evidence: `README.md`)
- Page routes → Restored site: renders restored page (evidence: `heracles/blueprints/main.py`)
- Restored site → Shared queries: shows leaderboard
- Restored site → Restored-site search: uses search (evidence: `README.md`)
- Administrator → Admin panel: manages teams (evidence: `README.md`)
- Admin panel → Game data models: grants or resets trials (evidence: `heracles/blueprints/admin.py`)
- Admin panel → Oracle QR: generates QR (evidence: `heracles/blueprints/admin.py`)
- Oracle QR → Hesperides oracle: opens token page (evidence: `README.md`)
- Page routes → Hesperides oracle: renders oracle (evidence: `heracles/blueprints/main.py`)
- Flask app setup → Application configuration: loads settings (evidence: `app.py`)
- Flask app setup → Page routes: registers routes (evidence: `app.py`)
- Flask app setup → Gameplay API: registers routes (evidence: `app.py`)
- Flask app setup → Admin panel: registers routes (evidence: `app.py`)
