# saran2006a/deity_identification architecture

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

- Interactive diagram: https://gitdiagram.com/saran2006a/deity_identification
- Repository: https://github.com/saran2006a/deity_identification

## Overview

DeityVision AI is a South Indian sculpture-recognition and temple-heritage application. A visitor signs in, uploads or captures a sculpture, receives deity predictions and iconographic context, then can explore related temples or manage saved scans. Flask owns the API and delegates persistence to SQLite; the React studio presents scanning, temple, shastra, history, and telemetry capabilities. The README documents the API capabilities; some UI and backend implementation excerpts are incomplete, so uncertain links are omitted or marked unverified.

Main entry points: [`app.py`](https://github.com/saran2006a/deity_identification/blob/main/app.py) (Flask API), [`frontend/src/App.jsx`](https://github.com/saran2006a/deity_identification/blob/main/frontend/src/App.jsx) (Application routing), [`frontend/src/context/AuthContext.jsx`](https://github.com/saran2006a/deity_identification/blob/main/frontend/src/context/AuthContext.jsx) (Sign-in state), [`frontend/src/components/LandingPage.jsx`](https://github.com/saran2006a/deity_identification/blob/main/frontend/src/components/LandingPage.jsx) (Landing page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_app["Application routing<br/>[App.jsx]"]
  node_authui["Sign-in state<br/>[AuthContext.jsx]"]
  node_landing["Landing page<br/>[LandingPage.jsx]"]
  node_about["About page<br/>[AboutPage.jsx]"]
  node_navbar["Navigation<br/>[Navbar.jsx]"]
  node_scanner["Sculpture scanner"]
  node_drawer["Studio drawer<br/>[StudioDrawer.jsx]"]
  node_particles["Landing visuals"]
  node_scanneralt["Scanner view<br/>[ScannerView.jsx]"]
  node_analytics["Analytics view<br/>[AnalyticsView.jsx]"]
  node_historyview["Scan history<br/>[HistoryView.jsx]"]
end

subgraph group_api["Recognition API"]
  node_api["Flask API<br/>[app.py]"]
  node_inference["Image inference<br/>[app.py]"]
  node_training["Model training<br/>[train.py]"]
  node_evaluation["Model evaluation<br/>[evaluate.py]"]
  node_cli["CLI prediction<br/>[predict.py]"]
end

subgraph group_knowledge["Heritage knowledge"]
  node_encyclopedia["Iconography guides"]
  node_templeexplorer["Temple explorer"]
  node_templemodal["Temple dossier<br/>[TempleModal.jsx]"]
  node_knowledgebase["Deity and temple data<br/>[temple_data.py]"]
end

subgraph group_persistence["Accounts and records"]
  node_database[("SQLite persistence<br/>[db.py]")]
end

node_visitor(("Visitor"))

node_visitor -->|"opens"| node_app
node_app -->|"provides auth"| node_authui
node_app -->|"routes to"| node_landing
node_app -->|"routes to"| node_about
node_app -->|"renders"| node_navbar
node_app -->|"routes to"| node_scanner
node_app -->|"renders"| node_drawer
node_landing -->|"renders"| node_particles
node_scanner -->|"requests predictions"| node_api
node_drawer -->|"requests vault data"| node_api
node_api -.->|"runs inference"| node_inference
node_api -->|"reads and writes"| node_database
node_api -->|"uses metadata"| node_knowledgebase
node_templeexplorer -->|"opens dossier"| node_templemodal
node_historyview -.->|"requests scan records"| node_api
node_analytics -.->|"requests statistics"| node_api
node_authui -.->|"calls auth endpoints"| node_api
node_training -.->|"evaluates model"| node_evaluation
node_cli -.->|"uses prediction logic"| node_inference

click node_app "https://github.com/saran2006a/deity_identification/blob/main/frontend/src/App.jsx"
click node_authui "https://github.com/saran2006a/deity_identification/blob/main/frontend/src/context/AuthContext.jsx"
click node_landing "https://github.com/saran2006a/deity_identification/blob/main/frontend/src/components/LandingPage.jsx"
click node_about "https://github.com/saran2006a/deity_identification/blob/main/frontend/src/components/AboutPage.jsx"
click node_navbar "https://github.com/saran2006a/deity_identification/blob/main/frontend/src/components/Navbar.jsx"
click node_scanner "https://github.com/saran2006a/deity_identification/blob/main/frontend/src/components/StudioMainStage.jsx"
click node_drawer "https://github.com/saran2006a/deity_identification/blob/main/frontend/src/components/StudioDrawer.jsx"
click node_particles "https://github.com/saran2006a/deity_identification/blob/main/frontend/src/components/GoldParticleCanvas.jsx"
click node_scanneralt "https://github.com/saran2006a/deity_identification/blob/main/frontend/src/components/ScannerView.jsx"
click node_analytics "https://github.com/saran2006a/deity_identification/blob/main/frontend/src/components/AnalyticsView.jsx"
click node_encyclopedia "https://github.com/saran2006a/deity_identification/blob/main/frontend/src/components/EncyclopediaView.jsx"
click node_templeexplorer "https://github.com/saran2006a/deity_identification/blob/main/frontend/src/components/TempleExplorerView.jsx"
click node_templemodal "https://github.com/saran2006a/deity_identification/blob/main/frontend/src/components/TempleModal.jsx"
click node_historyview "https://github.com/saran2006a/deity_identification/blob/main/frontend/src/components/HistoryView.jsx"
click node_api "https://github.com/saran2006a/deity_identification/blob/main/app.py"
click node_inference "https://github.com/saran2006a/deity_identification/blob/main/app.py"
click node_knowledgebase "https://github.com/saran2006a/deity_identification/blob/main/temple_data.py"
click node_database "https://github.com/saran2006a/deity_identification/blob/main/db.py"
click node_training "https://github.com/saran2006a/deity_identification/blob/main/train.py"
click node_evaluation "https://github.com/saran2006a/deity_identification/blob/main/evaluate.py"
click node_cli "https://github.com/saran2006a/deity_identification/blob/main/predict.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_authui,node_landing,node_about,node_navbar,node_scanner,node_drawer,node_particles,node_scanneralt,node_analytics,node_historyview toneBlue
class node_api,node_inference,node_training,node_evaluation,node_cli toneAmber
class node_encyclopedia,node_templeexplorer,node_templemodal,node_knowledgebase toneMint
class node_database toneRose
class node_visitor toneIndigo
```

## Components

### Web experience

- [Application routing](https://github.com/saran2006a/deity_identification/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Sign-in state](https://github.com/saran2006a/deity_identification/blob/main/frontend/src/context/AuthContext.jsx): `frontend/src/context/AuthContext.jsx`
- [Landing page](https://github.com/saran2006a/deity_identification/blob/main/frontend/src/components/LandingPage.jsx): `frontend/src/components/LandingPage.jsx`
- [About page](https://github.com/saran2006a/deity_identification/blob/main/frontend/src/components/AboutPage.jsx): `frontend/src/components/AboutPage.jsx`
- [Navigation](https://github.com/saran2006a/deity_identification/blob/main/frontend/src/components/Navbar.jsx): `frontend/src/components/Navbar.jsx`
- [Sculpture scanner](https://github.com/saran2006a/deity_identification/blob/main/frontend/src/components/StudioMainStage.jsx): `frontend/src/components/StudioMainStage.jsx`
- [Studio drawer](https://github.com/saran2006a/deity_identification/blob/main/frontend/src/components/StudioDrawer.jsx): `frontend/src/components/StudioDrawer.jsx`
- [Landing visuals](https://github.com/saran2006a/deity_identification/blob/main/frontend/src/components/GoldParticleCanvas.jsx): `frontend/src/components/GoldParticleCanvas.jsx`
- [Scanner view](https://github.com/saran2006a/deity_identification/blob/main/frontend/src/components/ScannerView.jsx): `frontend/src/components/ScannerView.jsx`
- [Analytics view](https://github.com/saran2006a/deity_identification/blob/main/frontend/src/components/AnalyticsView.jsx): `frontend/src/components/AnalyticsView.jsx`
- [Scan history](https://github.com/saran2006a/deity_identification/blob/main/frontend/src/components/HistoryView.jsx): `frontend/src/components/HistoryView.jsx`

### Recognition API

- [Flask API](https://github.com/saran2006a/deity_identification/blob/main/app.py): `app.py`
- [Image inference](https://github.com/saran2006a/deity_identification/blob/main/app.py): `app.py`
- [Model training](https://github.com/saran2006a/deity_identification/blob/main/train.py): `train.py`
- [Model evaluation](https://github.com/saran2006a/deity_identification/blob/main/evaluate.py): `evaluate.py`
- [CLI prediction](https://github.com/saran2006a/deity_identification/blob/main/predict.py): `predict.py`

### Heritage knowledge

- [Iconography guides](https://github.com/saran2006a/deity_identification/blob/main/frontend/src/components/EncyclopediaView.jsx): `frontend/src/components/EncyclopediaView.jsx`
- [Temple explorer](https://github.com/saran2006a/deity_identification/blob/main/frontend/src/components/TempleExplorerView.jsx): `frontend/src/components/TempleExplorerView.jsx`
- [Temple dossier](https://github.com/saran2006a/deity_identification/blob/main/frontend/src/components/TempleModal.jsx): `frontend/src/components/TempleModal.jsx`
- [Deity and temple data](https://github.com/saran2006a/deity_identification/blob/main/temple_data.py): `temple_data.py`

### Accounts and records

- [SQLite persistence](https://github.com/saran2006a/deity_identification/blob/main/db.py): `db.py`

### Other components

- **Visitor**

## Connections

- Visitor → Application routing: opens (evidence: `frontend/src/App.jsx`)
- Application routing → Sign-in state: provides auth (evidence: `frontend/src/App.jsx`)
- Application routing → Landing page: routes to (evidence: `frontend/src/App.jsx`)
- Application routing → About page: routes to (evidence: `frontend/src/App.jsx`)
- Application routing → Navigation: renders (evidence: `frontend/src/App.jsx`)
- Application routing → Sculpture scanner: routes to (evidence: `frontend/src/App.jsx`)
- Application routing → Studio drawer: renders (evidence: `frontend/src/App.jsx`)
- Landing page → Landing visuals: renders (evidence: `frontend/src/components/LandingPage.jsx`)
- Sculpture scanner → Flask API: requests predictions (evidence: `README.md`)
- Studio drawer → Flask API: requests vault data (evidence: `README.md`)
- Flask API → Image inference: runs inference (evidence: `app.py`)
- Flask API → SQLite persistence: reads and writes (evidence: `app.py`)
- Flask API → Deity and temple data: uses metadata (evidence: `app.py`)
- Temple explorer → Temple dossier: opens dossier (evidence: `frontend/src/components/TempleExplorerView.jsx`)
- Scan history → Flask API: requests scan records
- Analytics view → Flask API: requests statistics
- Sign-in state → Flask API: calls auth endpoints
- Model training → Model evaluation: evaluates model
- CLI prediction → Image inference: uses prediction logic
