# aniket8983-arch/god-s-plan_deploy- architecture

> Architecture diagram of the GitHub repository aniket8983-arch/god-s-plan_deploy-, 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/aniket8983-arch/god-s-plan_deploy-
- Repository: https://github.com/aniket8983-arch/god-s-plan_deploy-

## Overview

This is an agricultural intelligence dashboard combining field-scale satellite/terrain visualization, crop and soil diagnostics, and conversational advice. The main user flow is: load the farm grid and terrain, inspect a cell, submit leaf or soil evidence, assemble a contextual analysis, and ask the assistant for cautious guidance. The graph also preserves the documented Sentinel-2/NDVI and DEM processing capabilities. Some GIS pipeline internals and frontend panels are not excerpted; their links are included only where the README or source index supports them.

Main entry points: [`frontend/src/App.tsx`](https://github.com/aniket8983-arch/god-s-plan_deploy-/blob/main/frontend/src/App.tsx) (Dashboard), [`backend/routes/ml_routes.py`](https://github.com/aniket8983-arch/god-s-plan_deploy-/blob/main/backend/routes/ml_routes.py) (ML Routes), [`frontend/src/components/ThreeCanvas.tsx`](https://github.com/aniket8983-arch/god-s-plan_deploy-/blob/main/frontend/src/components/ThreeCanvas.tsx) (3D Canvas), [`backend/server.py`](https://github.com/aniket8983-arch/god-s-plan_deploy-/blob/main/backend/server.py) (FastAPI Server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_field["Field Visualization"]
  node_app["Dashboard<br/>[App.tsx]"]
  node_cellui["Cell Inspector<br/>[CellInspector.tsx]"]
  node_canvas["3D Canvas<br/>[ThreeCanvas.tsx]"]
  node_terrain["Terrain Scene<br/>[TerrainScene.ts]"]
  node_cropview["Crop Renderer<br/>[CropRenderer.ts]"]
  node_stressview["Stress Layer<br/>[StressRiskLayer.ts]"]
  node_layerui["Layer Controls<br/>[LayerToggle.tsx]"]
end

subgraph group_diagnostics["Crop Diagnostics"]
  node_cropui["Crop Analysis"]
  node_soilui["Soil Report"]
  node_stressui["Stress Analysis"]
  node_mlapi["ML API Client<br/>[mlApi.ts]"]
  node_mlservice["Image ML Service<br/>[ml_service.py]"]
  node_inference["Model Inference<br/>[inference.py]"]
  node_soilparser["Soil Parser<br/>[soil_parser.py]"]
end

subgraph group_api["Application API"]
  node_server["FastAPI Server<br/>[server.py]"]
  node_mlroutes["ML Routes<br/>[ml_routes.py]"]
  node_assistroutes["Assistant Routes"]
end

subgraph group_advisory["AI Advisory"]
  node_assistantui["Assistant Panel"]
  node_assistantapi["Assistant API Client<br/>[assistantApi.ts]"]
  node_multimodal["Context Analysis"]
  node_groq["Groq Assistant<br/>[groq_service.py]"]
end

subgraph group_gis["Geospatial Data"]
  node_pipeline["Satellite GIS Pipeline"]
  node_fielddata[("Grid / Terrain Data<br/>[server.py]")]
  node_copernicus[("Sentinel-2 / DEM")]
end

node_farmer(("Farmer / Agronomist"))

node_farmer -->|"uses"| node_app
node_app -->|"renders"| node_cellui
node_app -->|"renders"| node_canvas
node_app -->|"renders"| node_layerui
node_app -->|"presents"| node_cropui
node_app -->|"presents"| node_soilui
node_app -->|"presents"| node_stressui
node_canvas -->|"creates"| node_terrain
node_canvas -->|"generates"| node_cropview
node_canvas -->|"applies"| node_stressview
node_app -->|"fetches grid/terrain"| node_server
node_cropui -->|"calls"| node_mlapi
node_soilui -->|"calls"| node_mlapi
node_mlapi -.->|"submits analysis"| node_mlroutes
node_assistantui -->|"calls"| node_assistantapi
node_assistantapi -.->|"sends chat"| node_assistroutes
node_server -->|"registers routes"| node_mlroutes
node_server -->|"registers routes"| node_assistroutes
node_mlroutes -->|"analyzes image"| node_mlservice
node_mlroutes -->|"parses report"| node_soilparser
node_mlroutes -->|"builds context"| node_multimodal
node_mlservice -->|"loads / predicts"| node_inference
node_mlroutes -->|"reads grid"| node_fielddata
node_mlroutes -->|"stores analysis"| node_assistroutes
node_assistroutes -->|"requests advice"| node_groq
node_pipeline -->|"downloads imagery / elevation"| node_copernicus
node_pipeline -.->|"produces grid layers"| node_fielddata
node_server -->|"serves data"| node_fielddata

click node_app "https://github.com/aniket8983-arch/god-s-plan_deploy-/blob/main/frontend/src/App.tsx"
click node_cellui "https://github.com/aniket8983-arch/god-s-plan_deploy-/blob/main/frontend/src/components/CellInspector.tsx"
click node_canvas "https://github.com/aniket8983-arch/god-s-plan_deploy-/blob/main/frontend/src/components/ThreeCanvas.tsx"
click node_terrain "https://github.com/aniket8983-arch/god-s-plan_deploy-/blob/main/frontend/src/three/TerrainScene.ts"
click node_cropview "https://github.com/aniket8983-arch/god-s-plan_deploy-/blob/main/frontend/src/three/CropRenderer.ts"
click node_stressview "https://github.com/aniket8983-arch/god-s-plan_deploy-/blob/main/frontend/src/three/StressRiskLayer.ts"
click node_layerui "https://github.com/aniket8983-arch/god-s-plan_deploy-/blob/main/frontend/src/components/LayerToggle.tsx"
click node_cropui "https://github.com/aniket8983-arch/god-s-plan_deploy-/blob/main/frontend/src/components/CropAnalysisPanel.tsx"
click node_soilui "https://github.com/aniket8983-arch/god-s-plan_deploy-/blob/main/frontend/src/components/SoilReportPanel.tsx"
click node_stressui "https://github.com/aniket8983-arch/god-s-plan_deploy-/blob/main/frontend/src/components/StressAnalysisPanel.tsx"
click node_mlapi "https://github.com/aniket8983-arch/god-s-plan_deploy-/blob/main/frontend/src/services/mlApi.ts"
click node_assistantui "https://github.com/aniket8983-arch/god-s-plan_deploy-/blob/main/frontend/src/components/AgriculturalAssistant.tsx"
click node_assistantapi "https://github.com/aniket8983-arch/god-s-plan_deploy-/blob/main/frontend/src/services/assistantApi.ts"
click node_server "https://github.com/aniket8983-arch/god-s-plan_deploy-/blob/main/backend/server.py"
click node_mlroutes "https://github.com/aniket8983-arch/god-s-plan_deploy-/blob/main/backend/routes/ml_routes.py"
click node_assistroutes "https://github.com/aniket8983-arch/god-s-plan_deploy-/blob/main/backend/routes/assistant_routes.py"
click node_mlservice "https://github.com/aniket8983-arch/god-s-plan_deploy-/blob/main/backend/services/ml_service.py"
click node_inference "https://github.com/aniket8983-arch/god-s-plan_deploy-/blob/main/ml/inference.py"
click node_soilparser "https://github.com/aniket8983-arch/god-s-plan_deploy-/blob/main/backend/services/soil_parser.py"
click node_multimodal "https://github.com/aniket8983-arch/god-s-plan_deploy-/blob/main/backend/services/multimodal_engine.py"
click node_groq "https://github.com/aniket8983-arch/god-s-plan_deploy-/blob/main/backend/services/groq_service.py"
click node_pipeline "https://github.com/aniket8983-arch/god-s-plan_deploy-/tree/main/scripts"
click node_fielddata "https://github.com/aniket8983-arch/god-s-plan_deploy-/blob/main/backend/server.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_cellui,node_canvas,node_terrain,node_cropview,node_stressview,node_layerui toneBlue
class node_cropui,node_soilui,node_stressui,node_mlapi,node_mlservice,node_inference,node_soilparser toneAmber
class node_server,node_mlroutes,node_assistroutes toneMint
class node_assistantui,node_assistantapi,node_multimodal,node_groq toneRose
class node_pipeline,node_fielddata,node_copernicus,node_farmer toneIndigo
```

## Components

### Field Visualization

- [Dashboard](https://github.com/aniket8983-arch/god-s-plan_deploy-/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Cell Inspector](https://github.com/aniket8983-arch/god-s-plan_deploy-/blob/main/frontend/src/components/CellInspector.tsx): `frontend/src/components/CellInspector.tsx`
- [3D Canvas](https://github.com/aniket8983-arch/god-s-plan_deploy-/blob/main/frontend/src/components/ThreeCanvas.tsx): `frontend/src/components/ThreeCanvas.tsx`
- [Terrain Scene](https://github.com/aniket8983-arch/god-s-plan_deploy-/blob/main/frontend/src/three/TerrainScene.ts): `frontend/src/three/TerrainScene.ts`
- [Crop Renderer](https://github.com/aniket8983-arch/god-s-plan_deploy-/blob/main/frontend/src/three/CropRenderer.ts): `frontend/src/three/CropRenderer.ts`
- [Stress Layer](https://github.com/aniket8983-arch/god-s-plan_deploy-/blob/main/frontend/src/three/StressRiskLayer.ts): `frontend/src/three/StressRiskLayer.ts`
- [Layer Controls](https://github.com/aniket8983-arch/god-s-plan_deploy-/blob/main/frontend/src/components/LayerToggle.tsx): `frontend/src/components/LayerToggle.tsx`

### Crop Diagnostics

- [Crop Analysis](https://github.com/aniket8983-arch/god-s-plan_deploy-/blob/main/frontend/src/components/CropAnalysisPanel.tsx): `frontend/src/components/CropAnalysisPanel.tsx`
- [Soil Report](https://github.com/aniket8983-arch/god-s-plan_deploy-/blob/main/frontend/src/components/SoilReportPanel.tsx): `frontend/src/components/SoilReportPanel.tsx`
- [Stress Analysis](https://github.com/aniket8983-arch/god-s-plan_deploy-/blob/main/frontend/src/components/StressAnalysisPanel.tsx): `frontend/src/components/StressAnalysisPanel.tsx`
- [ML API Client](https://github.com/aniket8983-arch/god-s-plan_deploy-/blob/main/frontend/src/services/mlApi.ts): `frontend/src/services/mlApi.ts`
- [Image ML Service](https://github.com/aniket8983-arch/god-s-plan_deploy-/blob/main/backend/services/ml_service.py): `backend/services/ml_service.py`
- [Model Inference](https://github.com/aniket8983-arch/god-s-plan_deploy-/blob/main/ml/inference.py): `ml/inference.py`
- [Soil Parser](https://github.com/aniket8983-arch/god-s-plan_deploy-/blob/main/backend/services/soil_parser.py): `backend/services/soil_parser.py`

### Application API

- [FastAPI Server](https://github.com/aniket8983-arch/god-s-plan_deploy-/blob/main/backend/server.py): `backend/server.py`
- [ML Routes](https://github.com/aniket8983-arch/god-s-plan_deploy-/blob/main/backend/routes/ml_routes.py): `backend/routes/ml_routes.py`
- [Assistant Routes](https://github.com/aniket8983-arch/god-s-plan_deploy-/blob/main/backend/routes/assistant_routes.py): `backend/routes/assistant_routes.py`

### AI Advisory

- [Assistant Panel](https://github.com/aniket8983-arch/god-s-plan_deploy-/blob/main/frontend/src/components/AgriculturalAssistant.tsx): `frontend/src/components/AgriculturalAssistant.tsx`
- [Assistant API Client](https://github.com/aniket8983-arch/god-s-plan_deploy-/blob/main/frontend/src/services/assistantApi.ts): `frontend/src/services/assistantApi.ts`
- [Context Analysis](https://github.com/aniket8983-arch/god-s-plan_deploy-/blob/main/backend/services/multimodal_engine.py): `backend/services/multimodal_engine.py`
- [Groq Assistant](https://github.com/aniket8983-arch/god-s-plan_deploy-/blob/main/backend/services/groq_service.py): `backend/services/groq_service.py`

### Geospatial Data

- [Satellite GIS Pipeline](https://github.com/aniket8983-arch/god-s-plan_deploy-/tree/main/scripts): `scripts`
- [Grid / Terrain Data](https://github.com/aniket8983-arch/god-s-plan_deploy-/blob/main/backend/server.py): `backend/server.py`
- **Sentinel-2 / DEM**

### Other components

- **Farmer / Agronomist**

## Connections

- Farmer / Agronomist → Dashboard: uses
- Dashboard → Cell Inspector: renders (evidence: `frontend/src/App.tsx`)
- Dashboard → 3D Canvas: renders (evidence: `frontend/src/App.tsx`)
- Dashboard → Layer Controls: renders (evidence: `frontend/src/App.tsx`)
- Dashboard → Crop Analysis: presents (evidence: `frontend/src/App.tsx`)
- Dashboard → Soil Report: presents (evidence: `frontend/src/App.tsx`)
- Dashboard → Stress Analysis: presents (evidence: `frontend/src/App.tsx`)
- 3D Canvas → Terrain Scene: creates (evidence: `frontend/src/components/ThreeCanvas.tsx`)
- 3D Canvas → Crop Renderer: generates (evidence: `frontend/src/components/ThreeCanvas.tsx`)
- 3D Canvas → Stress Layer: applies (evidence: `frontend/src/components/ThreeCanvas.tsx`)
- Dashboard → FastAPI Server: fetches grid/terrain (evidence: `frontend/src/App.tsx`)
- Crop Analysis → ML API Client: calls (evidence: `frontend/src/components/CropAnalysisPanel.tsx`)
- Soil Report → ML API Client: calls (evidence: `frontend/src/components/SoilReportPanel.tsx`)
- ML API Client → ML Routes: submits analysis
- Assistant Panel → Assistant API Client: calls (evidence: `frontend/src/components/AgriculturalAssistant.tsx`)
- Assistant API Client → Assistant Routes: sends chat
- FastAPI Server → ML Routes: registers routes (evidence: `backend/server.py`)
- FastAPI Server → Assistant Routes: registers routes (evidence: `backend/server.py`)
- ML Routes → Image ML Service: analyzes image (evidence: `backend/routes/ml_routes.py`)
- ML Routes → Soil Parser: parses report (evidence: `backend/routes/ml_routes.py`)
- ML Routes → Context Analysis: builds context (evidence: `backend/routes/ml_routes.py`)
- Image ML Service → Model Inference: loads / predicts (evidence: `backend/services/ml_service.py`)
- ML Routes → Grid / Terrain Data: reads grid (evidence: `backend/routes/ml_routes.py`)
- ML Routes → Assistant Routes: stores analysis (evidence: `backend/routes/ml_routes.py`)
- Assistant Routes → Groq Assistant: requests advice (evidence: `backend/routes/assistant_routes.py`)
- Satellite GIS Pipeline → Sentinel-2 / DEM: downloads imagery / elevation
- Satellite GIS Pipeline → Grid / Terrain Data: produces grid layers
- FastAPI Server → Grid / Terrain Data: serves data (evidence: `backend/server.py`)
