# devansh7006/dikoryx architecture

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

- Interactive diagram: https://gitdiagram.com/devansh7006/dikoryx
- Repository: https://github.com/devansh7006/dikoryx

## Overview

Dikoryx is an insider-threat monitoring and CIS-compliance platform. Its endpoint agent gathers behavioral and host-security telemetry, sends it to a FastAPI service for ingestion and risk scoring, and exposes endpoint status and analysis through a React dashboard. The graph preserves the documented collection, enforcement, scoring, and analyst-visibility stages. Some agent wiring and frontend details are unsampled; those links rely on README statements where noted.

Main entry points: [`backend/main.py`](https://github.com/devansh7006/dikoryx/blob/main/backend/main.py) (Service routes), [`backend/api/telemetry.py`](https://github.com/devansh7006/dikoryx/blob/main/backend/api/telemetry.py) (Telemetry API), [`frontend/src/Pages/Dashboard.jsx`](https://github.com/devansh7006/dikoryx/blob/main/frontend/src/Pages/Dashboard.jsx) (Dashboard shell), [`agent/agent.py`](https://github.com/devansh7006/dikoryx/blob/main/agent/agent.py) (Agent orchestrator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_agent["Endpoint agent"]
  node_orchestrator["Agent orchestrator<br/>[agent.py]"]
  node_behavior["Behavior collectors"]
  node_usb["USB monitoring<br/>[usb_monitor.py]"]
  node_usbintel["USB device intelligence<br/>[device_intel.py]"]
  node_compliance["CIS audit and enforcement<br/>[compliance.py]"]
  node_sender["Agent HTTP client<br/>[http_client.py]"]
  node_retry["Retry handling<br/>[retry.py]"]
end

subgraph group_backend["Ingestion and analysis"]
  node_ingest["Telemetry API<br/>[telemetry.py]"]
  node_agentauth["Agent authentication<br/>[agent_auth.py]"]
  node_risk["Risk scoring<br/>[risk_engine.py]"]
  node_api["Service routes<br/>[main.py]"]
  node_auth["User authentication<br/>[auth.py]"]
end

subgraph group_frontend["SOC dashboard"]
  node_app["Application and login<br/>[App.jsx]"]
  node_dashboard["Dashboard shell<br/>[Dashboard.jsx]"]
  node_api_client["Frontend API client<br/>[api.js]"]
  node_systems["Endpoint selection<br/>[SystemList.jsx]"]
  node_details["Endpoint details<br/>[SystemDetails.jsx]"]
  node_charts["Telemetry charts<br/>[AgentCharts.jsx]"]
end

subgraph group_persistence["Persistence"]
  node_store[("Database<br/>[database.py]")]
  node_state["Live agent state<br/>[state.py]"]
end

node_analyst(("Security analyst"))
node_browser(("Web browser"))

node_analyst -->|"uses"| node_browser
node_browser -.->|"opens"| node_app
node_app -->|"renders"| node_dashboard
node_app -->|"requests agents"| node_api_client
node_dashboard -->|"loads data"| node_api_client
node_dashboard -->|"renders"| node_systems
node_dashboard -->|"renders"| node_details
node_details -->|"fetches details"| node_api_client
node_api_client -->|"calls REST APIs"| node_api
node_api -->|"routes login"| node_auth
node_api -->|"routes telemetry"| node_ingest
node_api -->|"computes risk"| node_risk
node_api -->|"rehydrates records"| node_store
node_api -->|"reads live state"| node_state
node_auth -->|"reads and writes users"| node_store
node_ingest -->|"authenticates agent"| node_agentauth
node_ingest -->|"persists events"| node_store
node_ingest -->|"updates state"| node_state
node_risk -.->|"saves risk records"| node_store
node_orchestrator -.->|"collects telemetry"| node_behavior
node_orchestrator -->|"starts monitor"| node_usb
node_usb -->|"analyzes devices"| node_usbintel
node_usb -->|"posts USB events"| node_ingest
node_compliance -.->|"reports enforcement"| node_orchestrator
node_orchestrator -.->|"sends telemetry"| node_sender
node_sender -->|"retries requests"| node_retry
node_sender -.->|"posts batches"| node_ingest
node_details -.->|"displays telemetry"| node_charts

click node_orchestrator "https://github.com/devansh7006/dikoryx/blob/main/agent/agent.py"
click node_behavior "https://github.com/devansh7006/dikoryx/tree/main/agent/collectors/windows"
click node_usb "https://github.com/devansh7006/dikoryx/blob/main/agent/usb_monitor.py"
click node_usbintel "https://github.com/devansh7006/dikoryx/blob/main/agent/collectors/usb/device_intel.py"
click node_compliance "https://github.com/devansh7006/dikoryx/blob/main/agent/collectors/windows/compliance.py"
click node_sender "https://github.com/devansh7006/dikoryx/blob/main/agent/http_client.py"
click node_retry "https://github.com/devansh7006/dikoryx/blob/main/agent/retry.py"
click node_ingest "https://github.com/devansh7006/dikoryx/blob/main/backend/api/telemetry.py"
click node_agentauth "https://github.com/devansh7006/dikoryx/blob/main/backend/agent_auth.py"
click node_risk "https://github.com/devansh7006/dikoryx/blob/main/backend/risk_engine.py"
click node_api "https://github.com/devansh7006/dikoryx/blob/main/backend/main.py"
click node_auth "https://github.com/devansh7006/dikoryx/blob/main/backend/api/auth.py"
click node_store "https://github.com/devansh7006/dikoryx/blob/main/backend/database.py"
click node_state "https://github.com/devansh7006/dikoryx/blob/main/backend/state.py"
click node_app "https://github.com/devansh7006/dikoryx/blob/main/frontend/src/App.jsx"
click node_dashboard "https://github.com/devansh7006/dikoryx/blob/main/frontend/src/Pages/Dashboard.jsx"
click node_api_client "https://github.com/devansh7006/dikoryx/blob/main/frontend/src/api.js"
click node_systems "https://github.com/devansh7006/dikoryx/blob/main/frontend/src/components/SystemList.jsx"
click node_details "https://github.com/devansh7006/dikoryx/blob/main/frontend/src/components/SystemDetails.jsx"
click node_charts "https://github.com/devansh7006/dikoryx/blob/main/frontend/src/components/AgentCharts.jsx"

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_orchestrator,node_behavior,node_usb,node_usbintel,node_compliance,node_sender,node_retry,node_browser toneBlue
class node_ingest,node_agentauth,node_risk,node_api,node_auth toneAmber
class node_app,node_dashboard,node_api_client,node_systems,node_details,node_charts toneMint
class node_store,node_state toneRose
class node_analyst toneIndigo
```

## Components

### Endpoint agent

- [Agent orchestrator](https://github.com/devansh7006/dikoryx/blob/main/agent/agent.py): `agent/agent.py`
- [Behavior collectors](https://github.com/devansh7006/dikoryx/tree/main/agent/collectors/windows): `agent/collectors/windows`
- [USB monitoring](https://github.com/devansh7006/dikoryx/blob/main/agent/usb_monitor.py): `agent/usb_monitor.py`
- [USB device intelligence](https://github.com/devansh7006/dikoryx/blob/main/agent/collectors/usb/device_intel.py): `agent/collectors/usb/device_intel.py`
- [CIS audit and enforcement](https://github.com/devansh7006/dikoryx/blob/main/agent/collectors/windows/compliance.py): `agent/collectors/windows/compliance.py`
- [Agent HTTP client](https://github.com/devansh7006/dikoryx/blob/main/agent/http_client.py): `agent/http_client.py`
- [Retry handling](https://github.com/devansh7006/dikoryx/blob/main/agent/retry.py): `agent/retry.py`

### Ingestion and analysis

- [Telemetry API](https://github.com/devansh7006/dikoryx/blob/main/backend/api/telemetry.py): `backend/api/telemetry.py`
- [Agent authentication](https://github.com/devansh7006/dikoryx/blob/main/backend/agent_auth.py): `backend/agent_auth.py`
- [Risk scoring](https://github.com/devansh7006/dikoryx/blob/main/backend/risk_engine.py): `backend/risk_engine.py`
- [Service routes](https://github.com/devansh7006/dikoryx/blob/main/backend/main.py): `backend/main.py`
- [User authentication](https://github.com/devansh7006/dikoryx/blob/main/backend/api/auth.py): `backend/api/auth.py`

### SOC dashboard

- [Application and login](https://github.com/devansh7006/dikoryx/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Dashboard shell](https://github.com/devansh7006/dikoryx/blob/main/frontend/src/Pages/Dashboard.jsx): `frontend/src/Pages/Dashboard.jsx`
- [Frontend API client](https://github.com/devansh7006/dikoryx/blob/main/frontend/src/api.js): `frontend/src/api.js`
- [Endpoint selection](https://github.com/devansh7006/dikoryx/blob/main/frontend/src/components/SystemList.jsx): `frontend/src/components/SystemList.jsx`
- [Endpoint details](https://github.com/devansh7006/dikoryx/blob/main/frontend/src/components/SystemDetails.jsx): `frontend/src/components/SystemDetails.jsx`
- [Telemetry charts](https://github.com/devansh7006/dikoryx/blob/main/frontend/src/components/AgentCharts.jsx): `frontend/src/components/AgentCharts.jsx`

### Persistence

- [Database](https://github.com/devansh7006/dikoryx/blob/main/backend/database.py): `backend/database.py`
- [Live agent state](https://github.com/devansh7006/dikoryx/blob/main/backend/state.py): `backend/state.py`

### Other components

- **Security analyst**
- **Web browser**

## Connections

- Security analyst → Web browser: uses
- Web browser → Application and login: opens
- Application and login → Dashboard shell: renders (evidence: `frontend/src/App.jsx`)
- Application and login → Frontend API client: requests agents (evidence: `frontend/src/App.jsx`)
- Dashboard shell → Frontend API client: loads data (evidence: `frontend/src/Pages/Dashboard.jsx`)
- Dashboard shell → Endpoint selection: renders (evidence: `frontend/src/Pages/Dashboard.jsx`)
- Dashboard shell → Endpoint details: renders (evidence: `frontend/src/Pages/Dashboard.jsx`)
- Endpoint details → Frontend API client: fetches details (evidence: `frontend/src/components/SystemDetails.jsx`)
- Frontend API client → Service routes: calls REST APIs (evidence: `frontend/src/api.js`)
- Service routes → User authentication: routes login (evidence: `backend/main.py`)
- Service routes → Telemetry API: routes telemetry (evidence: `backend/main.py`)
- Service routes → Risk scoring: computes risk (evidence: `backend/main.py`)
- Service routes → Database: rehydrates records (evidence: `backend/main.py`)
- Service routes → Live agent state: reads live state (evidence: `backend/main.py`)
- User authentication → Database: reads and writes users (evidence: `backend/api/auth.py`)
- Telemetry API → Agent authentication: authenticates agent (evidence: `backend/api/telemetry.py`)
- Telemetry API → Database: persists events (evidence: `backend/api/telemetry.py`)
- Telemetry API → Live agent state: updates state (evidence: `backend/api/telemetry.py`)
- Risk scoring → Database: saves risk records
- Agent orchestrator → Behavior collectors: collects telemetry
- Agent orchestrator → USB monitoring: starts monitor (evidence: `agent/agent.py`)
- USB monitoring → USB device intelligence: analyzes devices
- USB monitoring → Telemetry API: posts USB events
- CIS audit and enforcement → Agent orchestrator: reports enforcement
- Agent orchestrator → Agent HTTP client: sends telemetry
- Agent HTTP client → Retry handling: retries requests (evidence: `agent/http_client.py`)
- Agent HTTP client → Telemetry API: posts batches
- Endpoint details → Telemetry charts: displays telemetry
