# cyber-omega/phantom architecture

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

- Interactive diagram: https://gitdiagram.com/cyber-omega/phantom
- Repository: https://github.com/cyber-omega/phantom

## Overview

PHANTOM is a browser-security analysis demo: an analyst selects a preset or enters a URL, the UI submits it to the Express analysis API, and the resulting risk assessment is presented for review, quarantine, intelligence lookup, optional Gemini auditing, and PDF export. The README documents vision, origin telemetry, Bayesian triage, and honeypot stages; the sampled server excerpt confirms analysis routing, historical matching, honeypot interception, and Gemini use. Several implementation details are unsampled, so those documented stage links rely on the README.

Main entry points: [`src/App.tsx`](https://github.com/cyber-omega/phantom/blob/main/src/App.tsx) (Analysis Workspace), [`server.ts`](https://github.com/cyber-omega/phantom/blob/main/server.ts) (Analysis API), [`src/components/BrowserViewport.tsx`](https://github.com/cyber-omega/phantom/blob/main/src/components/BrowserViewport.tsx) (Browser Viewport), [`src/components/HistoricalDatabaseView.tsx`](https://github.com/cyber-omega/phantom/blob/main/src/components/HistoricalDatabaseView.tsx) (Threat Repository View)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Analyst Interface"]
  node_app["Analysis Workspace<br/>[App.tsx]"]
  node_scenarios["Scenario Presets<br/>[scenarios.ts]"]
  node_viewport["Browser Viewport"]
  node_pipeline["Pipeline Display<br/>[PipelineFlow.tsx]"]
  node_brandlogos["Brand Logo Views<br/>[BrandLogos.tsx]"]
end

subgraph group_analysis["Analysis Pipeline"]
  node_server["Analysis API<br/>[server.ts]"]
  node_vision["Visual Inspection"]
  node_telemetry["Origin Telemetry"]
  node_arbiter["Bayesian Triage"]
end

subgraph group_intelligence["Threat Intelligence"]
  node_historydata["Threat Matching"]
  node_historyview["Threat Repository View"]
end

subgraph group_response["Response &amp; Reporting"]
  node_honeypot["Honeypot Defense"]
  node_gemini["Gemini Audit"]
  node_geminiservice["Gemini Service<br/>[server.ts]"]
  node_exportmodal["Report Controls"]
  node_pdf["PDF Generator<br/>[pdfExport.ts]"]
end

node_analyst(("SOC Analyst"))

node_analyst -->|"selects target"| node_app
node_app -->|"loads presets"| node_scenarios
node_app -->|"posts analysis"| node_server
node_server -->|"queries matches"| node_historydata
node_server -.->|"produces visual findings"| node_vision
node_server -.->|"produces origin findings"| node_telemetry
node_server -.->|"computes risk verdict"| node_arbiter
node_app -->|"renders"| node_viewport
node_app -->|"renders"| node_pipeline
node_app -->|"renders"| node_vision
node_app -->|"renders"| node_telemetry
node_app -->|"renders"| node_arbiter
node_app -->|"renders"| node_historyview
node_app -->|"renders"| node_honeypot
node_historyview -.->|"searches repository"| node_historydata
node_server -->|"accepts tripwire submissions"| node_honeypot
node_app -->|"opens audit"| node_gemini
node_gemini -.->|"requests audit"| node_geminiservice
node_server -->|"calls Gemini SDK"| node_geminiservice
node_app -->|"opens report controls"| node_exportmodal
node_exportmodal -->|"generates report"| node_pdf
node_viewport -.->|"renders brand marks"| node_brandlogos

click node_app "https://github.com/cyber-omega/phantom/blob/main/src/App.tsx"
click node_scenarios "https://github.com/cyber-omega/phantom/blob/main/src/data/scenarios.ts"
click node_viewport "https://github.com/cyber-omega/phantom/blob/main/src/components/BrowserViewport.tsx"
click node_pipeline "https://github.com/cyber-omega/phantom/blob/main/src/components/PipelineFlow.tsx"
click node_server "https://github.com/cyber-omega/phantom/blob/main/server.ts"
click node_vision "https://github.com/cyber-omega/phantom/blob/main/src/components/VisionInspector.tsx"
click node_telemetry "https://github.com/cyber-omega/phantom/blob/main/src/components/TelemetryInspector.tsx"
click node_arbiter "https://github.com/cyber-omega/phantom/blob/main/src/components/BayesianArbiterView.tsx"
click node_historydata "https://github.com/cyber-omega/phantom/blob/main/src/data/historicalThreats.ts"
click node_historyview "https://github.com/cyber-omega/phantom/blob/main/src/components/HistoricalDatabaseView.tsx"
click node_honeypot "https://github.com/cyber-omega/phantom/blob/main/src/components/HoneypotDefenseCenter.tsx"
click node_gemini "https://github.com/cyber-omega/phantom/blob/main/src/components/GeminiAuditModal.tsx"
click node_geminiservice "https://github.com/cyber-omega/phantom/blob/main/server.ts"
click node_exportmodal "https://github.com/cyber-omega/phantom/blob/main/src/components/ExportReportModal.tsx"
click node_pdf "https://github.com/cyber-omega/phantom/blob/main/src/utils/pdfExport.ts"
click node_brandlogos "https://github.com/cyber-omega/phantom/blob/main/src/components/BrandLogos.tsx"

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_app,node_scenarios,node_viewport,node_pipeline,node_brandlogos toneBlue
class node_server,node_vision,node_telemetry,node_arbiter toneAmber
class node_historydata,node_historyview toneMint
class node_honeypot,node_gemini,node_geminiservice,node_exportmodal,node_pdf toneRose
class node_analyst toneIndigo
```

## Components

### Analyst Interface

- [Analysis Workspace](https://github.com/cyber-omega/phantom/blob/main/src/App.tsx): `src/App.tsx`
- [Scenario Presets](https://github.com/cyber-omega/phantom/blob/main/src/data/scenarios.ts): `src/data/scenarios.ts`
- [Browser Viewport](https://github.com/cyber-omega/phantom/blob/main/src/components/BrowserViewport.tsx): `src/components/BrowserViewport.tsx`
- [Pipeline Display](https://github.com/cyber-omega/phantom/blob/main/src/components/PipelineFlow.tsx): `src/components/PipelineFlow.tsx`
- [Brand Logo Views](https://github.com/cyber-omega/phantom/blob/main/src/components/BrandLogos.tsx): `src/components/BrandLogos.tsx`

### Analysis Pipeline

- [Analysis API](https://github.com/cyber-omega/phantom/blob/main/server.ts): `server.ts`
- [Visual Inspection](https://github.com/cyber-omega/phantom/blob/main/src/components/VisionInspector.tsx): `src/components/VisionInspector.tsx`
- [Origin Telemetry](https://github.com/cyber-omega/phantom/blob/main/src/components/TelemetryInspector.tsx): `src/components/TelemetryInspector.tsx`
- [Bayesian Triage](https://github.com/cyber-omega/phantom/blob/main/src/components/BayesianArbiterView.tsx): `src/components/BayesianArbiterView.tsx`

### Threat Intelligence

- [Threat Matching](https://github.com/cyber-omega/phantom/blob/main/src/data/historicalThreats.ts): `src/data/historicalThreats.ts`
- [Threat Repository View](https://github.com/cyber-omega/phantom/blob/main/src/components/HistoricalDatabaseView.tsx): `src/components/HistoricalDatabaseView.tsx`

### Response & Reporting

- [Honeypot Defense](https://github.com/cyber-omega/phantom/blob/main/src/components/HoneypotDefenseCenter.tsx): `src/components/HoneypotDefenseCenter.tsx`
- [Gemini Audit](https://github.com/cyber-omega/phantom/blob/main/src/components/GeminiAuditModal.tsx): `src/components/GeminiAuditModal.tsx`
- [Gemini Service](https://github.com/cyber-omega/phantom/blob/main/server.ts): `server.ts`
- [Report Controls](https://github.com/cyber-omega/phantom/blob/main/src/components/ExportReportModal.tsx): `src/components/ExportReportModal.tsx`
- [PDF Generator](https://github.com/cyber-omega/phantom/blob/main/src/utils/pdfExport.ts): `src/utils/pdfExport.ts`

### Other components

- **SOC Analyst**

## Connections

- SOC Analyst → Analysis Workspace: selects target (evidence: `README.md`)
- Analysis Workspace → Scenario Presets: loads presets (evidence: `src/App.tsx`)
- Analysis Workspace → Analysis API: posts analysis (evidence: `src/App.tsx`)
- Analysis API → Threat Matching: queries matches (evidence: `server.ts`)
- Analysis API → Visual Inspection: produces visual findings (evidence: `README.md`)
- Analysis API → Origin Telemetry: produces origin findings (evidence: `README.md`)
- Analysis API → Bayesian Triage: computes risk verdict (evidence: `README.md`)
- Analysis Workspace → Browser Viewport: renders (evidence: `src/App.tsx`)
- Analysis Workspace → Pipeline Display: renders (evidence: `src/App.tsx`)
- Analysis Workspace → Visual Inspection: renders (evidence: `src/App.tsx`)
- Analysis Workspace → Origin Telemetry: renders (evidence: `src/App.tsx`)
- Analysis Workspace → Bayesian Triage: renders (evidence: `README.md`)
- Analysis Workspace → Threat Repository View: renders (evidence: `README.md`)
- Analysis Workspace → Honeypot Defense: renders (evidence: `README.md`)
- Threat Repository View → Threat Matching: searches repository (evidence: `README.md`)
- Analysis API → Honeypot Defense: accepts tripwire submissions (evidence: `server.ts`)
- Analysis Workspace → Gemini Audit: opens audit (evidence: `README.md`)
- Gemini Audit → Gemini Service: requests audit (evidence: `README.md`)
- Analysis API → Gemini Service: calls Gemini SDK (evidence: `server.ts`)
- Analysis Workspace → Report Controls: opens report controls (evidence: `README.md`)
- Report Controls → PDF Generator: generates report (evidence: `src/components/ExportReportModal.tsx`)
- Browser Viewport → Brand Logo Views: renders brand marks (evidence: `README.md`)
