# jyothirmaeenuthalapati/cyber-kavach architecture

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

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

## Overview

Cyber Kavach is a multilingual cybercrime triage and legal-aid application. Users submit suspicious text or files through the interface; the backend analyzes the submission and returns a risk assessment. The README also documents FIR drafting and spoken guidance as separate capabilities. The sampled files show the analysis model call, legal-drafting model call, and speech synthesis, but do not establish frontend wiring for legal or speech endpoints. The tree also lacks the `routes/` directory imported by `main.py`, so route-module links are omitted.

Main entry points: [`main.py`](https://github.com/jyothirmaeenuthalapati/cyber-kavach/blob/main/main.py) (FastAPI application), [`analyze.py`](https://github.com/jyothirmaeenuthalapati/cyber-kavach/blob/main/analyze.py) (Threat analysis), [`App.jsx`](https://github.com/jyothirmaeenuthalapati/cyber-kavach/blob/main/App.jsx) (Cyber Kavach UI), [`legal.py`](https://github.com/jyothirmaeenuthalapati/cyber-kavach/blob/main/legal.py) (FIR drafting)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["User interface"]
  node_app["Cyber Kavach UI<br/>[App.jsx]"]
end

subgraph group_backend["API backend"]
  node_api["FastAPI application<br/>[main.py]"]
end

subgraph group_triage["Threat triage"]
  node_analysis["Threat analysis<br/>[analyze.py]"]
  node_hf_analysis{{"Hugging Face model"}}
  node_virustotal{{"VirusTotal scan"}}
end

subgraph group_assistance["Legal and voice aid"]
  node_legal["FIR drafting<br/>[legal.py]"]
  node_hf_legal{{"Hugging Face model"}}
  node_speech["Speech generation<br/>[tts.py]"]
  node_gtts{{"Google TTS"}}
end

node_user(("User"))

node_user -->|"submits input"| node_app
node_app -->|"posts analysis"| node_api
node_api -.->|"imports route"| node_analysis
node_analysis -->|"requests analysis"| node_hf_analysis
node_analysis -.->|"optional URL scan"| node_virustotal
node_api -.->|"imports route"| node_legal
node_legal -->|"requests FIR draft"| node_hf_legal
node_api -.->|"imports route"| node_speech
node_speech -->|"generates audio"| node_gtts

click node_app "https://github.com/jyothirmaeenuthalapati/cyber-kavach/blob/main/App.jsx"
click node_api "https://github.com/jyothirmaeenuthalapati/cyber-kavach/blob/main/main.py"
click node_analysis "https://github.com/jyothirmaeenuthalapati/cyber-kavach/blob/main/analyze.py"
click node_legal "https://github.com/jyothirmaeenuthalapati/cyber-kavach/blob/main/legal.py"
click node_speech "https://github.com/jyothirmaeenuthalapati/cyber-kavach/blob/main/tts.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_app,node_user toneBlue
class node_api toneAmber
class node_analysis,node_hf_analysis,node_virustotal toneMint
class node_legal,node_hf_legal,node_speech,node_gtts toneRose
```

## Components

### User interface

- [Cyber Kavach UI](https://github.com/jyothirmaeenuthalapati/cyber-kavach/blob/main/App.jsx): `App.jsx`

### API backend

- [FastAPI application](https://github.com/jyothirmaeenuthalapati/cyber-kavach/blob/main/main.py): `main.py`

### Threat triage

- [Threat analysis](https://github.com/jyothirmaeenuthalapati/cyber-kavach/blob/main/analyze.py): `analyze.py`
- **Hugging Face model**
- **VirusTotal scan**

### Legal and voice aid

- [FIR drafting](https://github.com/jyothirmaeenuthalapati/cyber-kavach/blob/main/legal.py): `legal.py`
- **Hugging Face model**
- [Speech generation](https://github.com/jyothirmaeenuthalapati/cyber-kavach/blob/main/tts.py): `tts.py`
- **Google TTS**

### Other components

- **User**

## Connections

- User → Cyber Kavach UI: submits input (evidence: `App.jsx`)
- Cyber Kavach UI → FastAPI application: posts analysis (evidence: `App.jsx`)
- FastAPI application → Threat analysis: imports route
- Threat analysis → Hugging Face model: requests analysis (evidence: `analyze.py`)
- Threat analysis → VirusTotal scan: optional URL scan (evidence: `analyze.py`)
- FastAPI application → FIR drafting: imports route
- FIR drafting → Hugging Face model: requests FIR draft (evidence: `legal.py`)
- FastAPI application → Speech generation: imports route
- Speech generation → Google TTS: generates audio (evidence: `tts.py`)
