# rohitrksingh1920/cybermitra architecture

> Architecture diagram of the GitHub repository rohitrksingh1920/cybermitra, 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/rohitrksingh1920/cybermitra
- Repository: https://github.com/rohitrksingh1920/cybermitra

## Overview

CyberMitra is a bilingual cybersecurity awareness and assistance platform. Citizens browse threat education and emergency guidance, check or report suspicious identifiers, and prepare and track CyberMitra complaint drafts; official reporting remains an external step. The graph includes the React experience, FastAPI routing and persistence, and the documented PostgreSQL service. Some frontend components are represented from the tree and README because their implementation excerpts were not provided; API integration details are therefore shown only where documentation supports them.

Main entry points: [`frontend/src/App.jsx`](https://github.com/rohitrksingh1920/cybermitra/blob/main/frontend/src/App.jsx) (Application shell), [`frontend/src/context/LanguageContext.jsx`](https://github.com/rohitrksingh1920/cybermitra/blob/main/frontend/src/context/LanguageContext.jsx) (Bilingual content), [`backend/app/routers/suspects.py`](https://github.com/rohitrksingh1920/cybermitra/blob/main/backend/app/routers/suspects.py) (Suspect endpoints), [`backend/app/database.py`](https://github.com/rohitrksingh1920/cybermitra/blob/main/backend/app/database.py) (Database session setup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Citizen experience"]
  node_app["Application shell<br/>[App.jsx]"]
  node_language["Bilingual content"]
  node_complaint_ui["Complaint assistance<br/>[ComplaintModal.jsx]"]
  node_tracker_ui["Complaint tracker"]
  node_suspect_ui["Suspect checker<br/>[SuspectChecker.jsx]"]
  node_frontend_runtime["Legacy API integration<br/>[script_7.js]"]
end

subgraph group_guidance["Safety guidance"]
  node_education["Awareness resources<br/>[SafetyTips.jsx]"]
  node_advisories["Security advisories<br/>[Advisories.jsx]"]
  node_faq["Help and FAQ<br/>[FAQ.jsx]"]
  node_sos["SOS incident triage<br/>[SOSSection.jsx]"]
  node_incident_data["Incident guidance data<br/>[incidents.js]"]
  node_emergency_contacts["Official reporting resources<br/>[Contacts.jsx]"]
end

subgraph group_api["Backend API"]
  node_api["FastAPI application<br/>[main.py]"]
  node_complaint_routes["Complaint endpoints<br/>[complaints.py]"]
  node_suspect_routes["Suspect endpoints<br/>[suspects.py]"]
  node_misc_routes["Other API routes<br/>[misc.py]"]
  node_schemas["Request and response schemas<br/>[schemas.py]"]
  node_normalizer["Identifier normalization<br/>[normalize.py]"]
end

subgraph group_storage["Persistent data"]
  node_database["Database session setup<br/>[database.py]"]
  node_models["Application data models<br/>[models.py]"]
  node_postgres[("PostgreSQL database")]
end

node_citizen(("Citizen"))
node_official["Official cybercrime channels"]

node_citizen -->|"uses"| node_app
node_app -->|"renders"| node_complaint_ui
node_app -->|"renders"| node_tracker_ui
node_app -->|"renders"| node_suspect_ui
node_app -->|"renders"| node_sos
node_app -->|"renders"| node_education
node_app -->|"renders"| node_advisories
node_app -->|"renders"| node_faq
node_complaint_ui -->|"reads translations"| node_language
node_tracker_ui -->|"reads translations"| node_language
node_suspect_ui -->|"reads translations"| node_language
node_education -->|"reads translations"| node_language
node_advisories -->|"reads translations"| node_language
node_faq -->|"reads translations"| node_language
node_sos -->|"reads guidance"| node_incident_data
node_sos -->|"opens complaint"| node_complaint_ui
node_complaint_ui -.->|"submits draft"| node_frontend_runtime
node_tracker_ui -.->|"requests tracking"| node_frontend_runtime
node_suspect_ui -.->|"checks identifier"| node_frontend_runtime
node_frontend_runtime -->|"sends API requests"| node_api
node_api -->|"registers"| node_complaint_routes
node_api -->|"registers"| node_suspect_routes
node_api -->|"registers"| node_misc_routes
node_complaint_routes -->|"validates payloads"| node_schemas
node_suspect_routes -->|"validates payloads"| node_schemas
node_misc_routes -->|"uses schemas"| node_schemas
node_suspect_routes -->|"normalizes identifiers"| node_normalizer
node_complaint_routes -->|"obtains sessions"| node_database
node_suspect_routes -->|"obtains sessions"| node_database
node_misc_routes -->|"obtains sessions"| node_database
node_database -->|"creates tables"| node_models
node_database -->|"connects"| node_postgres
node_complaint_routes -->|"reads and writes"| node_models
node_suspect_routes -->|"reads and writes"| node_models
node_misc_routes -->|"uses records"| node_models
node_emergency_contacts -->|"directs users"| node_official
node_citizen -->|"files official report"| node_official

click node_app "https://github.com/rohitrksingh1920/cybermitra/blob/main/frontend/src/App.jsx"
click node_language "https://github.com/rohitrksingh1920/cybermitra/blob/main/frontend/src/context/LanguageContext.jsx"
click node_complaint_ui "https://github.com/rohitrksingh1920/cybermitra/blob/main/frontend/src/components/ComplaintModal.jsx"
click node_tracker_ui "https://github.com/rohitrksingh1920/cybermitra/blob/main/frontend/src/components/ComplaintTracker.jsx"
click node_suspect_ui "https://github.com/rohitrksingh1920/cybermitra/blob/main/frontend/src/components/SuspectChecker.jsx"
click node_education "https://github.com/rohitrksingh1920/cybermitra/blob/main/frontend/src/components/SafetyTips.jsx"
click node_advisories "https://github.com/rohitrksingh1920/cybermitra/blob/main/frontend/src/components/Advisories.jsx"
click node_faq "https://github.com/rohitrksingh1920/cybermitra/blob/main/frontend/src/components/FAQ.jsx"
click node_sos "https://github.com/rohitrksingh1920/cybermitra/blob/main/frontend/src/components/SOSSection.jsx"
click node_incident_data "https://github.com/rohitrksingh1920/cybermitra/blob/main/frontend/src/data/incidents.js"
click node_emergency_contacts "https://github.com/rohitrksingh1920/cybermitra/blob/main/frontend/src/components/Contacts.jsx"
click node_frontend_runtime "https://github.com/rohitrksingh1920/cybermitra/blob/main/frontend/src/legacy/script_7.js"
click node_api "https://github.com/rohitrksingh1920/cybermitra/blob/main/backend/app/main.py"
click node_complaint_routes "https://github.com/rohitrksingh1920/cybermitra/blob/main/backend/app/routers/complaints.py"
click node_suspect_routes "https://github.com/rohitrksingh1920/cybermitra/blob/main/backend/app/routers/suspects.py"
click node_misc_routes "https://github.com/rohitrksingh1920/cybermitra/blob/main/backend/app/routers/misc.py"
click node_schemas "https://github.com/rohitrksingh1920/cybermitra/blob/main/backend/app/schemas.py"
click node_normalizer "https://github.com/rohitrksingh1920/cybermitra/blob/main/backend/app/utils/normalize.py"
click node_database "https://github.com/rohitrksingh1920/cybermitra/blob/main/backend/app/database.py"
click node_models "https://github.com/rohitrksingh1920/cybermitra/blob/main/backend/app/models.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_language,node_complaint_ui,node_tracker_ui,node_suspect_ui,node_frontend_runtime toneBlue
class node_education,node_advisories,node_faq,node_sos,node_incident_data,node_emergency_contacts toneAmber
class node_api,node_complaint_routes,node_suspect_routes,node_misc_routes,node_schemas,node_normalizer toneMint
class node_database,node_models,node_postgres toneRose
class node_citizen,node_official toneIndigo
```

## Components

### Citizen experience

- [Application shell](https://github.com/rohitrksingh1920/cybermitra/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Bilingual content](https://github.com/rohitrksingh1920/cybermitra/blob/main/frontend/src/context/LanguageContext.jsx): `frontend/src/context/LanguageContext.jsx`
- [Complaint assistance](https://github.com/rohitrksingh1920/cybermitra/blob/main/frontend/src/components/ComplaintModal.jsx): `frontend/src/components/ComplaintModal.jsx`
- [Complaint tracker](https://github.com/rohitrksingh1920/cybermitra/blob/main/frontend/src/components/ComplaintTracker.jsx): `frontend/src/components/ComplaintTracker.jsx`
- [Suspect checker](https://github.com/rohitrksingh1920/cybermitra/blob/main/frontend/src/components/SuspectChecker.jsx): `frontend/src/components/SuspectChecker.jsx`
- [Legacy API integration](https://github.com/rohitrksingh1920/cybermitra/blob/main/frontend/src/legacy/script_7.js): `frontend/src/legacy/script_7.js`

### Safety guidance

- [Awareness resources](https://github.com/rohitrksingh1920/cybermitra/blob/main/frontend/src/components/SafetyTips.jsx): `frontend/src/components/SafetyTips.jsx`
- [Security advisories](https://github.com/rohitrksingh1920/cybermitra/blob/main/frontend/src/components/Advisories.jsx): `frontend/src/components/Advisories.jsx`
- [Help and FAQ](https://github.com/rohitrksingh1920/cybermitra/blob/main/frontend/src/components/FAQ.jsx): `frontend/src/components/FAQ.jsx`
- [SOS incident triage](https://github.com/rohitrksingh1920/cybermitra/blob/main/frontend/src/components/SOSSection.jsx): `frontend/src/components/SOSSection.jsx`
- [Incident guidance data](https://github.com/rohitrksingh1920/cybermitra/blob/main/frontend/src/data/incidents.js): `frontend/src/data/incidents.js`
- [Official reporting resources](https://github.com/rohitrksingh1920/cybermitra/blob/main/frontend/src/components/Contacts.jsx): `frontend/src/components/Contacts.jsx`

### Backend API

- [FastAPI application](https://github.com/rohitrksingh1920/cybermitra/blob/main/backend/app/main.py): `backend/app/main.py`
- [Complaint endpoints](https://github.com/rohitrksingh1920/cybermitra/blob/main/backend/app/routers/complaints.py): `backend/app/routers/complaints.py`
- [Suspect endpoints](https://github.com/rohitrksingh1920/cybermitra/blob/main/backend/app/routers/suspects.py): `backend/app/routers/suspects.py`
- [Other API routes](https://github.com/rohitrksingh1920/cybermitra/blob/main/backend/app/routers/misc.py): `backend/app/routers/misc.py`
- [Request and response schemas](https://github.com/rohitrksingh1920/cybermitra/blob/main/backend/app/schemas.py): `backend/app/schemas.py`
- [Identifier normalization](https://github.com/rohitrksingh1920/cybermitra/blob/main/backend/app/utils/normalize.py): `backend/app/utils/normalize.py`

### Persistent data

- [Database session setup](https://github.com/rohitrksingh1920/cybermitra/blob/main/backend/app/database.py): `backend/app/database.py`
- [Application data models](https://github.com/rohitrksingh1920/cybermitra/blob/main/backend/app/models.py): `backend/app/models.py`
- **PostgreSQL database**

### Other components

- **Citizen**
- **Official cybercrime channels**

## Connections

- Citizen → Application shell: uses (evidence: `README.md`)
- Application shell → Complaint assistance: renders (evidence: `frontend/src/App.jsx`)
- Application shell → Complaint tracker: renders (evidence: `frontend/src/App.jsx`)
- Application shell → Suspect checker: renders (evidence: `frontend/src/App.jsx`)
- Application shell → SOS incident triage: renders (evidence: `frontend/src/App.jsx`)
- Application shell → Awareness resources: renders (evidence: `frontend/src/App.jsx`)
- Application shell → Security advisories: renders (evidence: `frontend/src/App.jsx`)
- Application shell → Help and FAQ: renders (evidence: `frontend/src/App.jsx`)
- Complaint assistance → Bilingual content: reads translations (evidence: `frontend/src/components/ComplaintModal.jsx`)
- Complaint tracker → Bilingual content: reads translations (evidence: `frontend/src/components/ComplaintTracker.jsx`)
- Suspect checker → Bilingual content: reads translations (evidence: `frontend/src/components/SuspectChecker.jsx`)
- Awareness resources → Bilingual content: reads translations (evidence: `frontend/src/components/SafetyTips.jsx`)
- Security advisories → Bilingual content: reads translations (evidence: `frontend/src/components/Advisories.jsx`)
- Help and FAQ → Bilingual content: reads translations (evidence: `frontend/src/components/FAQ.jsx`)
- SOS incident triage → Incident guidance data: reads guidance (evidence: `frontend/src/components/SOSSection.jsx`)
- SOS incident triage → Complaint assistance: opens complaint (evidence: `frontend/src/App.jsx`)
- Complaint assistance → Legacy API integration: submits draft
- Complaint tracker → Legacy API integration: requests tracking
- Suspect checker → Legacy API integration: checks identifier
- Legacy API integration → FastAPI application: sends API requests (evidence: `README.md`)
- FastAPI application → Complaint endpoints: registers (evidence: `backend/app/main.py`)
- FastAPI application → Suspect endpoints: registers (evidence: `backend/app/main.py`)
- FastAPI application → Other API routes: registers (evidence: `backend/app/main.py`)
- Complaint endpoints → Request and response schemas: validates payloads (evidence: `backend/app/routers/complaints.py`)
- Suspect endpoints → Request and response schemas: validates payloads (evidence: `backend/app/routers/suspects.py`)
- Other API routes → Request and response schemas: uses schemas (evidence: `backend/app/routers/misc.py`)
- Suspect endpoints → Identifier normalization: normalizes identifiers (evidence: `backend/app/routers/suspects.py`)
- Complaint endpoints → Database session setup: obtains sessions (evidence: `backend/app/routers/complaints.py`)
- Suspect endpoints → Database session setup: obtains sessions (evidence: `backend/app/routers/suspects.py`)
- Other API routes → Database session setup: obtains sessions (evidence: `backend/app/routers/misc.py`)
- Database session setup → Application data models: creates tables (evidence: `backend/app/database.py`)
- Database session setup → PostgreSQL database: connects (evidence: `README.md`)
- Complaint endpoints → Application data models: reads and writes (evidence: `backend/app/routers/complaints.py`)
- Suspect endpoints → Application data models: reads and writes (evidence: `backend/app/routers/suspects.py`)
- Other API routes → Application data models: uses records (evidence: `backend/app/routers/misc.py`)
- Official reporting resources → Official cybercrime channels: directs users (evidence: `README.md`)
- Citizen → Official cybercrime channels: files official report (evidence: `README.md`)
