# zerodaylight0/signal-log-analyzer architecture

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

- Interactive diagram: https://gitdiagram.com/zerodaylight0/signal-log-analyzer
- Repository: https://github.com/zerodaylight0/signal-log-analyzer

## Overview

Signal/Log is a local-first log-review application with browser and Linux CLI entry points. Users upload a log or select a systemd journal, configure an AI provider, and receive a structured report with severity, incidents, evidence, timeline, recommendations, and caveats; the browser can export it as JSON. The core analysis prepares and bounds log text, requests a provider response, and validates a consistent report. Browser settings are encrypted locally. Relationships are limited to those shown in excerpts or documented in the README; unsampled UI and analysis details are not inferred.

Main entry points: [`src/loganalyzer/web.py`](https://github.com/zerodaylight0/signal-log-analyzer/blob/main/src/loganalyzer/web.py) (Web routes), [`src/loganalyzer/cli.py`](https://github.com/zerodaylight0/signal-log-analyzer/blob/main/src/loganalyzer/cli.py) (CLI commands), [`src/loganalyzer/static/app.js`](https://github.com/zerodaylight0/signal-log-analyzer/blob/main/src/loganalyzer/static/app.js) (Upload and report), [`src/loganalyzer/analysis.py`](https://github.com/zerodaylight0/signal-log-analyzer/blob/main/src/loganalyzer/analysis.py) (Log preparation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User entry points"]
  node_web_api["Web routes<br/>[web.py]"]
  node_cli["CLI commands<br/>[cli.py]"]
  node_cli_output["CLI report output<br/>[cli.py]"]
end

subgraph group_browser["Browser experience"]
  node_browser_ui["Dashboard UI<br/>[index.html]"]
  node_browser_app["Upload and report<br/>[app.js]"]
  node_settings["Settings encryption<br/>[settings.js]"]
  node_browser_storage[("Browser storage")]
end

subgraph group_analysis["Analysis domain"]
  node_log_prep["Log preparation<br/>[analysis.py]"]
  node_provider_config["Provider configuration<br/>[analysis.py]"]
  node_provider_request["AI request and parsing<br/>[analysis.py]"]
  node_report["Structured report<br/>[analysis.py]"]
  node_errors["Analysis errors<br/>[errors.py]"]
end

subgraph group_integrations["External integrations"]
  node_ai_provider["Selected AI API"]
end

node_user(("Log analyst"))
node_local_file["Log file"]
node_journalctl["systemd journal"]

node_user -->|"uses"| node_browser_ui
node_browser_ui -.->|"loads"| node_browser_app
node_browser_app -->|"calls"| node_settings
node_settings -->|"encrypts and stores"| node_browser_storage
node_browser_app -->|"posts log"| node_web_api
node_web_api -->|"serves assets"| node_browser_ui
node_web_api -->|"validates settings"| node_provider_config
node_web_api -->|"analyzes upload"| node_log_prep
node_user -->|"runs command"| node_cli
node_cli -->|"reads"| node_local_file
node_cli -->|"runs query"| node_journalctl
node_cli -->|"analyzes text"| node_log_prep
node_log_prep -.->|"provides prepared log"| node_provider_request
node_provider_request -->|"sends request"| node_ai_provider
node_provider_request -->|"validates response"| node_report
node_log_prep -.->|"uses settings"| node_provider_config
node_web_api -->|"returns report"| node_report
node_cli -->|"formats report"| node_cli_output
node_report -->|"supplies result"| node_cli_output
node_browser_app -->|"renders and exports"| node_report

click node_browser_ui "https://github.com/zerodaylight0/signal-log-analyzer/blob/main/src/loganalyzer/static/index.html"
click node_browser_app "https://github.com/zerodaylight0/signal-log-analyzer/blob/main/src/loganalyzer/static/app.js"
click node_settings "https://github.com/zerodaylight0/signal-log-analyzer/blob/main/src/loganalyzer/static/settings.js"
click node_web_api "https://github.com/zerodaylight0/signal-log-analyzer/blob/main/src/loganalyzer/web.py"
click node_cli "https://github.com/zerodaylight0/signal-log-analyzer/blob/main/src/loganalyzer/cli.py"
click node_log_prep "https://github.com/zerodaylight0/signal-log-analyzer/blob/main/src/loganalyzer/analysis.py"
click node_provider_config "https://github.com/zerodaylight0/signal-log-analyzer/blob/main/src/loganalyzer/analysis.py"
click node_provider_request "https://github.com/zerodaylight0/signal-log-analyzer/blob/main/src/loganalyzer/analysis.py"
click node_report "https://github.com/zerodaylight0/signal-log-analyzer/blob/main/src/loganalyzer/analysis.py"
click node_cli_output "https://github.com/zerodaylight0/signal-log-analyzer/blob/main/src/loganalyzer/cli.py"
click node_errors "https://github.com/zerodaylight0/signal-log-analyzer/blob/main/src/loganalyzer/errors.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_web_api,node_cli,node_cli_output toneBlue
class node_browser_ui,node_browser_app,node_settings,node_browser_storage toneAmber
class node_log_prep,node_provider_config,node_provider_request,node_report,node_errors toneMint
class node_ai_provider toneRose
class node_user,node_local_file,node_journalctl toneIndigo
```

## Components

### User entry points

- [Web routes](https://github.com/zerodaylight0/signal-log-analyzer/blob/main/src/loganalyzer/web.py): `src/loganalyzer/web.py`
- [CLI commands](https://github.com/zerodaylight0/signal-log-analyzer/blob/main/src/loganalyzer/cli.py): `src/loganalyzer/cli.py`
- [CLI report output](https://github.com/zerodaylight0/signal-log-analyzer/blob/main/src/loganalyzer/cli.py): `src/loganalyzer/cli.py`

### Browser experience

- [Dashboard UI](https://github.com/zerodaylight0/signal-log-analyzer/blob/main/src/loganalyzer/static/index.html): `src/loganalyzer/static/index.html`
- [Upload and report](https://github.com/zerodaylight0/signal-log-analyzer/blob/main/src/loganalyzer/static/app.js): `src/loganalyzer/static/app.js`
- [Settings encryption](https://github.com/zerodaylight0/signal-log-analyzer/blob/main/src/loganalyzer/static/settings.js): `src/loganalyzer/static/settings.js`
- **Browser storage**

### Analysis domain

- [Log preparation](https://github.com/zerodaylight0/signal-log-analyzer/blob/main/src/loganalyzer/analysis.py): `src/loganalyzer/analysis.py`
- [Provider configuration](https://github.com/zerodaylight0/signal-log-analyzer/blob/main/src/loganalyzer/analysis.py): `src/loganalyzer/analysis.py`
- [AI request and parsing](https://github.com/zerodaylight0/signal-log-analyzer/blob/main/src/loganalyzer/analysis.py): `src/loganalyzer/analysis.py`
- [Structured report](https://github.com/zerodaylight0/signal-log-analyzer/blob/main/src/loganalyzer/analysis.py): `src/loganalyzer/analysis.py`
- [Analysis errors](https://github.com/zerodaylight0/signal-log-analyzer/blob/main/src/loganalyzer/errors.py): `src/loganalyzer/errors.py`

### External integrations

- **Selected AI API**

### Other components

- **Log analyst**
- **Log file**
- **systemd journal**

## Connections

- Log analyst → Dashboard UI: uses (evidence: `README.md`)
- Dashboard UI → Upload and report: loads
- Upload and report → Settings encryption: calls (evidence: `src/loganalyzer/static/app.js`)
- Settings encryption → Browser storage: encrypts and stores (evidence: `src/loganalyzer/static/settings.js`)
- Upload and report → Web routes: posts log (evidence: `src/loganalyzer/static/app.js`)
- Web routes → Dashboard UI: serves assets (evidence: `src/loganalyzer/web.py`)
- Web routes → Provider configuration: validates settings (evidence: `src/loganalyzer/web.py`)
- Web routes → Log preparation: analyzes upload (evidence: `src/loganalyzer/web.py`)
- Log analyst → CLI commands: runs command (evidence: `README.md`)
- CLI commands → Log file: reads (evidence: `src/loganalyzer/cli.py`)
- CLI commands → systemd journal: runs query (evidence: `src/loganalyzer/cli.py`)
- CLI commands → Log preparation: analyzes text (evidence: `src/loganalyzer/cli.py`)
- Log preparation → AI request and parsing: provides prepared log (evidence: `src/loganalyzer/analysis.py`)
- AI request and parsing → Selected AI API: sends request (evidence: `src/loganalyzer/analysis.py`)
- AI request and parsing → Structured report: validates response (evidence: `src/loganalyzer/analysis.py`)
- Log preparation → Provider configuration: uses settings (evidence: `src/loganalyzer/analysis.py`)
- Web routes → Structured report: returns report (evidence: `src/loganalyzer/web.py`)
- CLI commands → CLI report output: formats report (evidence: `src/loganalyzer/cli.py`)
- Structured report → CLI report output: supplies result (evidence: `src/loganalyzer/cli.py`)
- Upload and report → Structured report: renders and exports (evidence: `src/loganalyzer/static/app.js`)
