# aditya-180404/cyberlab architecture

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

- Interactive diagram: https://gitdiagram.com/aditya-180404/cyberlab
- Repository: https://github.com/aditya-180404/cyberlab

## Overview

CyberLab is a cybersecurity lab and SOC platform. Users enter through the Next.js dashboard, select operational workspaces, and use a shared API client to reach FastAPI routes and domain services; results include inventory, detections, analysis, and response actions. The graph preserves the documented network, VM, endpoint, SIEM, digital-twin, purple-team, SOAR, vulnerability, and enterprise-site capabilities. Several route implementations and integrations are unsampled, so those links are omitted or marked unverified rather than inferred from module names.

Main entry points: [`backend/app/database/session.py`](https://github.com/aditya-180404/cyberlab/blob/main/backend/app/database/session.py) (Relational database), [`frontend/src/app/page.tsx`](https://github.com/aditya-180404/cyberlab/blob/main/frontend/src/app/page.tsx) (Dashboard workspace), [`frontend/src/lib/api.ts`](https://github.com/aditya-180404/cyberlab/blob/main/frontend/src/lib/api.ts) (API client), [`backend/app/main.py`](https://github.com/aditya-180404/cyberlab/blob/main/backend/app/main.py) (FastAPI application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["SOC interface"]
  node_dashboard["Dashboard workspace<br/>[page.tsx]"]
  node_api_client["API client<br/>[api.ts]"]
  node_inventory_ui["Asset inventory<br/>[AssetInventory.tsx]"]
  node_endpoint_ui["Endpoint fleet<br/>[EndpointFleet.tsx]"]
  node_network_ui["Network studio<br/>[NetworkStudio.tsx]"]
  node_vm_ui["VM management<br/>[VMManagement.tsx]"]
  node_siem_ui["SIEM dashboard<br/>[SIEMDashboard.tsx]"]
  node_twin_ui["Digital twin"]
  node_purple_ui["Purple-team studio"]
  node_soar_ui["SOAR response"]
  node_vuln_ui["Vulnerability management"]
  node_sites_ui["Enterprise sites"]
end

subgraph group_api["API and identity"]
  node_backend["FastAPI application<br/>[main.py]"]
  node_auth["Authentication routes<br/>[auth.py]"]
end

subgraph group_infra["Infrastructure"]
  node_agent_runtime["Endpoint agent<br/>[cyberlab_agent.py]"]
  node_inventory["Asset manager<br/>[asset_manager.py]"]
  node_network["Network orchestration<br/>[manager.py]"]
  node_vm["VM lifecycle manager<br/>[manager.py]"]
end

subgraph group_security["Security operations"]
  node_siem["Event detection<br/>[engine.py]"]
  node_twin["Attack-path analysis<br/>[graph_engine.py]"]
  node_purple["Purple-team validation<br/>[engine.py]"]
  node_soar["Response orchestration<br/>[engine.py]"]
  node_vuln["Vulnerability analysis<br/>[engine.py]"]
  node_sites["Site services<br/>[site_service.py]"]
end

subgraph group_data["Domain state"]
  node_store[("Relational database<br/>[session.py]")]
end

node_user(("SOC operator"))

node_user -->|"uses"| node_dashboard
node_dashboard -->|"selects workspace"| node_inventory_ui
node_dashboard -->|"selects workspace"| node_endpoint_ui
node_dashboard -->|"selects workspace"| node_network_ui
node_dashboard -->|"selects workspace"| node_vm_ui
node_dashboard -->|"selects workspace"| node_purple_ui
node_dashboard -->|"selects workspace"| node_vuln_ui
node_dashboard -->|"selects workspace"| node_sites_ui
node_inventory_ui -->|"requests data"| node_api_client
node_endpoint_ui -->|"requests data"| node_api_client
node_siem_ui -->|"requests data"| node_api_client
node_twin_ui -->|"requests analysis"| node_api_client
node_purple_ui -->|"requests validation"| node_api_client
node_vuln_ui -->|"requests analysis"| node_api_client
node_sites_ui -->|"requests site data"| node_api_client
node_api_client -.->|"calls REST API"| node_backend
node_backend -->|"registers routes"| node_auth
node_backend -->|"opens sessions"| node_store
node_auth -->|"reads and writes"| node_store
node_inventory -.->|"reads and writes"| node_store
node_network -->|"reads and writes"| node_store
node_vm -->|"reads and writes"| node_store
node_siem -->|"records detections"| node_store
node_purple -->|"evaluates detections"| node_siem
node_purple -.->|"records validations"| node_store
node_soar -.->|"records actions"| node_store
node_soar -->|"delegates VM actions"| node_vm
node_twin -.->|"reads topology state"| node_store
node_vuln -.->|"reads and writes"| node_store
node_sites -.->|"reads site records"| node_store
node_agent_runtime -.->|"reports telemetry"| node_backend

click node_dashboard "https://github.com/aditya-180404/cyberlab/blob/main/frontend/src/app/page.tsx"
click node_api_client "https://github.com/aditya-180404/cyberlab/blob/main/frontend/src/lib/api.ts"
click node_inventory_ui "https://github.com/aditya-180404/cyberlab/blob/main/frontend/src/components/inventory/AssetInventory.tsx"
click node_endpoint_ui "https://github.com/aditya-180404/cyberlab/blob/main/frontend/src/components/agent/EndpointFleet.tsx"
click node_network_ui "https://github.com/aditya-180404/cyberlab/blob/main/frontend/src/components/network/NetworkStudio.tsx"
click node_vm_ui "https://github.com/aditya-180404/cyberlab/blob/main/frontend/src/components/vm/VMManagement.tsx"
click node_siem_ui "https://github.com/aditya-180404/cyberlab/blob/main/frontend/src/components/siem/SIEMDashboard.tsx"
click node_twin_ui "https://github.com/aditya-180404/cyberlab/blob/main/frontend/src/components/digital_twin/DigitalTwinView.tsx"
click node_purple_ui "https://github.com/aditya-180404/cyberlab/blob/main/frontend/src/components/purple_team/PurpleTeamStudio.tsx"
click node_soar_ui "https://github.com/aditya-180404/cyberlab/blob/main/frontend/src/components/soar/IncidentResponseSOAR.tsx"
click node_vuln_ui "https://github.com/aditya-180404/cyberlab/blob/main/frontend/src/components/vulnerability/VulnerabilityManagement.tsx"
click node_sites_ui "https://github.com/aditya-180404/cyberlab/blob/main/frontend/src/components/enterprise/EnterpriseSitesView.tsx"
click node_backend "https://github.com/aditya-180404/cyberlab/blob/main/backend/app/main.py"
click node_auth "https://github.com/aditya-180404/cyberlab/blob/main/backend/app/api/v1/auth.py"
click node_agent_runtime "https://github.com/aditya-180404/cyberlab/blob/main/agent/cyberlab_agent.py"
click node_inventory "https://github.com/aditya-180404/cyberlab/blob/main/backend/app/inventory/asset_manager.py"
click node_network "https://github.com/aditya-180404/cyberlab/blob/main/backend/app/network/manager.py"
click node_vm "https://github.com/aditya-180404/cyberlab/blob/main/backend/app/vm/manager.py"
click node_siem "https://github.com/aditya-180404/cyberlab/blob/main/backend/app/siem/engine.py"
click node_twin "https://github.com/aditya-180404/cyberlab/blob/main/backend/app/digital_twin/graph_engine.py"
click node_purple "https://github.com/aditya-180404/cyberlab/blob/main/backend/app/purple_team/engine.py"
click node_soar "https://github.com/aditya-180404/cyberlab/blob/main/backend/app/soar/engine.py"
click node_vuln "https://github.com/aditya-180404/cyberlab/blob/main/backend/app/vulnerability/engine.py"
click node_sites "https://github.com/aditya-180404/cyberlab/blob/main/backend/app/enterprise/site_service.py"
click node_store "https://github.com/aditya-180404/cyberlab/blob/main/backend/app/database/session.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_dashboard,node_api_client,node_inventory_ui,node_endpoint_ui,node_network_ui,node_vm_ui,node_siem_ui,node_twin_ui,node_purple_ui,node_soar_ui,node_vuln_ui,node_sites_ui toneBlue
class node_backend,node_auth toneAmber
class node_agent_runtime,node_inventory,node_network,node_vm toneMint
class node_siem,node_twin,node_purple,node_soar,node_vuln,node_sites toneRose
class node_store,node_user toneIndigo
```

## Components

### SOC interface

- [Dashboard workspace](https://github.com/aditya-180404/cyberlab/blob/main/frontend/src/app/page.tsx): `frontend/src/app/page.tsx`
- [API client](https://github.com/aditya-180404/cyberlab/blob/main/frontend/src/lib/api.ts): `frontend/src/lib/api.ts`
- [Asset inventory](https://github.com/aditya-180404/cyberlab/blob/main/frontend/src/components/inventory/AssetInventory.tsx): `frontend/src/components/inventory/AssetInventory.tsx`
- [Endpoint fleet](https://github.com/aditya-180404/cyberlab/blob/main/frontend/src/components/agent/EndpointFleet.tsx): `frontend/src/components/agent/EndpointFleet.tsx`
- [Network studio](https://github.com/aditya-180404/cyberlab/blob/main/frontend/src/components/network/NetworkStudio.tsx): `frontend/src/components/network/NetworkStudio.tsx`
- [VM management](https://github.com/aditya-180404/cyberlab/blob/main/frontend/src/components/vm/VMManagement.tsx): `frontend/src/components/vm/VMManagement.tsx`
- [SIEM dashboard](https://github.com/aditya-180404/cyberlab/blob/main/frontend/src/components/siem/SIEMDashboard.tsx): `frontend/src/components/siem/SIEMDashboard.tsx`
- [Digital twin](https://github.com/aditya-180404/cyberlab/blob/main/frontend/src/components/digital_twin/DigitalTwinView.tsx): `frontend/src/components/digital_twin/DigitalTwinView.tsx`
- [Purple-team studio](https://github.com/aditya-180404/cyberlab/blob/main/frontend/src/components/purple_team/PurpleTeamStudio.tsx): `frontend/src/components/purple_team/PurpleTeamStudio.tsx`
- [SOAR response](https://github.com/aditya-180404/cyberlab/blob/main/frontend/src/components/soar/IncidentResponseSOAR.tsx): `frontend/src/components/soar/IncidentResponseSOAR.tsx`
- [Vulnerability management](https://github.com/aditya-180404/cyberlab/blob/main/frontend/src/components/vulnerability/VulnerabilityManagement.tsx): `frontend/src/components/vulnerability/VulnerabilityManagement.tsx`
- [Enterprise sites](https://github.com/aditya-180404/cyberlab/blob/main/frontend/src/components/enterprise/EnterpriseSitesView.tsx): `frontend/src/components/enterprise/EnterpriseSitesView.tsx`

### API and identity

- [FastAPI application](https://github.com/aditya-180404/cyberlab/blob/main/backend/app/main.py): `backend/app/main.py`
- [Authentication routes](https://github.com/aditya-180404/cyberlab/blob/main/backend/app/api/v1/auth.py): `backend/app/api/v1/auth.py`

### Infrastructure

- [Endpoint agent](https://github.com/aditya-180404/cyberlab/blob/main/agent/cyberlab_agent.py): `agent/cyberlab_agent.py`
- [Asset manager](https://github.com/aditya-180404/cyberlab/blob/main/backend/app/inventory/asset_manager.py): `backend/app/inventory/asset_manager.py`
- [Network orchestration](https://github.com/aditya-180404/cyberlab/blob/main/backend/app/network/manager.py): `backend/app/network/manager.py`
- [VM lifecycle manager](https://github.com/aditya-180404/cyberlab/blob/main/backend/app/vm/manager.py): `backend/app/vm/manager.py`

### Security operations

- [Event detection](https://github.com/aditya-180404/cyberlab/blob/main/backend/app/siem/engine.py): `backend/app/siem/engine.py`
- [Attack-path analysis](https://github.com/aditya-180404/cyberlab/blob/main/backend/app/digital_twin/graph_engine.py): `backend/app/digital_twin/graph_engine.py`
- [Purple-team validation](https://github.com/aditya-180404/cyberlab/blob/main/backend/app/purple_team/engine.py): `backend/app/purple_team/engine.py`
- [Response orchestration](https://github.com/aditya-180404/cyberlab/blob/main/backend/app/soar/engine.py): `backend/app/soar/engine.py`
- [Vulnerability analysis](https://github.com/aditya-180404/cyberlab/blob/main/backend/app/vulnerability/engine.py): `backend/app/vulnerability/engine.py`
- [Site services](https://github.com/aditya-180404/cyberlab/blob/main/backend/app/enterprise/site_service.py): `backend/app/enterprise/site_service.py`

### Domain state

- [Relational database](https://github.com/aditya-180404/cyberlab/blob/main/backend/app/database/session.py): `backend/app/database/session.py`

### Other components

- **SOC operator**

## Connections

- SOC operator → Dashboard workspace: uses (evidence: `frontend/src/app/page.tsx`)
- Dashboard workspace → Asset inventory: selects workspace (evidence: `frontend/src/app/page.tsx`)
- Dashboard workspace → Endpoint fleet: selects workspace (evidence: `frontend/src/app/page.tsx`)
- Dashboard workspace → Network studio: selects workspace (evidence: `frontend/src/app/page.tsx`)
- Dashboard workspace → VM management: selects workspace (evidence: `frontend/src/app/page.tsx`)
- Dashboard workspace → Purple-team studio: selects workspace (evidence: `frontend/src/app/page.tsx`)
- Dashboard workspace → Vulnerability management: selects workspace (evidence: `frontend/src/app/page.tsx`)
- Dashboard workspace → Enterprise sites: selects workspace (evidence: `frontend/src/app/page.tsx`)
- Asset inventory → API client: requests data (evidence: `frontend/src/components/inventory/AssetInventory.tsx`)
- Endpoint fleet → API client: requests data (evidence: `frontend/src/components/agent/EndpointFleet.tsx`)
- SIEM dashboard → API client: requests data (evidence: `frontend/src/components/siem/SIEMDashboard.tsx`)
- Digital twin → API client: requests analysis (evidence: `frontend/src/components/digital_twin/DigitalTwinView.tsx`)
- Purple-team studio → API client: requests validation (evidence: `frontend/src/components/purple_team/PurpleTeamStudio.tsx`)
- Vulnerability management → API client: requests analysis (evidence: `frontend/src/components/vulnerability/VulnerabilityManagement.tsx`)
- Enterprise sites → API client: requests site data (evidence: `frontend/src/components/enterprise/EnterpriseSitesView.tsx`)
- API client → FastAPI application: calls REST API
- FastAPI application → Authentication routes: registers routes (evidence: `backend/app/main.py`)
- FastAPI application → Relational database: opens sessions (evidence: `backend/app/main.py`)
- Authentication routes → Relational database: reads and writes (evidence: `backend/app/api/v1/auth.py`)
- Asset manager → Relational database: reads and writes
- Network orchestration → Relational database: reads and writes (evidence: `backend/app/network/manager.py`)
- VM lifecycle manager → Relational database: reads and writes (evidence: `backend/app/vm/manager.py`)
- Event detection → Relational database: records detections (evidence: `backend/app/siem/engine.py`)
- Purple-team validation → Event detection: evaluates detections (evidence: `backend/app/purple_team/engine.py`)
- Purple-team validation → Relational database: records validations
- Response orchestration → Relational database: records actions
- Response orchestration → VM lifecycle manager: delegates VM actions (evidence: `backend/app/soar/engine.py`)
- Attack-path analysis → Relational database: reads topology state
- Vulnerability analysis → Relational database: reads and writes
- Site services → Relational database: reads site records
- Endpoint agent → FastAPI application: reports telemetry
