# m0i6/decoy architecture

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

- Interactive diagram: https://gitdiagram.com/m0i6/decoy
- Repository: https://github.com/m0i6/decoy

## Overview

Decoy is a honeypot monitoring and incident-visualization dashboard. The main workflow is that a deployed honeypot observes attacker activity and reports incidents to the Flask API; the API stores honeypots and incidents, while the Vue dashboard fetches them to show a list, details, and severity-aware map. Users can also create honeypot records by selecting a map location and submitting a form. Source excerpts establish most frontend and API wiring; the README documents the honeypot alert workflow. Other honeypot internals and some frontend modules were not sampled, so uncertain links are omitted.

Main entry points: [`frontend/src/components/WorldMap.vue`](https://github.com/m0i6/decoy/blob/main/frontend/src/components/WorldMap.vue) (World map), [`frontend/src/router.ts`](https://github.com/m0i6/decoy/blob/main/frontend/src/router.ts) (Page routing), [`frontend/src/pages/Deployment.vue`](https://github.com/m0i6/decoy/blob/main/frontend/src/pages/Deployment.vue) (Honeypot form), [`backend/database/db.py`](https://github.com/m0i6/decoy/blob/main/backend/database/db.py) (ORM extension)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Dashboard"]
  node_frontend_app["Application shell<br/>[App.vue]"]
  node_router["Page routing<br/>[router.ts]"]
  node_home["Dashboard page<br/>[Home.vue]"]
  node_deployment["Honeypot form<br/>[Deployment.vue]"]
  node_about["About page<br/>[About.vue]"]
  node_navbar["Navigation bar<br/>[Navbar.vue]"]
  node_list["Honeypot list<br/>[HoneypotList.vue]"]
  node_details["Honeypot details"]
  node_map["World map<br/>[WorldMap.vue]"]
  node_api_client["API client<br/>[backendProxy.ts]"]
  node_config["API configuration<br/>[config.ts]"]
  node_types["Data types<br/>[types.ts]"]
end

subgraph group_api["Backend API"]
  node_flask_app["Flask application<br/>[main.py]"]
  node_honeypot_api["Honeypot routes<br/>[HoneyPotModel.py]"]
  node_incident_api["Incident routes"]
end

subgraph group_persistence["Persistence"]
  node_db_extension["ORM extension<br/>[db.py]"]
  node_honeypot_model["Honeypot records<br/>[HoneyPotModel.py]"]
  node_incident_model["Incident records"]
  node_sqlite[("SQLite database")]
  node_seed_data["Initial data setup<br/>[setup_database.py]"]
end

subgraph group_sensor["Honeypot"]
  node_pot["SSH honeypot<br/>[pot.py]"]
  node_probe["Probe utility<br/>[probe.py]"]
end

node_user(("Dashboard user"))
node_attacker(("Attacker"))
node_map_tiles["Map tile service"]

node_user -->|"navigates"| node_router
node_router -->|"routes to"| node_home
node_router -->|"routes to"| node_deployment
node_router -->|"routes to"| node_about
node_frontend_app -->|"renders"| node_navbar
node_frontend_app -->|"hosts routes"| node_router
node_home -->|"renders"| node_list
node_home -->|"renders"| node_map
node_home -->|"renders"| node_details
node_deployment -->|"renders"| node_map
node_deployment -->|"POSTs record"| node_honeypot_api
node_deployment -->|"reads URL"| node_config
node_map -->|"fetches honeypots"| node_api_client
node_map -->|"fetches incidents"| node_incident_api
node_map -->|"emits location"| node_deployment
node_map -->|"loads tiles"| node_map_tiles
node_api_client -->|"reads URL"| node_config
node_api_client -->|"uses types"| node_types
node_list -->|"fetches records"| node_api_client
node_flask_app -->|"initializes"| node_db_extension
node_flask_app -->|"registers routes"| node_incident_api
node_flask_app -->|"registers routes"| node_honeypot_api
node_honeypot_api -->|"queries and commits"| node_db_extension
node_incident_api -->|"queries and commits"| node_db_extension
node_db_extension -.->|"persists records"| node_sqlite
node_seed_data -->|"creates tables"| node_db_extension
node_seed_data -->|"seeds records"| node_honeypot_model
node_seed_data -->|"seeds records"| node_incident_model
node_attacker -->|"interacts with"| node_pot
node_pot -->|"sends alerts"| node_flask_app

click node_frontend_app "https://github.com/m0i6/decoy/blob/main/frontend/src/App.vue"
click node_router "https://github.com/m0i6/decoy/blob/main/frontend/src/router.ts"
click node_home "https://github.com/m0i6/decoy/blob/main/frontend/src/pages/Home.vue"
click node_deployment "https://github.com/m0i6/decoy/blob/main/frontend/src/pages/Deployment.vue"
click node_about "https://github.com/m0i6/decoy/blob/main/frontend/src/pages/About.vue"
click node_navbar "https://github.com/m0i6/decoy/blob/main/frontend/src/components/Navbar.vue"
click node_list "https://github.com/m0i6/decoy/blob/main/frontend/src/components/HoneypotList.vue"
click node_details "https://github.com/m0i6/decoy/blob/main/frontend/src/components/HoneypotDetails.vue"
click node_map "https://github.com/m0i6/decoy/blob/main/frontend/src/components/WorldMap.vue"
click node_api_client "https://github.com/m0i6/decoy/blob/main/frontend/src/backendProxy.ts"
click node_config "https://github.com/m0i6/decoy/blob/main/frontend/src/config.ts"
click node_types "https://github.com/m0i6/decoy/blob/main/frontend/src/types.ts"
click node_flask_app "https://github.com/m0i6/decoy/blob/main/backend/main.py"
click node_honeypot_api "https://github.com/m0i6/decoy/blob/main/backend/database/models/HoneyPotModel.py"
click node_incident_api "https://github.com/m0i6/decoy/blob/main/backend/database/models/IncidentLogModel.py"
click node_db_extension "https://github.com/m0i6/decoy/blob/main/backend/database/db.py"
click node_honeypot_model "https://github.com/m0i6/decoy/blob/main/backend/database/models/HoneyPotModel.py"
click node_incident_model "https://github.com/m0i6/decoy/blob/main/backend/database/models/IncidentLogModel.py"
click node_seed_data "https://github.com/m0i6/decoy/blob/main/backend/setup_database.py"
click node_pot "https://github.com/m0i6/decoy/blob/main/honeypot/pot.py"
click node_probe "https://github.com/m0i6/decoy/blob/main/honeypot/probe.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_frontend_app,node_router,node_home,node_deployment,node_about,node_navbar,node_list,node_details,node_map,node_api_client,node_config,node_types,node_user toneBlue
class node_flask_app,node_honeypot_api,node_incident_api toneAmber
class node_db_extension,node_honeypot_model,node_incident_model,node_sqlite,node_seed_data toneMint
class node_pot,node_probe toneRose
class node_attacker,node_map_tiles toneIndigo
```

## Components

### Dashboard

- [Application shell](https://github.com/m0i6/decoy/blob/main/frontend/src/App.vue): `frontend/src/App.vue`
- [Page routing](https://github.com/m0i6/decoy/blob/main/frontend/src/router.ts): `frontend/src/router.ts`
- [Dashboard page](https://github.com/m0i6/decoy/blob/main/frontend/src/pages/Home.vue): `frontend/src/pages/Home.vue`
- [Honeypot form](https://github.com/m0i6/decoy/blob/main/frontend/src/pages/Deployment.vue): `frontend/src/pages/Deployment.vue`
- [About page](https://github.com/m0i6/decoy/blob/main/frontend/src/pages/About.vue): `frontend/src/pages/About.vue`
- [Navigation bar](https://github.com/m0i6/decoy/blob/main/frontend/src/components/Navbar.vue): `frontend/src/components/Navbar.vue`
- [Honeypot list](https://github.com/m0i6/decoy/blob/main/frontend/src/components/HoneypotList.vue): `frontend/src/components/HoneypotList.vue`
- [Honeypot details](https://github.com/m0i6/decoy/blob/main/frontend/src/components/HoneypotDetails.vue): `frontend/src/components/HoneypotDetails.vue`
- [World map](https://github.com/m0i6/decoy/blob/main/frontend/src/components/WorldMap.vue): `frontend/src/components/WorldMap.vue`
- [API client](https://github.com/m0i6/decoy/blob/main/frontend/src/backendProxy.ts): `frontend/src/backendProxy.ts`
- [API configuration](https://github.com/m0i6/decoy/blob/main/frontend/src/config.ts): `frontend/src/config.ts`
- [Data types](https://github.com/m0i6/decoy/blob/main/frontend/src/types.ts): `frontend/src/types.ts`

### Backend API

- [Flask application](https://github.com/m0i6/decoy/blob/main/backend/main.py): `backend/main.py`
- [Honeypot routes](https://github.com/m0i6/decoy/blob/main/backend/database/models/HoneyPotModel.py): `backend/database/models/HoneyPotModel.py`
- [Incident routes](https://github.com/m0i6/decoy/blob/main/backend/database/models/IncidentLogModel.py): `backend/database/models/IncidentLogModel.py`

### Persistence

- [ORM extension](https://github.com/m0i6/decoy/blob/main/backend/database/db.py): `backend/database/db.py`
- [Honeypot records](https://github.com/m0i6/decoy/blob/main/backend/database/models/HoneyPotModel.py): `backend/database/models/HoneyPotModel.py`
- [Incident records](https://github.com/m0i6/decoy/blob/main/backend/database/models/IncidentLogModel.py): `backend/database/models/IncidentLogModel.py`
- **SQLite database**
- [Initial data setup](https://github.com/m0i6/decoy/blob/main/backend/setup_database.py): `backend/setup_database.py`

### Honeypot

- [SSH honeypot](https://github.com/m0i6/decoy/blob/main/honeypot/pot.py): `honeypot/pot.py`
- [Probe utility](https://github.com/m0i6/decoy/blob/main/honeypot/probe.py): `honeypot/probe.py`

### Other components

- **Dashboard user**
- **Attacker**
- **Map tile service**

## Connections

- Dashboard user → Page routing: navigates (evidence: `frontend/src/router.ts`)
- Page routing → Dashboard page: routes to (evidence: `frontend/src/router.ts`)
- Page routing → Honeypot form: routes to (evidence: `frontend/src/router.ts`)
- Page routing → About page: routes to (evidence: `frontend/src/router.ts`)
- Application shell → Navigation bar: renders (evidence: `frontend/src/App.vue`)
- Application shell → Page routing: hosts routes (evidence: `frontend/src/App.vue`)
- Dashboard page → Honeypot list: renders (evidence: `frontend/src/pages/Home.vue`)
- Dashboard page → World map: renders (evidence: `frontend/src/pages/Home.vue`)
- Dashboard page → Honeypot details: renders (evidence: `frontend/src/pages/Home.vue`)
- Honeypot form → World map: renders (evidence: `frontend/src/pages/Deployment.vue`)
- Honeypot form → Honeypot routes: POSTs record (evidence: `frontend/src/pages/Deployment.vue`)
- Honeypot form → API configuration: reads URL (evidence: `frontend/src/pages/Deployment.vue`)
- World map → API client: fetches honeypots (evidence: `frontend/src/components/WorldMap.vue`)
- World map → Incident routes: fetches incidents (evidence: `frontend/src/components/WorldMap.vue`)
- World map → Honeypot form: emits location (evidence: `frontend/src/components/WorldMap.vue`)
- World map → Map tile service: loads tiles (evidence: `frontend/src/components/WorldMap.vue`)
- API client → API configuration: reads URL (evidence: `frontend/src/backendProxy.ts`)
- API client → Data types: uses types (evidence: `frontend/src/backendProxy.ts`)
- Honeypot list → API client: fetches records (evidence: `frontend/src/components/HoneypotList.vue`)
- Flask application → ORM extension: initializes (evidence: `backend/main.py`)
- Flask application → Incident routes: registers routes (evidence: `backend/main.py`)
- Flask application → Honeypot routes: registers routes (evidence: `backend/main.py`)
- Honeypot routes → ORM extension: queries and commits (evidence: `backend/database/models/HoneyPotModel.py`)
- Incident routes → ORM extension: queries and commits (evidence: `backend/database/models/IncidentLogModel.py`)
- ORM extension → SQLite database: persists records
- Initial data setup → ORM extension: creates tables (evidence: `backend/setup_database.py`)
- Initial data setup → Honeypot records: seeds records (evidence: `backend/setup_database.py`)
- Initial data setup → Incident records: seeds records (evidence: `backend/setup_database.py`)
- Attacker → SSH honeypot: interacts with (evidence: `README.md`)
- SSH honeypot → Flask application: sends alerts (evidence: `README.md`)
