# devansh7006/kavach architecture

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

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

## Overview

KAVACH is a cyber-intelligence and multimedia-forensics suite: users submit email or media evidence through a React HUD, receive analysis from FastAPI services, and inspect results in forensic tabs, the AURA globe, or an incident dossier. The graph preserves email parsing and learning, image/video/audio analysis, and geospatial and satellite telemetry. Backend routing is supported by the main-module excerpt and SOURCE INDEX; UI-to-backend connections reflect the README’s documented REST topology, not inspected request code.

Main entry points: [`backend/main.py`](https://github.com/devansh7006/kavach/blob/main/backend/main.py) (FastAPI Routes), [`frontend/src/App.jsx`](https://github.com/devansh7006/kavach/blob/main/frontend/src/App.jsx) (Command HUD), [`backend/email_defense/parser.py`](https://github.com/devansh7006/kavach/blob/main/backend/email_defense/parser.py) (Email Parser), [`frontend/src/components/EmailDefenseTab.jsx`](https://github.com/devansh7006/kavach/blob/main/frontend/src/components/EmailDefenseTab.jsx) (Email Console)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Investigation HUD"]
  node_hud["Command HUD<br/>[App.jsx]"]
  node_emailtab["Email Console"]
  node_imagetab["Image Inspector"]
  node_videotab["Video Inspector"]
  node_audiotab["Audio Inspector"]
  node_dossierui["Dossier Export"]
  node_globe["AURA Globe<br/>[AstralisGlobe.jsx]"]
end

subgraph group_email["Email Defense"]
  node_parser["Email Parser<br/>[parser.py]"]
  node_geoip["GeoIP Resolver<br/>[geoip.py]"]
  node_grey["GreyNoise Intel<br/>[greynoise_intel.py]"]
  node_classifier["Phishing Classifier<br/>[classifier.py]"]
  node_dataset[("Learning Dataset<br/>[dataset.py]")]
end

subgraph group_media["Media Forensics"]
  node_image["Image Analysis<br/>[image_forensics.py]"]
  node_video["Video Analysis<br/>[video_forensics.py]"]
  node_audio["Audio Analysis<br/>[audio_forensics.py]"]
end

subgraph group_spatial["Spatial Intelligence"]
  node_satellite["Satellite Tracker"]
  node_threats["Threat Telemetry<br/>[threat_stream.py]"]
end

node_investigator(("Investigator"))
node_api["FastAPI Routes<br/>[main.py]"]

node_investigator -->|"uses"| node_hud
node_hud -->|"opens"| node_emailtab
node_hud -->|"opens"| node_imagetab
node_hud -->|"opens"| node_videotab
node_hud -->|"opens"| node_audiotab
node_hud -->|"opens"| node_dossierui
node_hud -->|"shows"| node_globe
node_emailtab -->|"submits email"| node_api
node_imagetab -->|"submits image"| node_api
node_videotab -->|"submits video"| node_api
node_audiotab -->|"submits audio"| node_api
node_dossierui -->|"requests report"| node_api
node_api -->|"parses email"| node_parser
node_api -->|"classifies email"| node_classifier
node_api -->|"reads and retrains"| node_dataset
node_parser -->|"resolves hops"| node_geoip
node_parser -->|"checks threat intel"| node_grey
node_classifier -->|"trains from"| node_dataset
node_api -->|"analyzes image"| node_image
node_api -->|"analyzes video"| node_video
node_api -->|"analyzes audio"| node_audio
node_video -->|"uses ELA"| node_image
node_api -->|"serves telemetry"| node_satellite
node_api -->|"serves telemetry"| node_threats
node_globe -->|"gets geospatial data"| node_api

click node_hud "https://github.com/devansh7006/kavach/blob/main/frontend/src/App.jsx"
click node_emailtab "https://github.com/devansh7006/kavach/blob/main/frontend/src/components/EmailDefenseTab.jsx"
click node_imagetab "https://github.com/devansh7006/kavach/blob/main/frontend/src/components/ImageForensicsTab.jsx"
click node_videotab "https://github.com/devansh7006/kavach/blob/main/frontend/src/components/VideoForensicsTab.jsx"
click node_audiotab "https://github.com/devansh7006/kavach/blob/main/frontend/src/components/AudioForensicsTab.jsx"
click node_dossierui "https://github.com/devansh7006/kavach/blob/main/frontend/src/components/DossierExportTab.jsx"
click node_globe "https://github.com/devansh7006/kavach/blob/main/frontend/src/components/AstralisGlobe.jsx"
click node_api "https://github.com/devansh7006/kavach/blob/main/backend/main.py"
click node_parser "https://github.com/devansh7006/kavach/blob/main/backend/email_defense/parser.py"
click node_geoip "https://github.com/devansh7006/kavach/blob/main/backend/email_defense/geoip.py"
click node_grey "https://github.com/devansh7006/kavach/blob/main/backend/email_defense/greynoise_intel.py"
click node_classifier "https://github.com/devansh7006/kavach/blob/main/backend/email_defense/classifier.py"
click node_dataset "https://github.com/devansh7006/kavach/blob/main/backend/email_defense/dataset.py"
click node_image "https://github.com/devansh7006/kavach/blob/main/backend/media_defense/image_forensics.py"
click node_video "https://github.com/devansh7006/kavach/blob/main/backend/media_defense/video_forensics.py"
click node_audio "https://github.com/devansh7006/kavach/blob/main/backend/media_defense/audio_forensics.py"
click node_satellite "https://github.com/devansh7006/kavach/blob/main/backend/gods_eye/satellite_tracker.py"
click node_threats "https://github.com/devansh7006/kavach/blob/main/backend/gods_eye/threat_stream.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_hud,node_emailtab,node_imagetab,node_videotab,node_audiotab,node_dossierui,node_globe toneBlue
class node_parser,node_geoip,node_grey,node_classifier,node_dataset toneAmber
class node_image,node_video,node_audio,node_api toneMint
class node_satellite,node_threats toneRose
class node_investigator toneIndigo
```

## Components

### Investigation HUD

- [Command HUD](https://github.com/devansh7006/kavach/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Email Console](https://github.com/devansh7006/kavach/blob/main/frontend/src/components/EmailDefenseTab.jsx): `frontend/src/components/EmailDefenseTab.jsx`
- [Image Inspector](https://github.com/devansh7006/kavach/blob/main/frontend/src/components/ImageForensicsTab.jsx): `frontend/src/components/ImageForensicsTab.jsx`
- [Video Inspector](https://github.com/devansh7006/kavach/blob/main/frontend/src/components/VideoForensicsTab.jsx): `frontend/src/components/VideoForensicsTab.jsx`
- [Audio Inspector](https://github.com/devansh7006/kavach/blob/main/frontend/src/components/AudioForensicsTab.jsx): `frontend/src/components/AudioForensicsTab.jsx`
- [Dossier Export](https://github.com/devansh7006/kavach/blob/main/frontend/src/components/DossierExportTab.jsx): `frontend/src/components/DossierExportTab.jsx`
- [AURA Globe](https://github.com/devansh7006/kavach/blob/main/frontend/src/components/AstralisGlobe.jsx): `frontend/src/components/AstralisGlobe.jsx`

### Email Defense

- [Email Parser](https://github.com/devansh7006/kavach/blob/main/backend/email_defense/parser.py): `backend/email_defense/parser.py`
- [GeoIP Resolver](https://github.com/devansh7006/kavach/blob/main/backend/email_defense/geoip.py): `backend/email_defense/geoip.py`
- [GreyNoise Intel](https://github.com/devansh7006/kavach/blob/main/backend/email_defense/greynoise_intel.py): `backend/email_defense/greynoise_intel.py`
- [Phishing Classifier](https://github.com/devansh7006/kavach/blob/main/backend/email_defense/classifier.py): `backend/email_defense/classifier.py`
- [Learning Dataset](https://github.com/devansh7006/kavach/blob/main/backend/email_defense/dataset.py): `backend/email_defense/dataset.py`

### Media Forensics

- [Image Analysis](https://github.com/devansh7006/kavach/blob/main/backend/media_defense/image_forensics.py): `backend/media_defense/image_forensics.py`
- [Video Analysis](https://github.com/devansh7006/kavach/blob/main/backend/media_defense/video_forensics.py): `backend/media_defense/video_forensics.py`
- [Audio Analysis](https://github.com/devansh7006/kavach/blob/main/backend/media_defense/audio_forensics.py): `backend/media_defense/audio_forensics.py`

### Spatial Intelligence

- [Satellite Tracker](https://github.com/devansh7006/kavach/blob/main/backend/gods_eye/satellite_tracker.py): `backend/gods_eye/satellite_tracker.py`
- [Threat Telemetry](https://github.com/devansh7006/kavach/blob/main/backend/gods_eye/threat_stream.py): `backend/gods_eye/threat_stream.py`

### Other components

- **Investigator**
- [FastAPI Routes](https://github.com/devansh7006/kavach/blob/main/backend/main.py): `backend/main.py`

## Connections

- Investigator → Command HUD: uses (evidence: `README.md`)
- Command HUD → Email Console: opens (evidence: `frontend/src/App.jsx`)
- Command HUD → Image Inspector: opens (evidence: `frontend/src/App.jsx`)
- Command HUD → Video Inspector: opens (evidence: `frontend/src/App.jsx`)
- Command HUD → Audio Inspector: opens (evidence: `frontend/src/App.jsx`)
- Command HUD → Dossier Export: opens (evidence: `frontend/src/App.jsx`)
- Command HUD → AURA Globe: shows (evidence: `frontend/src/App.jsx`)
- Email Console → FastAPI Routes: submits email (evidence: `README.md`)
- Image Inspector → FastAPI Routes: submits image (evidence: `README.md`)
- Video Inspector → FastAPI Routes: submits video (evidence: `README.md`)
- Audio Inspector → FastAPI Routes: submits audio (evidence: `README.md`)
- Dossier Export → FastAPI Routes: requests report (evidence: `README.md`)
- FastAPI Routes → Email Parser: parses email (evidence: `backend/main.py`)
- FastAPI Routes → Phishing Classifier: classifies email (evidence: `backend/main.py`)
- FastAPI Routes → Learning Dataset: reads and retrains (evidence: `backend/main.py`)
- Email Parser → GeoIP Resolver: resolves hops (evidence: `backend/email_defense/parser.py`)
- Email Parser → GreyNoise Intel: checks threat intel (evidence: `backend/email_defense/parser.py`)
- Phishing Classifier → Learning Dataset: trains from (evidence: `backend/email_defense/classifier.py`)
- FastAPI Routes → Image Analysis: analyzes image (evidence: `backend/main.py`)
- FastAPI Routes → Video Analysis: analyzes video (evidence: `backend/main.py`)
- FastAPI Routes → Audio Analysis: analyzes audio (evidence: `backend/main.py`)
- Video Analysis → Image Analysis: uses ELA (evidence: `backend/media_defense/video_forensics.py`)
- FastAPI Routes → Satellite Tracker: serves telemetry (evidence: `backend/main.py`)
- FastAPI Routes → Threat Telemetry: serves telemetry (evidence: `backend/main.py`)
- AURA Globe → FastAPI Routes: gets geospatial data (evidence: `README.md`)
