# stvnm-58/winnie_the_pooh architecture

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

- Interactive diagram: https://gitdiagram.com/stvnm-58/winnie_the_pooh
- Repository: https://github.com/stvnm-58/winnie_the_pooh

## Overview

Winnie the Pooh is an SSH honeypot with a web dashboard. The primary workflow is an unauthorized SSH connection being recorded, optionally handled in a fake shell, stored for later review, and surfaced through dashboard views. The dashboard also exposes session replay, honeypot-port management, and firewall controls. Source excerpts show the SSH-to-storage and shell-to-storage calls; the README documents SQLite persistence and host-firewall actions. Some UI-to-API links are visible only as HTTP requests, so those edges are marked unverified.

Main entry points: [`server/src/web_app.py`](https://github.com/stvnm-58/winnie_the_pooh/blob/main/server/src/web_app.py) (Web API), [`server/src/honeypot.py`](https://github.com/stvnm-58/winnie_the_pooh/blob/main/server/src/honeypot.py) (SSH listener), [`client/src/App.jsx`](https://github.com/stvnm-58/winnie_the_pooh/blob/main/client/src/App.jsx) (App routing), [`server/src/database.py`](https://github.com/stvnm-58/winnie_the_pooh/blob/main/server/src/database.py) (Event database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["SSH capture"]
  node_listener["SSH listener<br/>[honeypot.py]"]
  node_shell["Fake shell<br/>[fake_shell.py]"]
  node_geo["Geo lookup<br/>[utils.py]"]
end

subgraph group_storage["Event storage"]
  node_event_db[("Event database<br/>[database.py]")]
  node_archive_db[("Archive database<br/>[archive.db]")]
end

subgraph group_backend["Management API"]
  node_api["Web API<br/>[web_app.py]"]
  node_config["Runtime config<br/>[config.json]"]
end

subgraph group_interface["Dashboard"]
  node_app["App routing<br/>[App.jsx]"]
  node_dashboard["Attack dashboard<br/>[Dashboard.jsx]"]
  node_replay["Session replay<br/>[SessionReplay.jsx]"]
  node_mesh["Honeypot manager<br/>[MeshManager.jsx]"]
  node_firewall["Firewall manager"]
end

node_attacker(("SSH client"))
node_geo_service["GeoIP service"]
node_host_firewall["Host firewall"]
node_browser(("Dashboard user"))

node_attacker -->|"connects"| node_listener
node_listener -->|"records attacks"| node_event_db
node_listener -->|"starts shell"| node_shell
node_shell -->|"logs commands"| node_event_db
node_listener -->|"resolves country"| node_geo
node_geo -->|"queries"| node_geo_service
node_listener -->|"archives events"| node_event_db
node_event_db -->|"moves old records"| node_archive_db
node_api -->|"reads events"| node_event_db
node_api -->|"reads port"| node_config
node_api -.->|"updates rules"| node_host_firewall
node_browser -->|"opens dashboard"| node_app
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_replay
node_app -->|"routes to"| node_mesh
node_app -->|"routes to"| node_firewall
node_dashboard -.->|"fetches data"| node_api
node_mesh -.->|"manages ports"| node_api
node_firewall -.->|"requests bans"| node_api

click node_listener "https://github.com/stvnm-58/winnie_the_pooh/blob/main/server/src/honeypot.py"
click node_shell "https://github.com/stvnm-58/winnie_the_pooh/blob/main/server/src/fake_shell.py"
click node_geo "https://github.com/stvnm-58/winnie_the_pooh/blob/main/server/src/utils.py"
click node_event_db "https://github.com/stvnm-58/winnie_the_pooh/blob/main/server/src/database.py"
click node_archive_db "https://github.com/stvnm-58/winnie_the_pooh/blob/main/server/data/archive.db"
click node_api "https://github.com/stvnm-58/winnie_the_pooh/blob/main/server/src/web_app.py"
click node_config "https://github.com/stvnm-58/winnie_the_pooh/blob/main/server/data/config.json"
click node_app "https://github.com/stvnm-58/winnie_the_pooh/blob/main/client/src/App.jsx"
click node_dashboard "https://github.com/stvnm-58/winnie_the_pooh/blob/main/client/src/pages/Dashboard.jsx"
click node_replay "https://github.com/stvnm-58/winnie_the_pooh/blob/main/client/src/pages/SessionReplay.jsx"
click node_mesh "https://github.com/stvnm-58/winnie_the_pooh/blob/main/client/src/pages/MeshManager.jsx"
click node_firewall "https://github.com/stvnm-58/winnie_the_pooh/blob/main/client/src/pages/FirewallManager.jsx"

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_listener,node_shell,node_geo,node_attacker,node_browser toneBlue
class node_event_db,node_archive_db toneAmber
class node_api,node_config toneMint
class node_app,node_dashboard,node_replay,node_mesh,node_firewall toneRose
class node_geo_service,node_host_firewall toneIndigo
```

## Components

### SSH capture

- [SSH listener](https://github.com/stvnm-58/winnie_the_pooh/blob/main/server/src/honeypot.py): `server/src/honeypot.py`
- [Fake shell](https://github.com/stvnm-58/winnie_the_pooh/blob/main/server/src/fake_shell.py): `server/src/fake_shell.py`
- [Geo lookup](https://github.com/stvnm-58/winnie_the_pooh/blob/main/server/src/utils.py): `server/src/utils.py`

### Event storage

- [Event database](https://github.com/stvnm-58/winnie_the_pooh/blob/main/server/src/database.py): `server/src/database.py`
- [Archive database](https://github.com/stvnm-58/winnie_the_pooh/blob/main/server/data/archive.db): `server/data/archive.db`

### Management API

- [Web API](https://github.com/stvnm-58/winnie_the_pooh/blob/main/server/src/web_app.py): `server/src/web_app.py`
- [Runtime config](https://github.com/stvnm-58/winnie_the_pooh/blob/main/server/data/config.json): `server/data/config.json`

### Dashboard

- [App routing](https://github.com/stvnm-58/winnie_the_pooh/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Attack dashboard](https://github.com/stvnm-58/winnie_the_pooh/blob/main/client/src/pages/Dashboard.jsx): `client/src/pages/Dashboard.jsx`
- [Session replay](https://github.com/stvnm-58/winnie_the_pooh/blob/main/client/src/pages/SessionReplay.jsx): `client/src/pages/SessionReplay.jsx`
- [Honeypot manager](https://github.com/stvnm-58/winnie_the_pooh/blob/main/client/src/pages/MeshManager.jsx): `client/src/pages/MeshManager.jsx`
- [Firewall manager](https://github.com/stvnm-58/winnie_the_pooh/blob/main/client/src/pages/FirewallManager.jsx): `client/src/pages/FirewallManager.jsx`

### Other components

- **SSH client**
- **GeoIP service**
- **Host firewall**
- **Dashboard user**

## Connections

- SSH client → SSH listener: connects (evidence: `README.md`)
- SSH listener → Event database: records attacks (evidence: `server/src/honeypot.py`)
- SSH listener → Fake shell: starts shell (evidence: `server/src/honeypot.py`)
- Fake shell → Event database: logs commands (evidence: `server/src/fake_shell.py`)
- SSH listener → Geo lookup: resolves country (evidence: `server/src/honeypot.py`)
- Geo lookup → GeoIP service: queries (evidence: `server/src/utils.py`)
- SSH listener → Event database: archives events (evidence: `server/src/honeypot.py`)
- Event database → Archive database: moves old records (evidence: `server/src/database.py`)
- Web API → Event database: reads events (evidence: `server/src/web_app.py`)
- Web API → Runtime config: reads port (evidence: `server/src/web_app.py`)
- Web API → Host firewall: updates rules (evidence: `README.md`)
- Dashboard user → App routing: opens dashboard
- App routing → Attack dashboard: routes to (evidence: `client/src/App.jsx`)
- App routing → Session replay: routes to (evidence: `client/src/App.jsx`)
- App routing → Honeypot manager: routes to (evidence: `client/src/App.jsx`)
- App routing → Firewall manager: routes to (evidence: `client/src/App.jsx`)
- Attack dashboard → Web API: fetches data
- Honeypot manager → Web API: manages ports
- Firewall manager → Web API: requests bans
