# sabbat-cloud/sabbat-cyberpunk-console architecture

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

- Interactive diagram: https://gitdiagram.com/sabbat-cloud/sabbat-cyberpunk-console
- Repository: https://github.com/sabbat-cloud/sabbat-cyberpunk-console

## Overview

This is a Flask-backed cyberpunk terminal whose main workflow is: a visitor opens the console, enters commands in the browser, and receives terminal output or an interactive mini-app. The frontend handles the shell, simulated filesystem, themes, localization, tools, and presentation; Flask serves the page and owns server-side APIs and session-backed games. Chess and nuclear-war simulation have separate engines. The README documents additional games and capabilities that are not fully represented in the sampled source; those are kept as documented frontend or integration branches, without inferring unsampled call paths.

Main entry points: [`static/js/script.js`](https://github.com/sabbat-cloud/sabbat-cyberpunk-console/blob/main/static/js/script.js) (Terminal shell), [`app.py`](https://github.com/sabbat-cloud/sabbat-cyberpunk-console/blob/main/app.py) (Flask application), [`templates/index.html`](https://github.com/sabbat-cloud/sabbat-cyberpunk-console/blob/main/templates/index.html) (Console page), [`PyTrek`](https://github.com/sabbat-cloud/sabbat-cyberpunk-console/tree/main/PyTrek) (PyTrek game)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_console["Terminal shell<br/>[script.js]"]
  node_page["Console page<br/>[index.html]"]
  node_filesystem["Virtual filesystem<br/>[script.js]"]
  node_themes_i18n["Themes and i18n<br/>[script.js]"]
  node_tools_toys["Terminal tools<br/>[script.js]"]
  node_adventure["Text adventure<br/>[script.js]"]
end

subgraph group_backend["Flask backend"]
  node_app["Flask application<br/>[app.py]"]
  node_chess_api["Chess API<br/>[app.py]"]
  node_nuclear_api["Nuclear API<br/>[app.py]"]
  node_security["Security controls<br/>[app.py]"]
end

subgraph group_games["Games and simulations"]
  node_firewall["Firewall game<br/>[app.py]"]
  node_pytrek["PyTrek game"]
  node_chess_engine["Chess engine<br/>[chess_engine.py]"]
  node_nuclear_engine["Nuclear simulator"]
end

subgraph group_utilities["Tools and integrations"]
  node_encryption["Encryption commands<br/>[app.py]"]
  node_weather["Weather lookup<br/>[app.py]"]
  node_weather_service["OpenWeatherMap"]
end

node_visitor(("Visitor"))

node_visitor -->|"opens"| node_page
node_page -->|"hosts"| node_console
node_console -->|"runs commands"| node_filesystem
node_console -->|"handles settings"| node_themes_i18n
node_console -->|"runs commands"| node_tools_toys
node_console -->|"launches"| node_adventure
node_page -->|"served by"| node_app
node_app -->|"routes requests"| node_chess_api
node_console -->|"posts moves"| node_chess_api
node_chess_api -->|"uses"| node_chess_engine
node_console -->|"plays"| node_firewall
node_console -->|"launches"| node_pytrek
node_app -->|"routes requests"| node_nuclear_api
node_console -->|"requests timeline"| node_nuclear_api
node_nuclear_api -->|"generates events"| node_nuclear_engine
node_console -->|"requests cipher"| node_encryption
node_console -->|"requests forecast"| node_weather
node_weather -->|"fetches weather"| node_weather_service
node_app -->|"configures controls"| node_security

click node_console "https://github.com/sabbat-cloud/sabbat-cyberpunk-console/blob/main/static/js/script.js"
click node_page "https://github.com/sabbat-cloud/sabbat-cyberpunk-console/blob/main/templates/index.html"
click node_filesystem "https://github.com/sabbat-cloud/sabbat-cyberpunk-console/blob/main/static/js/script.js"
click node_themes_i18n "https://github.com/sabbat-cloud/sabbat-cyberpunk-console/blob/main/static/js/script.js"
click node_tools_toys "https://github.com/sabbat-cloud/sabbat-cyberpunk-console/blob/main/static/js/script.js"
click node_adventure "https://github.com/sabbat-cloud/sabbat-cyberpunk-console/blob/main/static/js/script.js"
click node_app "https://github.com/sabbat-cloud/sabbat-cyberpunk-console/blob/main/app.py"
click node_chess_api "https://github.com/sabbat-cloud/sabbat-cyberpunk-console/blob/main/app.py"
click node_firewall "https://github.com/sabbat-cloud/sabbat-cyberpunk-console/blob/main/app.py"
click node_pytrek "https://github.com/sabbat-cloud/sabbat-cyberpunk-console/tree/main/PyTrek"
click node_chess_engine "https://github.com/sabbat-cloud/sabbat-cyberpunk-console/blob/main/chess_engine.py"
click node_nuclear_api "https://github.com/sabbat-cloud/sabbat-cyberpunk-console/blob/main/app.py"
click node_nuclear_engine "https://github.com/sabbat-cloud/sabbat-cyberpunk-console/blob/main/nuclearwar_engine.py"
click node_encryption "https://github.com/sabbat-cloud/sabbat-cyberpunk-console/blob/main/app.py"
click node_weather "https://github.com/sabbat-cloud/sabbat-cyberpunk-console/blob/main/app.py"
click node_security "https://github.com/sabbat-cloud/sabbat-cyberpunk-console/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_console,node_page,node_filesystem,node_themes_i18n,node_tools_toys,node_adventure toneBlue
class node_app,node_chess_api,node_nuclear_api,node_security toneAmber
class node_firewall,node_pytrek,node_chess_engine,node_nuclear_engine toneMint
class node_encryption,node_weather,node_weather_service toneRose
class node_visitor toneIndigo
```

## Components

### Web experience

- [Terminal shell](https://github.com/sabbat-cloud/sabbat-cyberpunk-console/blob/main/static/js/script.js): `static/js/script.js`
- [Console page](https://github.com/sabbat-cloud/sabbat-cyberpunk-console/blob/main/templates/index.html): `templates/index.html`
- [Virtual filesystem](https://github.com/sabbat-cloud/sabbat-cyberpunk-console/blob/main/static/js/script.js): `static/js/script.js`
- [Themes and i18n](https://github.com/sabbat-cloud/sabbat-cyberpunk-console/blob/main/static/js/script.js): `static/js/script.js`
- [Terminal tools](https://github.com/sabbat-cloud/sabbat-cyberpunk-console/blob/main/static/js/script.js): `static/js/script.js`
- [Text adventure](https://github.com/sabbat-cloud/sabbat-cyberpunk-console/blob/main/static/js/script.js): `static/js/script.js`

### Flask backend

- [Flask application](https://github.com/sabbat-cloud/sabbat-cyberpunk-console/blob/main/app.py): `app.py`
- [Chess API](https://github.com/sabbat-cloud/sabbat-cyberpunk-console/blob/main/app.py): `app.py`
- [Nuclear API](https://github.com/sabbat-cloud/sabbat-cyberpunk-console/blob/main/app.py): `app.py`
- [Security controls](https://github.com/sabbat-cloud/sabbat-cyberpunk-console/blob/main/app.py): `app.py`

### Games and simulations

- [Firewall game](https://github.com/sabbat-cloud/sabbat-cyberpunk-console/blob/main/app.py): `app.py`
- [PyTrek game](https://github.com/sabbat-cloud/sabbat-cyberpunk-console/tree/main/PyTrek): `PyTrek`
- [Chess engine](https://github.com/sabbat-cloud/sabbat-cyberpunk-console/blob/main/chess_engine.py): `chess_engine.py`
- [Nuclear simulator](https://github.com/sabbat-cloud/sabbat-cyberpunk-console/blob/main/nuclearwar_engine.py): `nuclearwar_engine.py`

### Tools and integrations

- [Encryption commands](https://github.com/sabbat-cloud/sabbat-cyberpunk-console/blob/main/app.py): `app.py`
- [Weather lookup](https://github.com/sabbat-cloud/sabbat-cyberpunk-console/blob/main/app.py): `app.py`
- **OpenWeatherMap**

### Other components

- **Visitor**

## Connections

- Visitor → Console page: opens (evidence: `README.md`)
- Console page → Terminal shell: hosts (evidence: `README.md`)
- Terminal shell → Virtual filesystem: runs commands (evidence: `README.md`)
- Terminal shell → Themes and i18n: handles settings (evidence: `README.md`)
- Terminal shell → Terminal tools: runs commands (evidence: `README.md`)
- Terminal shell → Text adventure: launches (evidence: `README.md`)
- Console page → Flask application: served by (evidence: `app.py`)
- Flask application → Chess API: routes requests (evidence: `app.py`)
- Terminal shell → Chess API: posts moves (evidence: `static/js/script.js`)
- Chess API → Chess engine: uses (evidence: `app.py`)
- Terminal shell → Firewall game: plays (evidence: `README.md`)
- Terminal shell → PyTrek game: launches (evidence: `README.md`)
- Flask application → Nuclear API: routes requests (evidence: `app.py`)
- Terminal shell → Nuclear API: requests timeline (evidence: `static/js/script.js`)
- Nuclear API → Nuclear simulator: generates events (evidence: `app.py`)
- Terminal shell → Encryption commands: requests cipher (evidence: `README.md`)
- Terminal shell → Weather lookup: requests forecast (evidence: `README.md`)
- Weather lookup → OpenWeatherMap: fetches weather (evidence: `app.py`)
- Flask application → Security controls: configures controls (evidence: `app.py`)
