# flatmarstheory/wi-fi-intrusion-detection-system architecture

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

- Interactive diagram: https://gitdiagram.com/flatmarstheory/wi-fi-intrusion-detection-system
- Repository: https://github.com/flatmarstheory/wi-fi-intrusion-detection-system

## Overview

The repository is a single-file MicroPython Wi-Fi intrusion detector for the Pico W. Its workflow connects to Wi-Fi, periodically scans nearby networks, evaluates scan results for anomalies, and serves channel activity and alerts to a browser dashboard. The README also describes these capabilities; all implementation paths point to main.py because the tree contains no separate source modules.

Main entry points: [`main.py`](https://github.com/flatmarstheory/wi-fi-intrusion-detection-system/blob/main/main.py) (HTTP routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_detection["RF Detection"]
  node_scan["Environment scan<br/>[main.py]"]
  node_analysis["Anomaly analysis<br/>[main.py]"]
  node_baseline["RSSI baseline<br/>[main.py]"]
  node_alerts["Alert log<br/>[main.py]"]
end

subgraph group_web["Web Service"]
  node_server["Socket server<br/>[main.py]"]
  node_routes["HTTP routes<br/>[main.py]"]
  node_scanfeed["Scan JSON feed<br/>[main.py]"]
  node_alertfeed["Alerts JSON feed<br/>[main.py]"]
end

subgraph group_dashboard["Dashboard"]
  node_html["Dashboard HTML<br/>[main.py]"]
end

node_operator(("Dashboard user"))
node_wlan["Wi-Fi radio"]
node_browser["Web browser"]

node_scan -->|"scans networks"| node_wlan
node_scan -->|"passes results"| node_analysis
node_analysis -->|"reads and updates"| node_baseline
node_analysis -->|"logs anomalies"| node_alerts
node_server -->|"runs periodically"| node_scan
node_server -->|"dispatches requests"| node_routes
node_routes -->|"serves scan data"| node_scanfeed
node_routes -->|"serves alerts"| node_alertfeed
node_routes -->|"serves page"| node_html
node_scanfeed -->|"returns JSON"| node_browser
node_alertfeed -->|"reads log"| node_alerts
node_alertfeed -->|"returns JSON"| node_browser
node_browser -->|"displays telemetry"| node_operator
node_operator -->|"opens dashboard"| node_browser
node_browser -->|"fetches feeds"| node_routes
node_html -->|"renders dashboard"| node_browser

click node_scan "https://github.com/flatmarstheory/wi-fi-intrusion-detection-system/blob/main/main.py"
click node_analysis "https://github.com/flatmarstheory/wi-fi-intrusion-detection-system/blob/main/main.py"
click node_baseline "https://github.com/flatmarstheory/wi-fi-intrusion-detection-system/blob/main/main.py"
click node_alerts "https://github.com/flatmarstheory/wi-fi-intrusion-detection-system/blob/main/main.py"
click node_server "https://github.com/flatmarstheory/wi-fi-intrusion-detection-system/blob/main/main.py"
click node_routes "https://github.com/flatmarstheory/wi-fi-intrusion-detection-system/blob/main/main.py"
click node_scanfeed "https://github.com/flatmarstheory/wi-fi-intrusion-detection-system/blob/main/main.py"
click node_alertfeed "https://github.com/flatmarstheory/wi-fi-intrusion-detection-system/blob/main/main.py"
click node_html "https://github.com/flatmarstheory/wi-fi-intrusion-detection-system/blob/main/main.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_scan,node_analysis,node_baseline,node_alerts,node_operator,node_browser toneBlue
class node_server,node_routes,node_scanfeed,node_alertfeed toneAmber
class node_html toneMint
class node_wlan toneIndigo
```

## Components

### RF Detection

- [Environment scan](https://github.com/flatmarstheory/wi-fi-intrusion-detection-system/blob/main/main.py): `main.py`
- [Anomaly analysis](https://github.com/flatmarstheory/wi-fi-intrusion-detection-system/blob/main/main.py): `main.py`
- [RSSI baseline](https://github.com/flatmarstheory/wi-fi-intrusion-detection-system/blob/main/main.py): `main.py`
- [Alert log](https://github.com/flatmarstheory/wi-fi-intrusion-detection-system/blob/main/main.py): `main.py`

### Web Service

- [Socket server](https://github.com/flatmarstheory/wi-fi-intrusion-detection-system/blob/main/main.py): `main.py`
- [HTTP routes](https://github.com/flatmarstheory/wi-fi-intrusion-detection-system/blob/main/main.py): `main.py`
- [Scan JSON feed](https://github.com/flatmarstheory/wi-fi-intrusion-detection-system/blob/main/main.py): `main.py`
- [Alerts JSON feed](https://github.com/flatmarstheory/wi-fi-intrusion-detection-system/blob/main/main.py): `main.py`

### Dashboard

- [Dashboard HTML](https://github.com/flatmarstheory/wi-fi-intrusion-detection-system/blob/main/main.py): `main.py`

### Other components

- **Dashboard user**
- **Wi-Fi radio**
- **Web browser**

## Connections

- Environment scan → Wi-Fi radio: scans networks
- Environment scan → Anomaly analysis: passes results
- Anomaly analysis → RSSI baseline: reads and updates
- Anomaly analysis → Alert log: logs anomalies
- Socket server → Environment scan: runs periodically
- Socket server → HTTP routes: dispatches requests
- HTTP routes → Scan JSON feed: serves scan data
- HTTP routes → Alerts JSON feed: serves alerts
- HTTP routes → Dashboard HTML: serves page
- Scan JSON feed → Web browser: returns JSON
- Alerts JSON feed → Alert log: reads log
- Alerts JSON feed → Web browser: returns JSON
- Web browser → Dashboard user: displays telemetry
- Dashboard user → Web browser: opens dashboard
- Web browser → HTTP routes: fetches feeds
- Dashboard HTML → Web browser: renders dashboard
