# dhruvasai/garuda- architecture

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

- Interactive diagram: https://gitdiagram.com/dhruvasai/garuda-
- Repository: https://github.com/dhruvasai/garuda-

## Overview

GARUDA is a full-stack network security guardian: its dashboard exposes network discovery and monitoring, behavioral and threat detection, host scanning, firewall controls, and a cryptographic incident ledger. The principal workflow is to inspect network/device posture, detect risks, present findings, and support defensive response and forensic review. The API’s service wiring is supported by the main.py reference index; some monitor, frontend, and unsampled subsystem relationships are shown only as unverified where appropriate.

Main entry points: [`backend/app/main.py`](https://github.com/dhruvasai/garuda-/blob/main/backend/app/main.py) (HTTP API), [`backend/app/services/monitor.py`](https://github.com/dhruvasai/garuda-/blob/main/backend/app/services/monitor.py) (Security monitor), [`frontend/app.js`](https://github.com/dhruvasai/garuda-/blob/main/frontend/app.js) (Security dashboard), [`backend/app/database.py`](https://github.com/dhruvasai/garuda-/blob/main/backend/app/database.py) (Database setup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Dashboard experience"]
  node_dashboard["Security dashboard<br/>[app.js]"]
  node_spatial["3D topology<br/>[topology3d.js]"]
end

subgraph group_api["API and persistence"]
  node_api_entry["HTTP API<br/>[main.py]"]
  node_schemas["API schemas<br/>[schemas.py]"]
  node_monitor["Security monitor<br/>[monitor.py]"]
  node_database[("Database setup<br/>[database.py]")]
  node_models["Security records<br/>[models.py]"]
end

subgraph group_network["Network visibility"]
  node_network_info["Network detector"]
  node_device_scan["Device discovery<br/>[device_scanner.py]"]
  node_oui["Vendor lookup<br/>[oui_db.py]"]
end

subgraph group_defense["Detection and response"]
  node_ids["Intrusion detection<br/>[ids_engine.py]"]
  node_ml["Behavioral anomaly engine<br/>[ml_engine.py]"]
  node_malware["Malware scanner<br/>[malware_scanner.py]"]
  node_firewall["Firewall controls"]
  node_advisor["Security advisor<br/>[advisor.py]"]
  node_notifier["Notifications<br/>[notifier.py]"]
end

subgraph group_forensics["Forensics and trust"]
  node_ledger[("Attestation ledger")]
  node_contract["Attestation contract"]
end

node_operator(("Operator"))
node_threat_feed["Abuse.ch feed"]

node_operator -->|"uses"| node_dashboard
node_dashboard -.->|"requests data"| node_api_entry
node_dashboard -.->|"pairs topology"| node_spatial
node_api_entry -->|"validates with"| node_schemas
node_api_entry -->|"queries"| node_monitor
node_api_entry -->|"gets sessions"| node_database
node_database -->|"creates tables"| node_models
node_database -->|"provides sessions"| node_api_entry
node_api_entry -->|"routes detection"| node_ids
node_api_entry -->|"routes analysis"| node_ml
node_api_entry -->|"runs scans"| node_malware
node_api_entry -->|"enforces blocks"| node_firewall
node_api_entry -->|"serves proofs"| node_ledger
node_ids -->|"uses network data"| node_network_info
node_device_scan -->|"uses network data"| node_network_info
node_device_scan -->|"looks up vendors"| node_oui
node_malware -->|"downloads indicators"| node_threat_feed
node_ledger -->|"stores blocks"| node_models
node_ledger -.->|"anchors roots"| node_contract
node_monitor -.->|"collects devices"| node_device_scan
node_monitor -.->|"builds advice"| node_advisor
node_monitor -.->|"sends alerts"| node_notifier

click node_dashboard "https://github.com/dhruvasai/garuda-/blob/main/frontend/app.js"
click node_spatial "https://github.com/dhruvasai/garuda-/blob/main/frontend/topology3d.js"
click node_api_entry "https://github.com/dhruvasai/garuda-/blob/main/backend/app/main.py"
click node_schemas "https://github.com/dhruvasai/garuda-/blob/main/backend/app/schemas.py"
click node_monitor "https://github.com/dhruvasai/garuda-/blob/main/backend/app/services/monitor.py"
click node_database "https://github.com/dhruvasai/garuda-/blob/main/backend/app/database.py"
click node_models "https://github.com/dhruvasai/garuda-/blob/main/backend/app/models.py"
click node_network_info "https://github.com/dhruvasai/garuda-/blob/main/backend/app/services/network_detector.py"
click node_device_scan "https://github.com/dhruvasai/garuda-/blob/main/backend/app/services/device_scanner.py"
click node_oui "https://github.com/dhruvasai/garuda-/blob/main/backend/app/services/oui_db.py"
click node_ids "https://github.com/dhruvasai/garuda-/blob/main/backend/app/services/ids_engine.py"
click node_ml "https://github.com/dhruvasai/garuda-/blob/main/backend/app/services/ml_engine.py"
click node_malware "https://github.com/dhruvasai/garuda-/blob/main/backend/app/services/malware_scanner.py"
click node_firewall "https://github.com/dhruvasai/garuda-/blob/main/backend/app/services/firewall_manager.py"
click node_advisor "https://github.com/dhruvasai/garuda-/blob/main/backend/app/services/advisor.py"
click node_notifier "https://github.com/dhruvasai/garuda-/blob/main/backend/app/services/notifier.py"
click node_ledger "https://github.com/dhruvasai/garuda-/blob/main/backend/app/services/attestation_ledger.py"
click node_contract "https://github.com/dhruvasai/garuda-/blob/main/contracts/GarudaAttestation.sol"

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_spatial toneBlue
class node_api_entry,node_schemas,node_monitor,node_database,node_models toneAmber
class node_network_info,node_device_scan,node_oui toneMint
class node_ids,node_ml,node_malware,node_firewall,node_advisor,node_notifier toneRose
class node_ledger,node_contract,node_operator,node_threat_feed toneIndigo
```

## Components

### Dashboard experience

- [Security dashboard](https://github.com/dhruvasai/garuda-/blob/main/frontend/app.js): `frontend/app.js`
- [3D topology](https://github.com/dhruvasai/garuda-/blob/main/frontend/topology3d.js): `frontend/topology3d.js`

### API and persistence

- [HTTP API](https://github.com/dhruvasai/garuda-/blob/main/backend/app/main.py): `backend/app/main.py`
- [API schemas](https://github.com/dhruvasai/garuda-/blob/main/backend/app/schemas.py): `backend/app/schemas.py`
- [Security monitor](https://github.com/dhruvasai/garuda-/blob/main/backend/app/services/monitor.py): `backend/app/services/monitor.py`
- [Database setup](https://github.com/dhruvasai/garuda-/blob/main/backend/app/database.py): `backend/app/database.py`
- [Security records](https://github.com/dhruvasai/garuda-/blob/main/backend/app/models.py): `backend/app/models.py`

### Network visibility

- [Network detector](https://github.com/dhruvasai/garuda-/blob/main/backend/app/services/network_detector.py): `backend/app/services/network_detector.py`
- [Device discovery](https://github.com/dhruvasai/garuda-/blob/main/backend/app/services/device_scanner.py): `backend/app/services/device_scanner.py`
- [Vendor lookup](https://github.com/dhruvasai/garuda-/blob/main/backend/app/services/oui_db.py): `backend/app/services/oui_db.py`

### Detection and response

- [Intrusion detection](https://github.com/dhruvasai/garuda-/blob/main/backend/app/services/ids_engine.py): `backend/app/services/ids_engine.py`
- [Behavioral anomaly engine](https://github.com/dhruvasai/garuda-/blob/main/backend/app/services/ml_engine.py): `backend/app/services/ml_engine.py`
- [Malware scanner](https://github.com/dhruvasai/garuda-/blob/main/backend/app/services/malware_scanner.py): `backend/app/services/malware_scanner.py`
- [Firewall controls](https://github.com/dhruvasai/garuda-/blob/main/backend/app/services/firewall_manager.py): `backend/app/services/firewall_manager.py`
- [Security advisor](https://github.com/dhruvasai/garuda-/blob/main/backend/app/services/advisor.py): `backend/app/services/advisor.py`
- [Notifications](https://github.com/dhruvasai/garuda-/blob/main/backend/app/services/notifier.py): `backend/app/services/notifier.py`

### Forensics and trust

- [Attestation ledger](https://github.com/dhruvasai/garuda-/blob/main/backend/app/services/attestation_ledger.py): `backend/app/services/attestation_ledger.py`
- [Attestation contract](https://github.com/dhruvasai/garuda-/blob/main/contracts/GarudaAttestation.sol): `contracts/GarudaAttestation.sol`

### Other components

- **Operator**
- **Abuse.ch feed**

## Connections

- Operator → Security dashboard: uses (evidence: `README.md`)
- Security dashboard → HTTP API: requests data
- Security dashboard → 3D topology: pairs topology (evidence: `README.md`)
- HTTP API → API schemas: validates with (evidence: `backend/app/main.py`)
- HTTP API → Security monitor: queries (evidence: `backend/app/main.py`)
- HTTP API → Database setup: gets sessions (evidence: `backend/app/main.py`)
- Database setup → Security records: creates tables (evidence: `backend/app/database.py`)
- Database setup → HTTP API: provides sessions (evidence: `backend/app/database.py`)
- HTTP API → Intrusion detection: routes detection (evidence: `backend/app/main.py`)
- HTTP API → Behavioral anomaly engine: routes analysis (evidence: `backend/app/main.py`)
- HTTP API → Malware scanner: runs scans (evidence: `backend/app/main.py`)
- HTTP API → Firewall controls: enforces blocks (evidence: `backend/app/main.py`)
- HTTP API → Attestation ledger: serves proofs (evidence: `backend/app/main.py`)
- Intrusion detection → Network detector: uses network data (evidence: `backend/app/services/ids_engine.py`)
- Device discovery → Network detector: uses network data (evidence: `backend/app/services/device_scanner.py`)
- Device discovery → Vendor lookup: looks up vendors (evidence: `backend/app/services/device_scanner.py`)
- Malware scanner → Abuse.ch feed: downloads indicators (evidence: `backend/app/services/malware_scanner.py`)
- Attestation ledger → Security records: stores blocks (evidence: `backend/app/services/attestation_ledger.py`)
- Attestation ledger → Attestation contract: anchors roots (evidence: `README.md`)
- Security monitor → Device discovery: collects devices
- Security monitor → Security advisor: builds advice
- Security monitor → Notifications: sends alerts
