# gokulraam-git/crimevault architecture

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

- Interactive diagram: https://gitdiagram.com/gokulraam-git/crimevault
- Repository: https://github.com/gokulraam-git/crimevault

## Overview

CrimeDNA/CrimeVault is a crime-intelligence dashboard backed by a FastAPI analytics service and SQLite data. A user opens the dashboard and selects operational or analytical views; the backend exposes crime, offender, hotspot, anomaly, network, risk, and evolution capabilities, plus dataset import and seed restoration. The frontend’s component-to-API request paths are only partly visible in the supplied excerpts, so those links are omitted; backend analytics dispatch is shown where the API excerpt names the calls.

Main entry points: [`frontend/src/App.jsx`](https://github.com/gokulraam-git/crimevault/blob/main/frontend/src/App.jsx) (Dashboard App), [`backend/app/main.py`](https://github.com/gokulraam-git/crimevault/blob/main/backend/app/main.py) (FastAPI Routes), [`backend/app/models.py`](https://github.com/gokulraam-git/crimevault/blob/main/backend/app/models.py) (Crime Data Models), [`backend/app/database.py`](https://github.com/gokulraam-git/crimevault/blob/main/backend/app/database.py) (Database Sessions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Dashboard UI"]
  node_app["Dashboard App<br/>[App.jsx]"]
  node_dashboard["Overview<br/>[Dashboard.jsx]"]
  node_hotspots_ui["Hotspot Map<br/>[HotspotsMap.jsx]"]
  node_district["District Detail"]
  node_alerts["Anomaly Alerts<br/>[AlertsPanel.jsx]"]
  node_cctv["CCTV Panel<br/>[CCTVPanel.jsx]"]
  node_network_ui["Offender Network<br/>[NetworkGraph.jsx]"]
  node_offenders_ui["Offender Tracking"]
  node_socio["Socioeconomic View<br/>[SocioEconomic.jsx]"]
  node_risk_ui["Risk Scoring<br/>[RiskScoring.jsx]"]
  node_evolution_ui["Crime Evolution"]
  node_assistant["AI Assistant<br/>[AIAssistant.jsx]"]
  node_datasets_ui["Dataset Manager<br/>[DatasetManager.jsx]"]
  node_api_config["API Base URL<br/>[api.js]"]
end

subgraph group_service["Crime API"]
  node_api["FastAPI Routes<br/>[main.py]"]
end

subgraph group_analytics["Intelligence Analytics"]
  node_hotspots["Hotspot Detection<br/>[hotspots.py]"]
  node_anomalies["Anomaly Detection<br/>[anomalies.py]"]
  node_network["Network Analysis<br/>[network.py]"]
  node_predictions["Risk Prediction<br/>[predictions.py]"]
  node_evolution["Evolution Analysis<br/>[evolution.py]"]
end

subgraph group_data["Crime Data"]
  node_database["Database Sessions<br/>[database.py]"]
  node_models["Crime Data Models<br/>[models.py]"]
  node_seed["Seed Data<br/>[seed.py]"]
  node_sqlite[("SQLite Database<br/>[crimedna.db]")]
end

node_user(("Analyst"))

node_user -->|"uses"| node_app
node_app -->|"renders"| node_dashboard
node_app -->|"renders"| node_hotspots_ui
node_app -->|"renders"| node_district
node_app -->|"renders"| node_alerts
node_app -->|"renders"| node_cctv
node_app -->|"renders"| node_network_ui
node_app -->|"renders"| node_offenders_ui
node_app -->|"renders"| node_socio
node_app -->|"renders"| node_risk_ui
node_app -->|"renders"| node_evolution_ui
node_app -->|"renders"| node_assistant
node_app -->|"renders"| node_datasets_ui
node_api -->|"calls"| node_hotspots
node_api -->|"calls"| node_anomalies
node_api -->|"calls"| node_network
node_api -->|"calls"| node_predictions
node_api -->|"calls"| node_evolution
node_api -->|"imports"| node_database
node_api -->|"uses"| node_models
node_api -->|"calls"| node_seed
node_database -->|"connects"| node_sqlite
node_models -->|"uses base"| node_database
node_seed -->|"initializes"| node_database
node_seed -->|"creates records"| node_models
node_hotspots -->|"imports"| node_models
node_anomalies -->|"imports"| node_models
node_network -->|"imports"| node_models
node_predictions -->|"queries"| node_models
node_evolution -->|"queries"| node_models
node_datasets_ui -->|"uses URL"| node_api_config

click node_app "https://github.com/gokulraam-git/crimevault/blob/main/frontend/src/App.jsx"
click node_dashboard "https://github.com/gokulraam-git/crimevault/blob/main/frontend/src/components/Dashboard.jsx"
click node_hotspots_ui "https://github.com/gokulraam-git/crimevault/blob/main/frontend/src/components/HotspotsMap.jsx"
click node_district "https://github.com/gokulraam-git/crimevault/blob/main/frontend/src/components/DistrictDrilldown.jsx"
click node_alerts "https://github.com/gokulraam-git/crimevault/blob/main/frontend/src/components/AlertsPanel.jsx"
click node_cctv "https://github.com/gokulraam-git/crimevault/blob/main/frontend/src/components/CCTVPanel.jsx"
click node_network_ui "https://github.com/gokulraam-git/crimevault/blob/main/frontend/src/components/NetworkGraph.jsx"
click node_offenders_ui "https://github.com/gokulraam-git/crimevault/blob/main/frontend/src/components/OffenderTracker.jsx"
click node_socio "https://github.com/gokulraam-git/crimevault/blob/main/frontend/src/components/SocioEconomic.jsx"
click node_risk_ui "https://github.com/gokulraam-git/crimevault/blob/main/frontend/src/components/RiskScoring.jsx"
click node_evolution_ui "https://github.com/gokulraam-git/crimevault/blob/main/frontend/src/components/EvolutionEngine.jsx"
click node_assistant "https://github.com/gokulraam-git/crimevault/blob/main/frontend/src/components/AIAssistant.jsx"
click node_datasets_ui "https://github.com/gokulraam-git/crimevault/blob/main/frontend/src/components/DatasetManager.jsx"
click node_api_config "https://github.com/gokulraam-git/crimevault/blob/main/frontend/src/api.js"
click node_api "https://github.com/gokulraam-git/crimevault/blob/main/backend/app/main.py"
click node_hotspots "https://github.com/gokulraam-git/crimevault/blob/main/backend/app/analytics/hotspots.py"
click node_anomalies "https://github.com/gokulraam-git/crimevault/blob/main/backend/app/analytics/anomalies.py"
click node_network "https://github.com/gokulraam-git/crimevault/blob/main/backend/app/analytics/network.py"
click node_predictions "https://github.com/gokulraam-git/crimevault/blob/main/backend/app/analytics/predictions.py"
click node_evolution "https://github.com/gokulraam-git/crimevault/blob/main/backend/app/analytics/evolution.py"
click node_database "https://github.com/gokulraam-git/crimevault/blob/main/backend/app/database.py"
click node_models "https://github.com/gokulraam-git/crimevault/blob/main/backend/app/models.py"
click node_seed "https://github.com/gokulraam-git/crimevault/blob/main/backend/app/seed.py"
click node_sqlite "https://github.com/gokulraam-git/crimevault/blob/main/backend/crimedna.db"

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_dashboard,node_hotspots_ui,node_district,node_alerts,node_cctv,node_network_ui,node_offenders_ui,node_socio,node_risk_ui,node_evolution_ui,node_assistant,node_datasets_ui,node_api_config toneBlue
class node_api toneAmber
class node_hotspots,node_anomalies,node_network,node_predictions,node_evolution toneMint
class node_database,node_models,node_seed,node_sqlite toneRose
class node_user toneIndigo
```

## Components

### Dashboard UI

- [Dashboard App](https://github.com/gokulraam-git/crimevault/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Overview](https://github.com/gokulraam-git/crimevault/blob/main/frontend/src/components/Dashboard.jsx): `frontend/src/components/Dashboard.jsx`
- [Hotspot Map](https://github.com/gokulraam-git/crimevault/blob/main/frontend/src/components/HotspotsMap.jsx): `frontend/src/components/HotspotsMap.jsx`
- [District Detail](https://github.com/gokulraam-git/crimevault/blob/main/frontend/src/components/DistrictDrilldown.jsx): `frontend/src/components/DistrictDrilldown.jsx`
- [Anomaly Alerts](https://github.com/gokulraam-git/crimevault/blob/main/frontend/src/components/AlertsPanel.jsx): `frontend/src/components/AlertsPanel.jsx`
- [CCTV Panel](https://github.com/gokulraam-git/crimevault/blob/main/frontend/src/components/CCTVPanel.jsx): `frontend/src/components/CCTVPanel.jsx`
- [Offender Network](https://github.com/gokulraam-git/crimevault/blob/main/frontend/src/components/NetworkGraph.jsx): `frontend/src/components/NetworkGraph.jsx`
- [Offender Tracking](https://github.com/gokulraam-git/crimevault/blob/main/frontend/src/components/OffenderTracker.jsx): `frontend/src/components/OffenderTracker.jsx`
- [Socioeconomic View](https://github.com/gokulraam-git/crimevault/blob/main/frontend/src/components/SocioEconomic.jsx): `frontend/src/components/SocioEconomic.jsx`
- [Risk Scoring](https://github.com/gokulraam-git/crimevault/blob/main/frontend/src/components/RiskScoring.jsx): `frontend/src/components/RiskScoring.jsx`
- [Crime Evolution](https://github.com/gokulraam-git/crimevault/blob/main/frontend/src/components/EvolutionEngine.jsx): `frontend/src/components/EvolutionEngine.jsx`
- [AI Assistant](https://github.com/gokulraam-git/crimevault/blob/main/frontend/src/components/AIAssistant.jsx): `frontend/src/components/AIAssistant.jsx`
- [Dataset Manager](https://github.com/gokulraam-git/crimevault/blob/main/frontend/src/components/DatasetManager.jsx): `frontend/src/components/DatasetManager.jsx`
- [API Base URL](https://github.com/gokulraam-git/crimevault/blob/main/frontend/src/api.js): `frontend/src/api.js`

### Crime API

- [FastAPI Routes](https://github.com/gokulraam-git/crimevault/blob/main/backend/app/main.py): `backend/app/main.py`

### Intelligence Analytics

- [Hotspot Detection](https://github.com/gokulraam-git/crimevault/blob/main/backend/app/analytics/hotspots.py): `backend/app/analytics/hotspots.py`
- [Anomaly Detection](https://github.com/gokulraam-git/crimevault/blob/main/backend/app/analytics/anomalies.py): `backend/app/analytics/anomalies.py`
- [Network Analysis](https://github.com/gokulraam-git/crimevault/blob/main/backend/app/analytics/network.py): `backend/app/analytics/network.py`
- [Risk Prediction](https://github.com/gokulraam-git/crimevault/blob/main/backend/app/analytics/predictions.py): `backend/app/analytics/predictions.py`
- [Evolution Analysis](https://github.com/gokulraam-git/crimevault/blob/main/backend/app/analytics/evolution.py): `backend/app/analytics/evolution.py`

### Crime Data

- [Database Sessions](https://github.com/gokulraam-git/crimevault/blob/main/backend/app/database.py): `backend/app/database.py`
- [Crime Data Models](https://github.com/gokulraam-git/crimevault/blob/main/backend/app/models.py): `backend/app/models.py`
- [Seed Data](https://github.com/gokulraam-git/crimevault/blob/main/backend/app/seed.py): `backend/app/seed.py`
- [SQLite Database](https://github.com/gokulraam-git/crimevault/blob/main/backend/crimedna.db): `backend/crimedna.db`

### Other components

- **Analyst**

## Connections

- Analyst → Dashboard App: uses (evidence: `frontend/src/App.jsx`)
- Dashboard App → Overview: renders (evidence: `frontend/src/App.jsx`)
- Dashboard App → Hotspot Map: renders (evidence: `frontend/src/App.jsx`)
- Dashboard App → District Detail: renders (evidence: `frontend/src/App.jsx`)
- Dashboard App → Anomaly Alerts: renders (evidence: `frontend/src/App.jsx`)
- Dashboard App → CCTV Panel: renders (evidence: `frontend/src/App.jsx`)
- Dashboard App → Offender Network: renders (evidence: `frontend/src/App.jsx`)
- Dashboard App → Offender Tracking: renders (evidence: `frontend/src/App.jsx`)
- Dashboard App → Socioeconomic View: renders (evidence: `frontend/src/App.jsx`)
- Dashboard App → Risk Scoring: renders (evidence: `frontend/src/App.jsx`)
- Dashboard App → Crime Evolution: renders (evidence: `frontend/src/App.jsx`)
- Dashboard App → AI Assistant: renders (evidence: `frontend/src/App.jsx`)
- Dashboard App → Dataset Manager: renders (evidence: `frontend/src/App.jsx`)
- FastAPI Routes → Hotspot Detection: calls (evidence: `backend/app/main.py`)
- FastAPI Routes → Anomaly Detection: calls (evidence: `backend/app/main.py`)
- FastAPI Routes → Network Analysis: calls (evidence: `backend/app/main.py`)
- FastAPI Routes → Risk Prediction: calls (evidence: `backend/app/main.py`)
- FastAPI Routes → Evolution Analysis: calls (evidence: `backend/app/main.py`)
- FastAPI Routes → Database Sessions: imports (evidence: `backend/app/main.py`)
- FastAPI Routes → Crime Data Models: uses (evidence: `backend/app/main.py`)
- FastAPI Routes → Seed Data: calls (evidence: `backend/app/main.py`)
- Database Sessions → SQLite Database: connects (evidence: `backend/app/database.py`)
- Crime Data Models → Database Sessions: uses base (evidence: `backend/app/models.py`)
- Seed Data → Database Sessions: initializes (evidence: `backend/app/seed.py`)
- Seed Data → Crime Data Models: creates records (evidence: `backend/app/seed.py`)
- Hotspot Detection → Crime Data Models: imports (evidence: `backend/app/analytics/hotspots.py`)
- Anomaly Detection → Crime Data Models: imports (evidence: `backend/app/analytics/anomalies.py`)
- Network Analysis → Crime Data Models: imports (evidence: `backend/app/analytics/network.py`)
- Risk Prediction → Crime Data Models: queries (evidence: `backend/app/analytics/predictions.py`)
- Evolution Analysis → Crime Data Models: queries (evidence: `backend/app/analytics/evolution.py`)
- Dataset Manager → API Base URL: uses URL (evidence: `frontend/src/components/DatasetManager.jsx`)
