# victus-arc/spectra-analyzer architecture

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

- Interactive diagram: https://gitdiagram.com/victus-arc/spectra-analyzer
- Repository: https://github.com/victus-arc/spectra-analyzer

## Overview

SPECTRA is a read-only digital evidence analysis toolkit with a terminal interface. Its main workflow collects a file path, computes a SHA-256 hash, gathers metadata and a file signature, optionally analyzes text, then creates a report. A separate integrity workflow compares a calculated hash with a supplied known hash; users can also browse saved reports. The sampled sources show the interface orchestrating these operations. The README documents the capabilities; unsampled portions of the interface are not inferred beyond those documented features.

Main entry points: [`spectra/spectra.py`](https://github.com/victus-arc/spectra-analyzer/blob/main/spectra/spectra.py) (CLI workflows), [`spectra/report.py`](https://github.com/victus-arc/spectra-analyzer/blob/main/spectra/report.py) (Report generation), [`spectra/hash_engine.py`](https://github.com/victus-arc/spectra-analyzer/blob/main/spectra/hash_engine.py) (SHA-256 hashing), [`spectra/metadata.py`](https://github.com/victus-arc/spectra-analyzer/blob/main/spectra/metadata.py) (Metadata collection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Terminal interface"]
  node_cli["CLI workflows<br/>[spectra.py]"]
end

subgraph group_analysis["Evidence analysis"]
  node_hash["SHA-256 hashing<br/>[hash_engine.py]"]
  node_metadata["Metadata collection<br/>[metadata.py]"]
  node_signature["Signature detection<br/>[analyzer.py]"]
  node_text["Text analysis<br/>[analyzer.py]"]
  node_integrity["Hash verification<br/>[analyzer.py]"]
end

subgraph group_reports["Reports"]
  node_reportgen["Report generation<br/>[report.py]"]
  node_reportstore[("Saved reports")]
  node_reportview["Report browsing<br/>[spectra.py]"]
end

node_user(("Terminal user"))
node_evidence["Evidence file"]

node_user -->|"uses"| node_cli
node_cli -->|"reads"| node_evidence
node_cli -->|"calculates hash"| node_hash
node_cli -->|"collects metadata"| node_metadata
node_cli -->|"detects signature"| node_signature
node_cli -->|"analyzes text"| node_text
node_cli -->|"checks hash"| node_integrity
node_cli -->|"creates report"| node_reportgen
node_reportgen -->|"writes report"| node_reportstore
node_cli -->|"opens reports"| node_reportview
node_reportview -->|"lists and reads"| node_reportstore

click node_cli "https://github.com/victus-arc/spectra-analyzer/blob/main/spectra/spectra.py"
click node_hash "https://github.com/victus-arc/spectra-analyzer/blob/main/spectra/hash_engine.py"
click node_metadata "https://github.com/victus-arc/spectra-analyzer/blob/main/spectra/metadata.py"
click node_signature "https://github.com/victus-arc/spectra-analyzer/blob/main/spectra/analyzer.py"
click node_text "https://github.com/victus-arc/spectra-analyzer/blob/main/spectra/analyzer.py"
click node_integrity "https://github.com/victus-arc/spectra-analyzer/blob/main/spectra/analyzer.py"
click node_reportgen "https://github.com/victus-arc/spectra-analyzer/blob/main/spectra/report.py"
click node_reportview "https://github.com/victus-arc/spectra-analyzer/blob/main/spectra/spectra.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_cli,node_user toneBlue
class node_hash,node_metadata,node_signature,node_text,node_integrity toneAmber
class node_reportgen,node_reportstore,node_reportview toneMint
class node_evidence toneIndigo
```

## Components

### Terminal interface

- [CLI workflows](https://github.com/victus-arc/spectra-analyzer/blob/main/spectra/spectra.py): `spectra/spectra.py`

### Evidence analysis

- [SHA-256 hashing](https://github.com/victus-arc/spectra-analyzer/blob/main/spectra/hash_engine.py): `spectra/hash_engine.py`
- [Metadata collection](https://github.com/victus-arc/spectra-analyzer/blob/main/spectra/metadata.py): `spectra/metadata.py`
- [Signature detection](https://github.com/victus-arc/spectra-analyzer/blob/main/spectra/analyzer.py): `spectra/analyzer.py`
- [Text analysis](https://github.com/victus-arc/spectra-analyzer/blob/main/spectra/analyzer.py): `spectra/analyzer.py`
- [Hash verification](https://github.com/victus-arc/spectra-analyzer/blob/main/spectra/analyzer.py): `spectra/analyzer.py`

### Reports

- [Report generation](https://github.com/victus-arc/spectra-analyzer/blob/main/spectra/report.py): `spectra/report.py`
- **Saved reports**
- [Report browsing](https://github.com/victus-arc/spectra-analyzer/blob/main/spectra/spectra.py): `spectra/spectra.py`

### Other components

- **Terminal user**
- **Evidence file**

## Connections

- Terminal user → CLI workflows: uses (evidence: `README.md`)
- CLI workflows → Evidence file: reads (evidence: `spectra/spectra.py`)
- CLI workflows → SHA-256 hashing: calculates hash (evidence: `spectra/spectra.py`)
- CLI workflows → Metadata collection: collects metadata (evidence: `spectra/spectra.py`)
- CLI workflows → Signature detection: detects signature (evidence: `spectra/spectra.py`)
- CLI workflows → Text analysis: analyzes text (evidence: `spectra/spectra.py`)
- CLI workflows → Hash verification: checks hash (evidence: `spectra/spectra.py`)
- CLI workflows → Report generation: creates report (evidence: `spectra/spectra.py`)
- Report generation → Saved reports: writes report (evidence: `spectra/report.py`)
- CLI workflows → Report browsing: opens reports (evidence: `spectra/spectra.py`)
- Report browsing → Saved reports: lists and reads (evidence: `spectra/spectra.py`)
