# avaqen/strata architecture

> Architecture diagram of the GitHub repository avaqen/strata, 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/avaqen/strata
- Repository: https://github.com/avaqen/strata

## Overview

Strata is a local-first network-flow dashboard. Users load sample flows, import CSV records, or start Linux interface capture; the server analyzes flows and returns results for the browser’s overview, traffic, and anomaly views. The main stages are capture and flow aggregation, analysis and scoring, and dashboard presentation. The excerpts show the core API-to-sensor and API-to-analysis calls. Some routes and demo-data implementation are not fully excerpted, so those links are based on README documentation.

Main entry points: [`app.js`](https://github.com/avaqen/strata/blob/main/app.js) (Dashboard client), [`app.py`](https://github.com/avaqen/strata/blob/main/app.py) (HTTP API), [`sensor.py`](https://github.com/avaqen/strata/blob/main/sensor.py) (Capture control), [`index.html`](https://github.com/avaqen/strata/blob/main/index.html) (Dashboard views)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Dashboard"]
  node_browser["Dashboard client<br/>[app.js]"]
  node_views["Dashboard views<br/>[index.html]"]
  node_alerts["Alert table<br/>[app.js]"]
  node_traffic["Traffic analysis view<br/>[app.js]"]
  node_overview["Overview view<br/>[app.js]"]
  node_export["CSV export<br/>[app.js]"]
end

subgraph group_server["Analysis server"]
  node_api["HTTP API<br/>[app.py]"]
  node_demo["Sample flows<br/>[app.py]"]
  node_csv["CSV import<br/>[app.py]"]
end

subgraph group_capture["Live capture"]
  node_discovery["Interface discovery<br/>[sensor.py]"]
  node_lifecycle["Capture control<br/>[sensor.py]"]
  node_decoder["Packet decoder<br/>[sensor.py]"]
  node_flows["Flow aggregation<br/>[sensor.py]"]
  node_window[("Recent flow window<br/>[sensor.py]")]
end

subgraph group_results["Analysis results"]
  node_analysis["Flow analysis<br/>[app.py]"]
  node_scoring["Anomaly scoring<br/>[app.py]"]
  node_summary["Analysis summary<br/>[app.py]"]
end

node_user(("Local user"))
node_interface(("Linux interface"))

node_user -->|"uses"| node_browser
node_browser -->|"navigates"| node_views
node_browser -->|"requests analysis"| node_api
node_browser -.->|"loads sample flows"| node_demo
node_browser -->|"uploads CSV"| node_csv
node_api -->|"analyzes rows"| node_analysis
node_analysis -->|"scores flows"| node_scoring
node_analysis -->|"summarizes results"| node_summary
node_api -->|"starts or stops"| node_lifecycle
node_api -->|"reads snapshot"| node_window
node_lifecycle -->|"validates interface"| node_discovery
node_lifecycle -->|"captures packets"| node_interface
node_lifecycle -->|"decodes frames"| node_decoder
node_decoder -->|"returns observations"| node_flows
node_flows -->|"updates flows"| node_window
node_api -->|"returns results"| node_browser
node_browser -->|"renders summary"| node_overview
node_browser -->|"renders flows"| node_traffic
node_browser -->|"filters anomalies"| node_alerts
node_alerts -->|"exports anomalies"| node_export

click node_browser "https://github.com/avaqen/strata/blob/main/app.js"
click node_views "https://github.com/avaqen/strata/blob/main/index.html"
click node_api "https://github.com/avaqen/strata/blob/main/app.py"
click node_demo "https://github.com/avaqen/strata/blob/main/app.py"
click node_csv "https://github.com/avaqen/strata/blob/main/app.py"
click node_analysis "https://github.com/avaqen/strata/blob/main/app.py"
click node_scoring "https://github.com/avaqen/strata/blob/main/app.py"
click node_summary "https://github.com/avaqen/strata/blob/main/app.py"
click node_discovery "https://github.com/avaqen/strata/blob/main/sensor.py"
click node_lifecycle "https://github.com/avaqen/strata/blob/main/sensor.py"
click node_decoder "https://github.com/avaqen/strata/blob/main/sensor.py"
click node_flows "https://github.com/avaqen/strata/blob/main/sensor.py"
click node_window "https://github.com/avaqen/strata/blob/main/sensor.py"
click node_alerts "https://github.com/avaqen/strata/blob/main/app.js"
click node_traffic "https://github.com/avaqen/strata/blob/main/app.js"
click node_overview "https://github.com/avaqen/strata/blob/main/app.js"
click node_export "https://github.com/avaqen/strata/blob/main/app.js"

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_browser,node_views,node_alerts,node_traffic,node_overview,node_export,node_user toneBlue
class node_api,node_demo,node_csv toneAmber
class node_discovery,node_lifecycle,node_decoder,node_flows,node_window toneMint
class node_analysis,node_scoring,node_summary toneRose
class node_interface toneIndigo
```

## Components

### Dashboard

- [Dashboard client](https://github.com/avaqen/strata/blob/main/app.js): `app.js`
- [Dashboard views](https://github.com/avaqen/strata/blob/main/index.html): `index.html`
- [Alert table](https://github.com/avaqen/strata/blob/main/app.js): `app.js`
- [Traffic analysis view](https://github.com/avaqen/strata/blob/main/app.js): `app.js`
- [Overview view](https://github.com/avaqen/strata/blob/main/app.js): `app.js`
- [CSV export](https://github.com/avaqen/strata/blob/main/app.js): `app.js`

### Analysis server

- [HTTP API](https://github.com/avaqen/strata/blob/main/app.py): `app.py`
- [Sample flows](https://github.com/avaqen/strata/blob/main/app.py): `app.py`
- [CSV import](https://github.com/avaqen/strata/blob/main/app.py): `app.py`

### Live capture

- [Interface discovery](https://github.com/avaqen/strata/blob/main/sensor.py): `sensor.py`
- [Capture control](https://github.com/avaqen/strata/blob/main/sensor.py): `sensor.py`
- [Packet decoder](https://github.com/avaqen/strata/blob/main/sensor.py): `sensor.py`
- [Flow aggregation](https://github.com/avaqen/strata/blob/main/sensor.py): `sensor.py`
- [Recent flow window](https://github.com/avaqen/strata/blob/main/sensor.py): `sensor.py`

### Analysis results

- [Flow analysis](https://github.com/avaqen/strata/blob/main/app.py): `app.py`
- [Anomaly scoring](https://github.com/avaqen/strata/blob/main/app.py): `app.py`
- [Analysis summary](https://github.com/avaqen/strata/blob/main/app.py): `app.py`

### Other components

- **Local user**
- **Linux interface**

## Connections

- Local user → Dashboard client: uses (evidence: `README.md`)
- Dashboard client → Dashboard views: navigates (evidence: `app.js`)
- Dashboard client → HTTP API: requests analysis (evidence: `app.js`)
- Dashboard client → Sample flows: loads sample flows (evidence: `README.md`)
- Dashboard client → CSV import: uploads CSV (evidence: `app.js`)
- HTTP API → Flow analysis: analyzes rows (evidence: `app.py`)
- Flow analysis → Anomaly scoring: scores flows (evidence: `app.py`)
- Flow analysis → Analysis summary: summarizes results (evidence: `app.py`)
- HTTP API → Capture control: starts or stops (evidence: `app.py`)
- HTTP API → Recent flow window: reads snapshot (evidence: `app.py`)
- Capture control → Interface discovery: validates interface (evidence: `sensor.py`)
- Capture control → Linux interface: captures packets (evidence: `README.md`)
- Capture control → Packet decoder: decodes frames (evidence: `sensor.py`)
- Packet decoder → Flow aggregation: returns observations (evidence: `sensor.py`)
- Flow aggregation → Recent flow window: updates flows (evidence: `sensor.py`)
- HTTP API → Dashboard client: returns results (evidence: `app.py`)
- Dashboard client → Overview view: renders summary (evidence: `app.js`)
- Dashboard client → Traffic analysis view: renders flows (evidence: `app.js`)
- Dashboard client → Alert table: filters anomalies (evidence: `app.js`)
- Alert table → CSV export: exports anomalies (evidence: `app.js`)
