# drk28122006/pune-climate-ml architecture

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

- Interactive diagram: https://gitdiagram.com/drk28122006/pune-climate-ml
- Repository: https://github.com/drk28122006/pune-climate-ml

## Overview

Dishadharti screens Pune building proposals for flood, night-time heat, tree-cover loss, and embodied carbon, returning an impact score, explanation, and measurable redesign conditions. The main documented workflow is proposal intake and geometry validation, ward and site-data lookup, deterministic scoring, recommendation and relocation analysis, then report generation. A browser dashboard exposes assessment, map, optimizer, and report views through an API; the repository also contains a separate Node backend. Several links among unsampled pipeline modules and backend services are documented by the CLI or README rather than inspected source, so those edges cite that evidence and are kept conservative.

Main entry points: [`backend/src/app.js`](https://github.com/drk28122006/pune-climate-ml/blob/main/backend/src/app.js) (API routes), [`ml_pipeline/cli.py`](https://github.com/drk28122006/pune-climate-ml/blob/main/ml_pipeline/cli.py) (Pipeline CLI), [`backend/src/services/assessmentService.js`](https://github.com/drk28122006/pune-climate-ml/blob/main/backend/src/services/assessmentService.js) (Assessment service), [`frontend/src/pages/AssessmentResult.jsx`](https://github.com/drk28122006/pune-climate-ml/blob/main/frontend/src/pages/AssessmentResult.jsx) (Assessment result)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Planner interface"]
  node_dashboard["Dashboard<br/>[Dashboard.jsx]"]
  node_new_assessment["New assessment<br/>[NewAssessment.jsx]"]
  node_result_view["Assessment result"]
  node_climate_map["Climate map<br/>[ClimateMap.jsx]"]
  node_optimizer_view["Optimizer<br/>[Optimizer.jsx]"]
  node_reports_view["Reports<br/>[Reports.jsx]"]
end

subgraph group_api["Backend API"]
  node_api_routes["API routes<br/>[app.js]"]
  node_auth["Authentication<br/>[authService.js]"]
  node_assessment_service["Assessment service"]
  node_recommendation_service["Recommendation service"]
  node_report_service["Report service<br/>[reportService.js]"]
  node_storage[("Assessment storage<br/>[postgresStore.js]")]
  node_object_storage[("Document storage<br/>[objectStorage.js]")]
  node_queue["Job queues<br/>[queueService.js]"]
end

subgraph group_intake["Proposal analysis"]
  node_cli["Pipeline CLI<br/>[cli.py]"]
  node_validation["Intake validation<br/>[validate.py]"]
  node_geometry["Geometry analysis<br/>[geometry.py]"]
  node_reference_data[("Pune reference data")]
  node_tree_index[("Tree census index<br/>[tree_index.py]")]
end

subgraph group_assessment["Scoring and design"]
  node_canopy["Canopy ledger<br/>[canopy.py]"]
  node_scoring["Climate scoring<br/>[scoring.py]"]
  node_recommendations["Redesign recommendations<br/>[recommendations.py]"]
  node_relocation["Tree relocation<br/>[relocation.py]"]
end

subgraph group_report["Results and reporting"]
  node_report_render["Report rendering<br/>[render.py]"]
  node_narrative["Narrative generation<br/>[narrative.py]"]
end

node_officer(("Municipal officer"))
node_external_llm(("Language model"))

node_officer -->|"enters proposal"| node_new_assessment
node_officer -->|"views projects"| node_dashboard
node_officer -->|"views climate"| node_climate_map
node_officer -->|"explores redesign"| node_optimizer_view
node_officer -->|"opens reports"| node_reports_view
node_new_assessment -->|"submits assessment"| node_api_routes
node_result_view -->|"requests result"| node_api_routes
node_api_routes -->|"authenticates"| node_auth
node_api_routes -->|"creates assessment"| node_assessment_service
node_api_routes -->|"optimizes project"| node_recommendation_service
node_api_routes -->|"streams report"| node_report_service
node_api_routes -->|"stores assessments"| node_storage
node_api_routes -->|"stores documents"| node_object_storage
node_assessment_service -->|"scores proposal"| node_scoring
node_assessment_service -.->|"dispatches analysis"| node_queue
node_cli -->|"validates intake"| node_validation
node_cli -->|"looks up site"| node_geometry
node_cli -->|"loads indicators"| node_reference_data
node_cli -->|"queries trees"| node_tree_index
node_cli -->|"builds ledger"| node_canopy
node_cli -->|"computes factors"| node_scoring
node_cli -->|"builds conditions"| node_recommendations
node_cli -.->|"assesses relocation"| node_relocation
node_cli -->|"renders result"| node_report_render
node_report_render -.->|"adds explanation"| node_narrative
node_narrative -.->|"requests prose"| node_external_llm
node_api_routes -.->|"invokes pipeline"| node_cli
node_api_routes -.->|"returns dashboard data"| node_dashboard
node_api_routes -->|"returns assessment"| node_result_view
node_recommendation_service -->|"uses factor scores"| node_scoring
node_report_service -.->|"provides report"| node_result_view

click node_dashboard "https://github.com/drk28122006/pune-climate-ml/blob/main/frontend/src/pages/Dashboard.jsx"
click node_new_assessment "https://github.com/drk28122006/pune-climate-ml/blob/main/frontend/src/pages/NewAssessment.jsx"
click node_result_view "https://github.com/drk28122006/pune-climate-ml/blob/main/frontend/src/pages/AssessmentResult.jsx"
click node_climate_map "https://github.com/drk28122006/pune-climate-ml/blob/main/frontend/src/pages/ClimateMap.jsx"
click node_optimizer_view "https://github.com/drk28122006/pune-climate-ml/blob/main/frontend/src/pages/Optimizer.jsx"
click node_reports_view "https://github.com/drk28122006/pune-climate-ml/blob/main/frontend/src/pages/Reports.jsx"
click node_api_routes "https://github.com/drk28122006/pune-climate-ml/blob/main/backend/src/app.js"
click node_auth "https://github.com/drk28122006/pune-climate-ml/blob/main/backend/src/services/authService.js"
click node_assessment_service "https://github.com/drk28122006/pune-climate-ml/blob/main/backend/src/services/assessmentService.js"
click node_recommendation_service "https://github.com/drk28122006/pune-climate-ml/blob/main/backend/src/services/recommendationService.js"
click node_report_service "https://github.com/drk28122006/pune-climate-ml/blob/main/backend/src/services/reportService.js"
click node_storage "https://github.com/drk28122006/pune-climate-ml/blob/main/backend/src/storage/postgresStore.js"
click node_object_storage "https://github.com/drk28122006/pune-climate-ml/blob/main/backend/src/storage/objectStorage.js"
click node_queue "https://github.com/drk28122006/pune-climate-ml/blob/main/backend/src/jobs/queueService.js"
click node_cli "https://github.com/drk28122006/pune-climate-ml/blob/main/ml_pipeline/cli.py"
click node_validation "https://github.com/drk28122006/pune-climate-ml/blob/main/ml_pipeline/intake/validate.py"
click node_geometry "https://github.com/drk28122006/pune-climate-ml/blob/main/ml_pipeline/core/geometry.py"
click node_reference_data "https://github.com/drk28122006/pune-climate-ml/blob/main/ml_pipeline/data/reference_layers.py"
click node_tree_index "https://github.com/drk28122006/pune-climate-ml/blob/main/ml_pipeline/data/tree_index.py"
click node_canopy "https://github.com/drk28122006/pune-climate-ml/blob/main/ml_pipeline/core/canopy.py"
click node_scoring "https://github.com/drk28122006/pune-climate-ml/blob/main/ml_pipeline/core/scoring.py"
click node_recommendations "https://github.com/drk28122006/pune-climate-ml/blob/main/ml_pipeline/core/recommendations.py"
click node_relocation "https://github.com/drk28122006/pune-climate-ml/blob/main/ml_pipeline/core/relocation.py"
click node_report_render "https://github.com/drk28122006/pune-climate-ml/blob/main/ml_pipeline/report/render.py"
click node_narrative "https://github.com/drk28122006/pune-climate-ml/blob/main/ml_pipeline/report/narrative.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_dashboard,node_new_assessment,node_result_view,node_climate_map,node_optimizer_view,node_reports_view toneBlue
class node_api_routes,node_auth,node_assessment_service,node_recommendation_service,node_report_service,node_storage,node_object_storage,node_queue toneAmber
class node_cli,node_validation,node_geometry,node_reference_data,node_tree_index toneMint
class node_canopy,node_scoring,node_recommendations,node_relocation toneRose
class node_report_render,node_narrative,node_officer,node_external_llm toneIndigo
```

## Components

### Planner interface

- [Dashboard](https://github.com/drk28122006/pune-climate-ml/blob/main/frontend/src/pages/Dashboard.jsx): `frontend/src/pages/Dashboard.jsx`
- [New assessment](https://github.com/drk28122006/pune-climate-ml/blob/main/frontend/src/pages/NewAssessment.jsx): `frontend/src/pages/NewAssessment.jsx`
- [Assessment result](https://github.com/drk28122006/pune-climate-ml/blob/main/frontend/src/pages/AssessmentResult.jsx): `frontend/src/pages/AssessmentResult.jsx`
- [Climate map](https://github.com/drk28122006/pune-climate-ml/blob/main/frontend/src/pages/ClimateMap.jsx): `frontend/src/pages/ClimateMap.jsx`
- [Optimizer](https://github.com/drk28122006/pune-climate-ml/blob/main/frontend/src/pages/Optimizer.jsx): `frontend/src/pages/Optimizer.jsx`
- [Reports](https://github.com/drk28122006/pune-climate-ml/blob/main/frontend/src/pages/Reports.jsx): `frontend/src/pages/Reports.jsx`

### Backend API

- [API routes](https://github.com/drk28122006/pune-climate-ml/blob/main/backend/src/app.js): `backend/src/app.js`
- [Authentication](https://github.com/drk28122006/pune-climate-ml/blob/main/backend/src/services/authService.js): `backend/src/services/authService.js`
- [Assessment service](https://github.com/drk28122006/pune-climate-ml/blob/main/backend/src/services/assessmentService.js): `backend/src/services/assessmentService.js`
- [Recommendation service](https://github.com/drk28122006/pune-climate-ml/blob/main/backend/src/services/recommendationService.js): `backend/src/services/recommendationService.js`
- [Report service](https://github.com/drk28122006/pune-climate-ml/blob/main/backend/src/services/reportService.js): `backend/src/services/reportService.js`
- [Assessment storage](https://github.com/drk28122006/pune-climate-ml/blob/main/backend/src/storage/postgresStore.js): `backend/src/storage/postgresStore.js`
- [Document storage](https://github.com/drk28122006/pune-climate-ml/blob/main/backend/src/storage/objectStorage.js): `backend/src/storage/objectStorage.js`
- [Job queues](https://github.com/drk28122006/pune-climate-ml/blob/main/backend/src/jobs/queueService.js): `backend/src/jobs/queueService.js`

### Proposal analysis

- [Pipeline CLI](https://github.com/drk28122006/pune-climate-ml/blob/main/ml_pipeline/cli.py): `ml_pipeline/cli.py`
- [Intake validation](https://github.com/drk28122006/pune-climate-ml/blob/main/ml_pipeline/intake/validate.py): `ml_pipeline/intake/validate.py`
- [Geometry analysis](https://github.com/drk28122006/pune-climate-ml/blob/main/ml_pipeline/core/geometry.py): `ml_pipeline/core/geometry.py`
- [Pune reference data](https://github.com/drk28122006/pune-climate-ml/blob/main/ml_pipeline/data/reference_layers.py): `ml_pipeline/data/reference_layers.py`
- [Tree census index](https://github.com/drk28122006/pune-climate-ml/blob/main/ml_pipeline/data/tree_index.py): `ml_pipeline/data/tree_index.py`

### Scoring and design

- [Canopy ledger](https://github.com/drk28122006/pune-climate-ml/blob/main/ml_pipeline/core/canopy.py): `ml_pipeline/core/canopy.py`
- [Climate scoring](https://github.com/drk28122006/pune-climate-ml/blob/main/ml_pipeline/core/scoring.py): `ml_pipeline/core/scoring.py`
- [Redesign recommendations](https://github.com/drk28122006/pune-climate-ml/blob/main/ml_pipeline/core/recommendations.py): `ml_pipeline/core/recommendations.py`
- [Tree relocation](https://github.com/drk28122006/pune-climate-ml/blob/main/ml_pipeline/core/relocation.py): `ml_pipeline/core/relocation.py`

### Results and reporting

- [Report rendering](https://github.com/drk28122006/pune-climate-ml/blob/main/ml_pipeline/report/render.py): `ml_pipeline/report/render.py`
- [Narrative generation](https://github.com/drk28122006/pune-climate-ml/blob/main/ml_pipeline/report/narrative.py): `ml_pipeline/report/narrative.py`

### Other components

- **Municipal officer**
- **Language model**

## Connections

- Municipal officer → New assessment: enters proposal (evidence: `README.md`)
- Municipal officer → Dashboard: views projects
- Municipal officer → Climate map: views climate
- Municipal officer → Optimizer: explores redesign
- Municipal officer → Reports: opens reports
- New assessment → API routes: submits assessment (evidence: `frontend/src/pages/NewAssessment.jsx`)
- Assessment result → API routes: requests result (evidence: `frontend/src/pages/AssessmentResult.jsx`)
- API routes → Authentication: authenticates (evidence: `backend/src/app.js`)
- API routes → Assessment service: creates assessment (evidence: `backend/src/app.js`)
- API routes → Recommendation service: optimizes project (evidence: `backend/src/app.js`)
- API routes → Report service: streams report (evidence: `backend/src/app.js`)
- API routes → Assessment storage: stores assessments (evidence: `backend/src/app.js`)
- API routes → Document storage: stores documents (evidence: `backend/src/app.js`)
- Assessment service → Climate scoring: scores proposal (evidence: `backend/src/services/assessmentService.js`)
- Assessment service → Job queues: dispatches analysis
- Pipeline CLI → Intake validation: validates intake (evidence: `ml_pipeline/cli.py`)
- Pipeline CLI → Geometry analysis: looks up site (evidence: `ml_pipeline/cli.py`)
- Pipeline CLI → Pune reference data: loads indicators (evidence: `ml_pipeline/cli.py`)
- Pipeline CLI → Tree census index: queries trees (evidence: `ml_pipeline/cli.py`)
- Pipeline CLI → Canopy ledger: builds ledger (evidence: `ml_pipeline/cli.py`)
- Pipeline CLI → Climate scoring: computes factors (evidence: `ml_pipeline/cli.py`)
- Pipeline CLI → Redesign recommendations: builds conditions (evidence: `ml_pipeline/cli.py`)
- Pipeline CLI → Tree relocation: assesses relocation (evidence: `ml_pipeline/cli.py`)
- Pipeline CLI → Report rendering: renders result (evidence: `ml_pipeline/cli.py`)
- Report rendering → Narrative generation: adds explanation
- Narrative generation → Language model: requests prose (evidence: `README.md`)
- API routes → Pipeline CLI: invokes pipeline
- API routes → Dashboard: returns dashboard data
- API routes → Assessment result: returns assessment (evidence: `frontend/src/pages/AssessmentResult.jsx`)
- Recommendation service → Climate scoring: uses factor scores (evidence: `backend/src/services/recommendationService.js`)
- Report service → Assessment result: provides report
