# uzankhan/shadownet-cyber-lab architecture

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

- Interactive diagram: https://gitdiagram.com/uzankhan/shadownet-cyber-lab
- Repository: https://github.com/uzankhan/shadownet-cyber-lab

## Overview

ShadowNet is a local-only Flask security lab. A learner browses the challenge catalog and intentionally vulnerable banking-themed flows, uses hints, submits discovered flags, and checks session-oriented progress. The main runtime is concentrated in app.py; the README documents UI, SQLite, and seeding relationships, while excerpts show selected route behavior and browser-side flag submission. The challenge families are represented as a single exercise subsystem because their implementation is not separately sampled. Docker and other delivery machinery are omitted.

Main entry points: [`app.py`](https://github.com/uzankhan/shadownet-cyber-lab/blob/main/app.py) (Flask routes), [`scripts/seed_db.py`](https://github.com/uzankhan/shadownet-cyber-lab/blob/main/scripts/seed_db.py) (Seed data), [`static/js/app.js`](https://github.com/uzankhan/shadownet-cyber-lab/blob/main/static/js/app.js) (Browser glue), [`shadownet.db`](https://github.com/uzankhan/shadownet-cyber-lab/blob/main/shadownet.db) (SQLite lab state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_flask["Flask routes<br/>[app.py]"]
  node_pages["Jinja pages"]
  node_browser["Browser glue<br/>[app.js]"]
  node_styles["Shared styling<br/>[style.css]"]
end

subgraph group_lab["Challenge lab"]
  node_exercise["Vulnerable exercises<br/>[app.py]"]
  node_challenge_ui["Challenge interface<br/>[challenges.html]"]
  node_hints["Challenge hints<br/>[app.py]"]
end

subgraph group_learning["Learning progress"]
  node_flag_submit["Flag submission<br/>[app.py]"]
  node_progress["Session progress<br/>[app.py]"]
  node_attempts["Attempt tracking<br/>[app.py]"]
end

subgraph group_data["Lab data"]
  node_sqlite[("SQLite lab state<br/>[shadownet.db]")]
  node_seeder["Seed data<br/>[seed_db.py]"]
  node_vault["Challenge flags"]
end

node_learner(("Learner"))

node_learner -->|"browses and submits"| node_flask
node_flask -->|"renders"| node_pages
node_flask -->|"serves UI assets"| node_browser
node_flask -->|"serves UI assets"| node_styles
node_flask -->|"handles challenge routes"| node_exercise
node_flask -->|"reads and writes"| node_sqlite
node_flask -->|"provides hints"| node_hints
node_browser -->|"posts flag"| node_flag_submit
node_flask -->|"accepts submission"| node_flag_submit
node_flask -->|"tracks progress"| node_progress
node_flask -->|"records attempts"| node_attempts
node_seeder -->|"creates tables"| node_sqlite
node_seeder -->|"writes flags"| node_vault
node_challenge_ui -->|"requests hints"| node_hints

click node_flask "https://github.com/uzankhan/shadownet-cyber-lab/blob/main/app.py"
click node_pages "https://github.com/uzankhan/shadownet-cyber-lab/tree/main/templates"
click node_browser "https://github.com/uzankhan/shadownet-cyber-lab/blob/main/static/js/app.js"
click node_styles "https://github.com/uzankhan/shadownet-cyber-lab/blob/main/static/css/style.css"
click node_exercise "https://github.com/uzankhan/shadownet-cyber-lab/blob/main/app.py"
click node_challenge_ui "https://github.com/uzankhan/shadownet-cyber-lab/blob/main/templates/challenges.html"
click node_hints "https://github.com/uzankhan/shadownet-cyber-lab/blob/main/app.py"
click node_flag_submit "https://github.com/uzankhan/shadownet-cyber-lab/blob/main/app.py"
click node_progress "https://github.com/uzankhan/shadownet-cyber-lab/blob/main/app.py"
click node_attempts "https://github.com/uzankhan/shadownet-cyber-lab/blob/main/app.py"
click node_sqlite "https://github.com/uzankhan/shadownet-cyber-lab/blob/main/shadownet.db"
click node_seeder "https://github.com/uzankhan/shadownet-cyber-lab/blob/main/scripts/seed_db.py"
click node_vault "https://github.com/uzankhan/shadownet-cyber-lab/tree/main/vault/secret"

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_flask,node_pages,node_browser,node_styles toneBlue
class node_exercise,node_challenge_ui,node_hints toneAmber
class node_flag_submit,node_progress,node_attempts toneMint
class node_sqlite,node_seeder,node_vault toneRose
class node_learner toneIndigo
```

## Components

### Web experience

- [Flask routes](https://github.com/uzankhan/shadownet-cyber-lab/blob/main/app.py): `app.py`
- [Jinja pages](https://github.com/uzankhan/shadownet-cyber-lab/tree/main/templates): `templates`
- [Browser glue](https://github.com/uzankhan/shadownet-cyber-lab/blob/main/static/js/app.js): `static/js/app.js`
- [Shared styling](https://github.com/uzankhan/shadownet-cyber-lab/blob/main/static/css/style.css): `static/css/style.css`

### Challenge lab

- [Vulnerable exercises](https://github.com/uzankhan/shadownet-cyber-lab/blob/main/app.py): `app.py`
- [Challenge interface](https://github.com/uzankhan/shadownet-cyber-lab/blob/main/templates/challenges.html): `templates/challenges.html`
- [Challenge hints](https://github.com/uzankhan/shadownet-cyber-lab/blob/main/app.py): `app.py`

### Learning progress

- [Flag submission](https://github.com/uzankhan/shadownet-cyber-lab/blob/main/app.py): `app.py`
- [Session progress](https://github.com/uzankhan/shadownet-cyber-lab/blob/main/app.py): `app.py`
- [Attempt tracking](https://github.com/uzankhan/shadownet-cyber-lab/blob/main/app.py): `app.py`

### Lab data

- [SQLite lab state](https://github.com/uzankhan/shadownet-cyber-lab/blob/main/shadownet.db): `shadownet.db`
- [Seed data](https://github.com/uzankhan/shadownet-cyber-lab/blob/main/scripts/seed_db.py): `scripts/seed_db.py`
- [Challenge flags](https://github.com/uzankhan/shadownet-cyber-lab/tree/main/vault/secret): `vault/secret`

### Other components

- **Learner**

## Connections

- Learner → Flask routes: browses and submits (evidence: `README.md`)
- Flask routes → Jinja pages: renders (evidence: `README.md`)
- Flask routes → Browser glue: serves UI assets (evidence: `README.md`)
- Flask routes → Shared styling: serves UI assets (evidence: `README.md`)
- Flask routes → Vulnerable exercises: handles challenge routes (evidence: `README.md`)
- Flask routes → SQLite lab state: reads and writes (evidence: `README.md`)
- Flask routes → Challenge hints: provides hints (evidence: `README.md`)
- Browser glue → Flag submission: posts flag (evidence: `static/js/app.js`)
- Flask routes → Flag submission: accepts submission (evidence: `README.md`)
- Flask routes → Session progress: tracks progress (evidence: `app.py`)
- Flask routes → Attempt tracking: records attempts (evidence: `app.py`)
- Seed data → SQLite lab state: creates tables (evidence: `scripts/seed_db.py`)
- Seed data → Challenge flags: writes flags (evidence: `scripts/seed_db.py`)
- Challenge interface → Challenge hints: requests hints (evidence: `README.md`)
