# aadi3006/threatlenx architecture

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

- Interactive diagram: https://gitdiagram.com/aadi3006/threatlenx
- Repository: https://github.com/aadi3006/threatlenx

## Overview

ThreatLenX is an offline-first, client-side SOC investigation and threat-analysis platform. Analysts enter through the spatial command hub, choose a workspace, and use a shared security-service facade to work with local security data; investigation supports explaining incidents, while hunting and detection engineering support finding and testing threats. Case management, evidence auditing, response playbooks, metrics, integrations, and cyber-range simulation are distinct product capabilities. The README documents workspace navigation and capabilities; source-index references and excerpts support only the cited internal links, so other plausible runtime connections are omitted.

Main entry points: [`app/spatial/hub/SpatialCommandHub.tsx`](https://github.com/aadi3006/threatlenx/blob/main/app/spatial/hub/SpatialCommandHub.tsx) (Spatial Command Hub), [`app/core/security-service.ts`](https://github.com/aadi3006/threatlenx/blob/main/app/core/security-service.ts) (Security Service), [`app/core/bootstrap.ts`](https://github.com/aadi3006/threatlenx/blob/main/app/core/bootstrap.ts) (Application Bootstrap), [`app/page.tsx`](https://github.com/aadi3006/threatlenx/blob/main/app/page.tsx) (Application Entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Analyst Workspaces"]
  node_entry["Application Entry<br/>[page.tsx]"]
  node_hub["Spatial Command Hub"]
  node_command["Command Center"]
  node_investigation["Incident Investigation"]
  node_investigation_views["Investigation Views"]
  node_hunting["Threat Hunting"]
  node_cases["Case Management<br/>[CaseWorkspace.tsx]"]
  node_evidence["Evidence Vault"]
  node_detection_ui["Detection Engineering"]
  node_ai_assistant["AI Assistant"]
end

subgraph group_security["Security Operations"]
  node_service["Security Service"]
  node_canonical_events["Event Model<br/>[event.ts]"]
  node_incident_model["Incident Model<br/>[incident.ts]"]
  node_detection_engine["Detection Engine"]
  node_hunt_engine["Hunt Engine"]
  node_metrics["Metrics Engine<br/>[metrics-engine.ts]"]
end

subgraph group_platform["Local Platform"]
  node_bootstrap["Application Bootstrap<br/>[bootstrap.ts]"]
  node_local_provider["Local Provider<br/>[local-provider.ts]"]
  node_storage[("IndexedDB Store<br/>[idb-store.ts]")]
  node_integrations["Integration Sync<br/>[sync-engine.ts]"]
end

subgraph group_response["Response and Simulation"]
  node_response_engine["Playbook Execution"]
  node_simulation["Cyber-Range Simulation"]
end

node_analyst(("SOC Analyst"))

node_analyst -->|"opens"| node_entry
node_entry -->|"renders"| node_hub
node_entry -->|"initializes"| node_bootstrap
node_hub -->|"navigates to"| node_command
node_hub -->|"navigates to"| node_investigation
node_hub -->|"navigates to"| node_hunting
node_hub -->|"navigates to"| node_cases
node_hub -->|"navigates to"| node_evidence
node_hub -->|"navigates to"| node_detection_ui
node_investigation -->|"provides"| node_investigation_views
node_hunting -->|"uses"| node_service
node_hunting -->|"renders"| node_ai_assistant
node_detection_ui -->|"uses"| node_service
node_ai_assistant -->|"uses"| node_service
node_service -->|"delegates to"| node_local_provider
node_bootstrap -->|"initializes"| node_service
node_bootstrap -->|"configures"| node_local_provider
node_bootstrap -->|"configures"| node_storage
node_bootstrap -->|"configures AI"| node_ai_assistant
node_hunt_engine -->|"queries"| node_canonical_events
node_detection_engine -->|"evaluates"| node_canonical_events
node_simulation -->|"reads and writes"| node_storage
node_integrations -->|"reads and writes"| node_storage
node_service -->|"creates incidents"| node_incident_model

click node_entry "https://github.com/aadi3006/threatlenx/blob/main/app/page.tsx"
click node_hub "https://github.com/aadi3006/threatlenx/blob/main/app/spatial/hub/SpatialCommandHub.tsx"
click node_command "https://github.com/aadi3006/threatlenx/blob/main/app/spatial/command/CommandCenterWorkspace.tsx"
click node_investigation "https://github.com/aadi3006/threatlenx/blob/main/app/spatial/investigation/InvestigationHub.tsx"
click node_investigation_views "https://github.com/aadi3006/threatlenx/tree/main/app/spatial/investigation"
click node_hunting "https://github.com/aadi3006/threatlenx/blob/main/app/spatial/hunting/ThreatHuntingWorkspace.tsx"
click node_cases "https://github.com/aadi3006/threatlenx/blob/main/app/spatial/cases/CaseWorkspace.tsx"
click node_evidence "https://github.com/aadi3006/threatlenx/blob/main/app/spatial/evidence/EvidenceWorkspace.tsx"
click node_detection_ui "https://github.com/aadi3006/threatlenx/blob/main/app/spatial/detection/DetectionEngineeringWorkspace.tsx"
click node_ai_assistant "https://github.com/aadi3006/threatlenx/blob/main/app/spatial/ai/ContextualAiAssistant.tsx"
click node_service "https://github.com/aadi3006/threatlenx/blob/main/app/core/security-service.ts"
click node_canonical_events "https://github.com/aadi3006/threatlenx/blob/main/app/core/models/event.ts"
click node_incident_model "https://github.com/aadi3006/threatlenx/blob/main/app/core/models/incident.ts"
click node_detection_engine "https://github.com/aadi3006/threatlenx/blob/main/app/core/security/detection-engine.ts"
click node_hunt_engine "https://github.com/aadi3006/threatlenx/blob/main/app/core/hunting/threat-hunt-engine.ts"
click node_metrics "https://github.com/aadi3006/threatlenx/blob/main/app/core/metrics/metrics-engine.ts"
click node_bootstrap "https://github.com/aadi3006/threatlenx/blob/main/app/core/bootstrap.ts"
click node_local_provider "https://github.com/aadi3006/threatlenx/blob/main/app/core/providers/local-provider.ts"
click node_storage "https://github.com/aadi3006/threatlenx/blob/main/app/core/storage/idb-store.ts"
click node_integrations "https://github.com/aadi3006/threatlenx/blob/main/app/core/integration/sync-engine.ts"
click node_response_engine "https://github.com/aadi3006/threatlenx/blob/main/app/core/response/playbook-execution-engine.ts"
click node_simulation "https://github.com/aadi3006/threatlenx/blob/main/app/core/simulation/simulation-engine.ts"

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_entry,node_hub,node_command,node_investigation,node_investigation_views,node_hunting,node_cases,node_evidence,node_detection_ui,node_ai_assistant toneBlue
class node_service,node_canonical_events,node_incident_model,node_detection_engine,node_hunt_engine,node_metrics toneAmber
class node_bootstrap,node_local_provider,node_storage,node_integrations toneMint
class node_response_engine,node_simulation toneRose
class node_analyst toneIndigo
```

## Components

### Analyst Workspaces

- [Application Entry](https://github.com/aadi3006/threatlenx/blob/main/app/page.tsx): `app/page.tsx`
- [Spatial Command Hub](https://github.com/aadi3006/threatlenx/blob/main/app/spatial/hub/SpatialCommandHub.tsx): `app/spatial/hub/SpatialCommandHub.tsx`
- [Command Center](https://github.com/aadi3006/threatlenx/blob/main/app/spatial/command/CommandCenterWorkspace.tsx): `app/spatial/command/CommandCenterWorkspace.tsx`
- [Incident Investigation](https://github.com/aadi3006/threatlenx/blob/main/app/spatial/investigation/InvestigationHub.tsx): `app/spatial/investigation/InvestigationHub.tsx`
- [Investigation Views](https://github.com/aadi3006/threatlenx/tree/main/app/spatial/investigation): `app/spatial/investigation`
- [Threat Hunting](https://github.com/aadi3006/threatlenx/blob/main/app/spatial/hunting/ThreatHuntingWorkspace.tsx): `app/spatial/hunting/ThreatHuntingWorkspace.tsx`
- [Case Management](https://github.com/aadi3006/threatlenx/blob/main/app/spatial/cases/CaseWorkspace.tsx): `app/spatial/cases/CaseWorkspace.tsx`
- [Evidence Vault](https://github.com/aadi3006/threatlenx/blob/main/app/spatial/evidence/EvidenceWorkspace.tsx): `app/spatial/evidence/EvidenceWorkspace.tsx`
- [Detection Engineering](https://github.com/aadi3006/threatlenx/blob/main/app/spatial/detection/DetectionEngineeringWorkspace.tsx): `app/spatial/detection/DetectionEngineeringWorkspace.tsx`
- [AI Assistant](https://github.com/aadi3006/threatlenx/blob/main/app/spatial/ai/ContextualAiAssistant.tsx): `app/spatial/ai/ContextualAiAssistant.tsx`

### Security Operations

- [Security Service](https://github.com/aadi3006/threatlenx/blob/main/app/core/security-service.ts): `app/core/security-service.ts`
- [Event Model](https://github.com/aadi3006/threatlenx/blob/main/app/core/models/event.ts): `app/core/models/event.ts`
- [Incident Model](https://github.com/aadi3006/threatlenx/blob/main/app/core/models/incident.ts): `app/core/models/incident.ts`
- [Detection Engine](https://github.com/aadi3006/threatlenx/blob/main/app/core/security/detection-engine.ts): `app/core/security/detection-engine.ts`
- [Hunt Engine](https://github.com/aadi3006/threatlenx/blob/main/app/core/hunting/threat-hunt-engine.ts): `app/core/hunting/threat-hunt-engine.ts`
- [Metrics Engine](https://github.com/aadi3006/threatlenx/blob/main/app/core/metrics/metrics-engine.ts): `app/core/metrics/metrics-engine.ts`

### Local Platform

- [Application Bootstrap](https://github.com/aadi3006/threatlenx/blob/main/app/core/bootstrap.ts): `app/core/bootstrap.ts`
- [Local Provider](https://github.com/aadi3006/threatlenx/blob/main/app/core/providers/local-provider.ts): `app/core/providers/local-provider.ts`
- [IndexedDB Store](https://github.com/aadi3006/threatlenx/blob/main/app/core/storage/idb-store.ts): `app/core/storage/idb-store.ts`
- [Integration Sync](https://github.com/aadi3006/threatlenx/blob/main/app/core/integration/sync-engine.ts): `app/core/integration/sync-engine.ts`

### Response and Simulation

- [Playbook Execution](https://github.com/aadi3006/threatlenx/blob/main/app/core/response/playbook-execution-engine.ts): `app/core/response/playbook-execution-engine.ts`
- [Cyber-Range Simulation](https://github.com/aadi3006/threatlenx/blob/main/app/core/simulation/simulation-engine.ts): `app/core/simulation/simulation-engine.ts`

### Other components

- **SOC Analyst**

## Connections

- SOC Analyst → Application Entry: opens (evidence: `README.md`)
- Application Entry → Spatial Command Hub: renders (evidence: `app/page.tsx`)
- Application Entry → Application Bootstrap: initializes (evidence: `app/page.tsx`)
- Spatial Command Hub → Command Center: navigates to (evidence: `README.md`)
- Spatial Command Hub → Incident Investigation: navigates to (evidence: `README.md`)
- Spatial Command Hub → Threat Hunting: navigates to (evidence: `README.md`)
- Spatial Command Hub → Case Management: navigates to (evidence: `README.md`)
- Spatial Command Hub → Evidence Vault: navigates to (evidence: `README.md`)
- Spatial Command Hub → Detection Engineering: navigates to (evidence: `README.md`)
- Incident Investigation → Investigation Views: provides (evidence: `README.md`)
- Threat Hunting → Security Service: uses (evidence: `app/spatial/hunting/ThreatHuntingWorkspace.tsx`)
- Threat Hunting → AI Assistant: renders (evidence: `app/spatial/hunting/ThreatHuntingWorkspace.tsx`)
- Detection Engineering → Security Service: uses (evidence: `app/spatial/detection/DetectionEngineeringWorkspace.tsx`)
- AI Assistant → Security Service: uses (evidence: `app/spatial/ai/ContextualAiAssistant.tsx`)
- Security Service → Local Provider: delegates to (evidence: `app/core/security-service.ts`)
- Application Bootstrap → Security Service: initializes (evidence: `app/core/bootstrap.ts`)
- Application Bootstrap → Local Provider: configures (evidence: `app/core/bootstrap.ts`)
- Application Bootstrap → IndexedDB Store: configures (evidence: `app/core/bootstrap.ts`)
- Application Bootstrap → AI Assistant: configures AI (evidence: `app/core/bootstrap.ts`)
- Hunt Engine → Event Model: queries (evidence: `app/core/hunting/threat-hunt-engine.ts`)
- Detection Engine → Event Model: evaluates (evidence: `app/core/security/detection-engine.ts`)
- Cyber-Range Simulation → IndexedDB Store: reads and writes (evidence: `app/core/simulation/simulation-engine.ts`)
- Integration Sync → IndexedDB Store: reads and writes (evidence: `app/core/integration/sync-engine.ts`)
- Security Service → Incident Model: creates incidents (evidence: `app/core/security-service.ts`)
