# archislegend100/trinetra_isro architecture

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

- Interactive diagram: https://gitdiagram.com/archislegend100/trinetra_isro
- Repository: https://github.com/archislegend100/trinetra_isro

## Overview

TRINETRA is a geospatial imagery interpretation platform: users bring imagery and questions through chat, agriculture, or temporal-comparison interfaces, and receive captions, grounded detections, and visual answers. Its Next.js frontend connects to a Flask orchestration backend, which prepares and dispatches inference work to model services. The README also documents map selection and image storage. Backend call edges reflect the sampled main.py excerpt; other feature connections are shown only where documented, with uncertain implementation links omitted or marked dashed.

Main entry points: [`backend/main.py`](https://github.com/archislegend100/trinetra_isro/blob/main/backend/main.py) (Flask API), [`TRINETRA/app`](https://github.com/archislegend100/trinetra_isro/tree/main/TRINETRA/app) (Next.js interface), [`TRINETRA/components/ChatSection.tsx`](https://github.com/archislegend100/trinetra_isro/blob/main/TRINETRA/components/ChatSection.tsx) (Geospatial chat), [`TRINETRA/components/ChatSectionAgriChat.tsx`](https://github.com/archislegend100/trinetra_isro/blob/main/TRINETRA/components/ChatSectionAgriChat.tsx) (AgriChat)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web experience"]
  node_web["Next.js interface"]
  node_chat["Geospatial chat<br/>[ChatSection.tsx]"]
  node_agri["AgriChat"]
  node_compare["GEO Compare"]
  node_map["Map selection<br/>[MapTilerMap.tsx]"]
end

subgraph group_backend["Inference orchestration"]
  node_flask["Flask API<br/>[main.py]"]
  node_modal["GPU inference requests<br/>[modal_request.py]"]
end

subgraph group_vision["Image understanding"]
  node_caption["Image captioning<br/>[caption.py]"]
  node_grounding["Object grounding<br/>[grounding.py]"]
  node_binary["Binary VQA<br/>[binary_vqa.py]"]
  node_numeric["Numeric VQA<br/>[numeric_vqa.py]"]
  node_semantic["Semantic VQA<br/>[semantic_vqa.py]"]
  node_classifier["Image classification"]
  node_sar["SAR and FCC<br/>[SAR_FCC.py]"]
  node_fcc["FCC conversion<br/>[fcc_to_ncc.py]"]
  node_agri_model["Agriculture analysis<br/>[agriculture.py]"]
end

subgraph group_services["Data and integrations"]
  node_storage["Supabase storage<br/>[supabaseStorage.ts]"]
  node_supabase[("Supabase service<br/>[supabaseClient.ts]")]
  node_maptiler["MapTiler"]
  node_modal_service["Modal model service"]
end

node_user(("Imagery analyst"))

node_user -->|"uses"| node_web
node_web -->|"offers chat"| node_chat
node_web -->|"offers AgriChat"| node_agri
node_web -->|"offers comparison"| node_compare
node_web -->|"offers map selection"| node_map
node_chat -.->|"requests analysis"| node_flask
node_agri -.->|"requests analysis"| node_flask
node_compare -.->|"requests comparison"| node_flask
node_flask -.->|"generates caption"| node_caption
node_flask -->|"calls grounding"| node_grounding
node_flask -->|"calls binary VQA"| node_binary
node_flask -->|"calls numeric VQA"| node_numeric
node_flask -->|"calls semantic VQA"| node_semantic
node_flask -.->|"classifies imagery"| node_classifier
node_flask -.->|"handles modalities"| node_sar
node_flask -.->|"converts FCC imagery"| node_fcc
node_flask -.->|"dispatches agriculture"| node_agri_model
node_flask -.->|"uses request client"| node_modal
node_modal -->|"requests inference"| node_modal_service
node_storage -->|"uploads files"| node_supabase
node_map -.->|"uses map search"| node_maptiler

click node_web "https://github.com/archislegend100/trinetra_isro/tree/main/TRINETRA/app"
click node_chat "https://github.com/archislegend100/trinetra_isro/blob/main/TRINETRA/components/ChatSection.tsx"
click node_agri "https://github.com/archislegend100/trinetra_isro/blob/main/TRINETRA/components/ChatSectionAgriChat.tsx"
click node_compare "https://github.com/archislegend100/trinetra_isro/tree/main/TRINETRA/components/tgComparison"
click node_map "https://github.com/archislegend100/trinetra_isro/blob/main/TRINETRA/components/map/MapTilerMap.tsx"
click node_flask "https://github.com/archislegend100/trinetra_isro/blob/main/backend/main.py"
click node_caption "https://github.com/archislegend100/trinetra_isro/blob/main/backend/caption.py"
click node_grounding "https://github.com/archislegend100/trinetra_isro/blob/main/backend/grounding.py"
click node_binary "https://github.com/archislegend100/trinetra_isro/blob/main/backend/binary_vqa.py"
click node_numeric "https://github.com/archislegend100/trinetra_isro/blob/main/backend/numeric_vqa.py"
click node_semantic "https://github.com/archislegend100/trinetra_isro/blob/main/backend/semantic_vqa.py"
click node_classifier "https://github.com/archislegend100/trinetra_isro/blob/main/backend/overall_classifier.py"
click node_sar "https://github.com/archislegend100/trinetra_isro/blob/main/backend/SAR_FCC.py"
click node_fcc "https://github.com/archislegend100/trinetra_isro/blob/main/backend/fcc_to_ncc.py"
click node_agri_model "https://github.com/archislegend100/trinetra_isro/blob/main/backend/agriculture.py"
click node_modal "https://github.com/archislegend100/trinetra_isro/blob/main/backend/modal_request.py"
click node_storage "https://github.com/archislegend100/trinetra_isro/blob/main/TRINETRA/lib/supabaseStorage.ts"
click node_supabase "https://github.com/archislegend100/trinetra_isro/blob/main/TRINETRA/lib/supabaseClient.ts"

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_web,node_chat,node_agri,node_compare,node_map toneBlue
class node_flask,node_modal toneAmber
class node_caption,node_grounding,node_binary,node_numeric,node_semantic,node_classifier,node_sar,node_fcc,node_agri_model toneMint
class node_storage,node_supabase,node_maptiler,node_modal_service toneRose
class node_user toneIndigo
```

## Components

### Web experience

- [Next.js interface](https://github.com/archislegend100/trinetra_isro/tree/main/TRINETRA/app): `TRINETRA/app`
- [Geospatial chat](https://github.com/archislegend100/trinetra_isro/blob/main/TRINETRA/components/ChatSection.tsx): `TRINETRA/components/ChatSection.tsx`
- [AgriChat](https://github.com/archislegend100/trinetra_isro/blob/main/TRINETRA/components/ChatSectionAgriChat.tsx): `TRINETRA/components/ChatSectionAgriChat.tsx`
- [GEO Compare](https://github.com/archislegend100/trinetra_isro/tree/main/TRINETRA/components/tgComparison): `TRINETRA/components/tgComparison`
- [Map selection](https://github.com/archislegend100/trinetra_isro/blob/main/TRINETRA/components/map/MapTilerMap.tsx): `TRINETRA/components/map/MapTilerMap.tsx`

### Inference orchestration

- [Flask API](https://github.com/archislegend100/trinetra_isro/blob/main/backend/main.py): `backend/main.py`
- [GPU inference requests](https://github.com/archislegend100/trinetra_isro/blob/main/backend/modal_request.py): `backend/modal_request.py`

### Image understanding

- [Image captioning](https://github.com/archislegend100/trinetra_isro/blob/main/backend/caption.py): `backend/caption.py`
- [Object grounding](https://github.com/archislegend100/trinetra_isro/blob/main/backend/grounding.py): `backend/grounding.py`
- [Binary VQA](https://github.com/archislegend100/trinetra_isro/blob/main/backend/binary_vqa.py): `backend/binary_vqa.py`
- [Numeric VQA](https://github.com/archislegend100/trinetra_isro/blob/main/backend/numeric_vqa.py): `backend/numeric_vqa.py`
- [Semantic VQA](https://github.com/archislegend100/trinetra_isro/blob/main/backend/semantic_vqa.py): `backend/semantic_vqa.py`
- [Image classification](https://github.com/archislegend100/trinetra_isro/blob/main/backend/overall_classifier.py): `backend/overall_classifier.py`
- [SAR and FCC](https://github.com/archislegend100/trinetra_isro/blob/main/backend/SAR_FCC.py): `backend/SAR_FCC.py`
- [FCC conversion](https://github.com/archislegend100/trinetra_isro/blob/main/backend/fcc_to_ncc.py): `backend/fcc_to_ncc.py`
- [Agriculture analysis](https://github.com/archislegend100/trinetra_isro/blob/main/backend/agriculture.py): `backend/agriculture.py`

### Data and integrations

- [Supabase storage](https://github.com/archislegend100/trinetra_isro/blob/main/TRINETRA/lib/supabaseStorage.ts): `TRINETRA/lib/supabaseStorage.ts`
- [Supabase service](https://github.com/archislegend100/trinetra_isro/blob/main/TRINETRA/lib/supabaseClient.ts): `TRINETRA/lib/supabaseClient.ts`
- **MapTiler**
- **Modal model service**

### Other components

- **Imagery analyst**

## Connections

- Imagery analyst → Next.js interface: uses (evidence: `README.md`)
- Next.js interface → Geospatial chat: offers chat (evidence: `README.md`)
- Next.js interface → AgriChat: offers AgriChat (evidence: `README.md`)
- Next.js interface → GEO Compare: offers comparison (evidence: `README.md`)
- Next.js interface → Map selection: offers map selection (evidence: `README.md`)
- Geospatial chat → Flask API: requests analysis
- AgriChat → Flask API: requests analysis
- GEO Compare → Flask API: requests comparison
- Flask API → Image captioning: generates caption (evidence: `backend/main.py`)
- Flask API → Object grounding: calls grounding (evidence: `backend/main.py`)
- Flask API → Binary VQA: calls binary VQA (evidence: `backend/main.py`)
- Flask API → Numeric VQA: calls numeric VQA (evidence: `backend/main.py`)
- Flask API → Semantic VQA: calls semantic VQA (evidence: `backend/main.py`)
- Flask API → Image classification: classifies imagery (evidence: `backend/main.py`)
- Flask API → SAR and FCC: handles modalities (evidence: `backend/main.py`)
- Flask API → FCC conversion: converts FCC imagery (evidence: `backend/main.py`)
- Flask API → Agriculture analysis: dispatches agriculture (evidence: `backend/main.py`)
- Flask API → GPU inference requests: uses request client (evidence: `backend/main.py`)
- GPU inference requests → Modal model service: requests inference (evidence: `README.md`)
- Supabase storage → Supabase service: uploads files (evidence: `TRINETRA/lib/supabaseStorage.ts`)
- Map selection → MapTiler: uses map search
