# mirusu400/lanius architecture

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

- Interactive diagram: https://gitdiagram.com/mirusu400/lanius
- Repository: https://github.com/mirusu400/lanius

## Overview

Lanius is a local-first web security desktop workspace: users select a project, route browser traffic through its proxy, inspect and edit captured flows, then replay or fuzz them. The graph preserves documented project storage, site mapping, plugins, decoding/diffs, and agent access. Relationships are limited to README statements and visible source references/calls; many listed subsystems are unsampled, so their internal wiring is intentionally not inferred.

Main entry points: [`engine/app/api/server.py`](https://github.com/mirusu400/lanius/blob/main/engine/app/api/server.py) (REST and stream API), [`engine/app/mcp/server.py`](https://github.com/mirusu400/lanius/blob/main/engine/app/mcp/server.py) (Native MCP server), [`ui/src/App.tsx`](https://github.com/mirusu400/lanius/blob/main/ui/src/App.tsx) (Workspace UI), [`engine/app/db/store.py`](https://github.com/mirusu400/lanius/blob/main/engine/app/db/store.py) (Flow store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop Workspace"]
  node_ui["Workspace UI<br/>[App.tsx]"]
  node_api_client["Engine API client<br/>[client.ts]"]
  node_codecs["Decode and encode<br/>[codecs.py]"]
  node_diff["Response diff<br/>[DiffTab.tsx]"]
  node_project_ui["Project picker<br/>[ProjectPicker.tsx]"]
end

subgraph group_proxy["Capture and Testing"]
  node_engine["Engine runtime<br/>[main.py]"]
  node_api["REST and stream API<br/>[server.py]"]
  node_proxy_engine["HTTP proxy<br/>[proxy.py]"]
  node_capture["Flow capture<br/>[capture.py]"]
  node_intercept["Request interception<br/>[intercept.py]"]
  node_replay["Request replay<br/>[replay.py]"]
  node_fuzzer["Payload fuzzing<br/>[fuzzer.py]"]
  node_scope["Scope and sitemap<br/>[scope.py]"]
  node_websocket["WebSocket tools<br/>[websocket_proxy.py]"]
  node_match_replace["Match and replace<br/>[match_replace.py]"]
end

subgraph group_data["Project Data"]
  node_store[("Flow store<br/>[store.py]")]
  node_schema[("Project schema<br/>[schema.py]")]
end

subgraph group_extensions["Extensions and Agents"]
  node_plugins["Plugin runtime<br/>[plugin_registry.py]"]
  node_plugin_api["Plugin management API<br/>[server.py]"]
  node_mcp["Native MCP server<br/>[server.py]"]
end

node_user(("Security analyst"))
node_agent(("AI agent"))
node_browser(("Web browser"))

node_user -->|"uses"| node_ui
node_ui -->|"selects project"| node_project_ui
node_ui -->|"requests engine"| node_api_client
node_api_client -.->|"HTTP requests"| node_api
node_engine -->|"creates app"| node_api
node_engine -.->|"starts proxy"| node_proxy_engine
node_browser -->|"sends traffic"| node_proxy_engine
node_proxy_engine -.->|"captures flows"| node_capture
node_capture -.->|"persists flows"| node_store
node_api -->|"reads history"| node_store
node_api -->|"controls interception"| node_intercept
node_api -->|"sends replay"| node_replay
node_api -->|"runs fuzzing"| node_fuzzer
node_api -.->|"serves scope"| node_scope
node_api -->|"routes tools"| node_websocket
node_api -->|"routes rules"| node_match_replace
node_api -->|"routes codecs"| node_codecs
node_store -->|"uses schema"| node_schema
node_ui -->|"opens diff"| node_diff
node_api -->|"exposes plugin routes"| node_plugin_api
node_plugin_api -.->|"manages plugins"| node_plugins
node_agent -->|"invokes tools"| node_mcp
node_mcp -->|"queries flows"| node_store
node_mcp -->|"controls rules"| node_intercept
node_mcp -->|"sends requests"| node_replay
node_mcp -.->|"plugin tools"| node_plugins

click node_ui "https://github.com/mirusu400/lanius/blob/main/ui/src/App.tsx"
click node_api_client "https://github.com/mirusu400/lanius/blob/main/ui/src/api/client.ts"
click node_engine "https://github.com/mirusu400/lanius/blob/main/engine/app/main.py"
click node_api "https://github.com/mirusu400/lanius/blob/main/engine/app/api/server.py"
click node_proxy_engine "https://github.com/mirusu400/lanius/blob/main/engine/app/proxy.py"
click node_capture "https://github.com/mirusu400/lanius/blob/main/engine/app/addons/capture.py"
click node_intercept "https://github.com/mirusu400/lanius/blob/main/engine/app/addons/intercept.py"
click node_replay "https://github.com/mirusu400/lanius/blob/main/engine/app/addons/replay.py"
click node_fuzzer "https://github.com/mirusu400/lanius/blob/main/engine/app/addons/fuzzer.py"
click node_scope "https://github.com/mirusu400/lanius/blob/main/engine/app/addons/scope.py"
click node_websocket "https://github.com/mirusu400/lanius/blob/main/engine/app/addons/websocket_proxy.py"
click node_match_replace "https://github.com/mirusu400/lanius/blob/main/engine/app/addons/match_replace.py"
click node_codecs "https://github.com/mirusu400/lanius/blob/main/engine/app/addons/codecs.py"
click node_diff "https://github.com/mirusu400/lanius/blob/main/ui/src/tabs/DiffTab.tsx"
click node_store "https://github.com/mirusu400/lanius/blob/main/engine/app/db/store.py"
click node_schema "https://github.com/mirusu400/lanius/blob/main/engine/app/db/schema.py"
click node_project_ui "https://github.com/mirusu400/lanius/blob/main/ui/src/ProjectPicker.tsx"
click node_plugins "https://github.com/mirusu400/lanius/blob/main/engine/app/plugin_registry.py"
click node_plugin_api "https://github.com/mirusu400/lanius/blob/main/engine/app/api/server.py"
click node_mcp "https://github.com/mirusu400/lanius/blob/main/engine/app/mcp/server.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_ui,node_api_client,node_codecs,node_diff,node_project_ui,node_browser toneBlue
class node_engine,node_api,node_proxy_engine,node_capture,node_intercept,node_replay,node_fuzzer,node_scope,node_websocket,node_match_replace toneAmber
class node_store,node_schema toneMint
class node_plugins,node_plugin_api,node_mcp toneRose
class node_user,node_agent toneIndigo
```

## Components

### Desktop Workspace

- [Workspace UI](https://github.com/mirusu400/lanius/blob/main/ui/src/App.tsx): `ui/src/App.tsx`
- [Engine API client](https://github.com/mirusu400/lanius/blob/main/ui/src/api/client.ts): `ui/src/api/client.ts`
- [Decode and encode](https://github.com/mirusu400/lanius/blob/main/engine/app/addons/codecs.py): `engine/app/addons/codecs.py`
- [Response diff](https://github.com/mirusu400/lanius/blob/main/ui/src/tabs/DiffTab.tsx): `ui/src/tabs/DiffTab.tsx`
- [Project picker](https://github.com/mirusu400/lanius/blob/main/ui/src/ProjectPicker.tsx): `ui/src/ProjectPicker.tsx`

### Capture and Testing

- [Engine runtime](https://github.com/mirusu400/lanius/blob/main/engine/app/main.py): `engine/app/main.py`
- [REST and stream API](https://github.com/mirusu400/lanius/blob/main/engine/app/api/server.py): `engine/app/api/server.py`
- [HTTP proxy](https://github.com/mirusu400/lanius/blob/main/engine/app/proxy.py): `engine/app/proxy.py`
- [Flow capture](https://github.com/mirusu400/lanius/blob/main/engine/app/addons/capture.py): `engine/app/addons/capture.py`
- [Request interception](https://github.com/mirusu400/lanius/blob/main/engine/app/addons/intercept.py): `engine/app/addons/intercept.py`
- [Request replay](https://github.com/mirusu400/lanius/blob/main/engine/app/addons/replay.py): `engine/app/addons/replay.py`
- [Payload fuzzing](https://github.com/mirusu400/lanius/blob/main/engine/app/addons/fuzzer.py): `engine/app/addons/fuzzer.py`
- [Scope and sitemap](https://github.com/mirusu400/lanius/blob/main/engine/app/addons/scope.py): `engine/app/addons/scope.py`
- [WebSocket tools](https://github.com/mirusu400/lanius/blob/main/engine/app/addons/websocket_proxy.py): `engine/app/addons/websocket_proxy.py`
- [Match and replace](https://github.com/mirusu400/lanius/blob/main/engine/app/addons/match_replace.py): `engine/app/addons/match_replace.py`

### Project Data

- [Flow store](https://github.com/mirusu400/lanius/blob/main/engine/app/db/store.py): `engine/app/db/store.py`
- [Project schema](https://github.com/mirusu400/lanius/blob/main/engine/app/db/schema.py): `engine/app/db/schema.py`

### Extensions and Agents

- [Plugin runtime](https://github.com/mirusu400/lanius/blob/main/engine/app/plugin_registry.py): `engine/app/plugin_registry.py`
- [Plugin management API](https://github.com/mirusu400/lanius/blob/main/engine/app/api/server.py): `engine/app/api/server.py`
- [Native MCP server](https://github.com/mirusu400/lanius/blob/main/engine/app/mcp/server.py): `engine/app/mcp/server.py`

### Other components

- **Security analyst**
- **AI agent**
- **Web browser**

## Connections

- Security analyst → Workspace UI: uses (evidence: `README.md`)
- Workspace UI → Project picker: selects project (evidence: `ui/src/App.tsx`)
- Workspace UI → Engine API client: requests engine (evidence: `ui/src/App.tsx`)
- Engine API client → REST and stream API: HTTP requests
- Engine runtime → REST and stream API: creates app (evidence: `engine/app/main.py`)
- Engine runtime → HTTP proxy: starts proxy
- Web browser → HTTP proxy: sends traffic (evidence: `README.md`)
- HTTP proxy → Flow capture: captures flows
- Flow capture → Flow store: persists flows
- REST and stream API → Flow store: reads history (evidence: `engine/app/api/server.py`)
- REST and stream API → Request interception: controls interception (evidence: `engine/app/api/server.py`)
- REST and stream API → Request replay: sends replay (evidence: `engine/app/api/server.py`)
- REST and stream API → Payload fuzzing: runs fuzzing (evidence: `engine/app/api/server.py`)
- REST and stream API → Scope and sitemap: serves scope (evidence: `engine/app/api/server.py`)
- REST and stream API → WebSocket tools: routes tools (evidence: `engine/app/api/server.py`)
- REST and stream API → Match and replace: routes rules (evidence: `engine/app/api/server.py`)
- REST and stream API → Decode and encode: routes codecs (evidence: `engine/app/api/server.py`)
- Flow store → Project schema: uses schema (evidence: `engine/app/db/store.py`)
- Workspace UI → Response diff: opens diff (evidence: `README.md`)
- REST and stream API → Plugin management API: exposes plugin routes (evidence: `engine/app/api/server.py`)
- Plugin management API → Plugin runtime: manages plugins (evidence: `engine/app/api/server.py`)
- AI agent → Native MCP server: invokes tools (evidence: `README.md`)
- Native MCP server → Flow store: queries flows (evidence: `engine/app/mcp/server.py`)
- Native MCP server → Request interception: controls rules (evidence: `engine/app/mcp/server.py`)
- Native MCP server → Request replay: sends requests (evidence: `engine/app/mcp/server.py`)
- Native MCP server → Plugin runtime: plugin tools (evidence: `engine/app/mcp/server.py`)
