# mirajus-salehin/smartsip_dss_engine architecture

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

- Interactive diagram: https://gitdiagram.com/mirajus-salehin/smartsip_dss_engine
- Repository: https://github.com/mirajus-salehin/smartsip_dss_engine

## Overview

SmartSIP DSS is a Streamlit decision-support application for farm irrigation and solar-pump planning. A user selects a location, crop, field size, and irrigation method; the irrigation and climate features use weather and crop data to estimate water needs, and the solar-sizing feature derives pump and PV recommendations. Separate pages provide a crop advisory report, climate summaries, and nearby operational solar-panel comparisons. The excerpts establish the main calculation calls; the nearby-panel page was indexed but its implementation was not shown, so that connection is marked unverified.

Main entry points: [`app.py`](https://github.com/mirajus-salehin/smartsip_dss_engine/blob/main/app.py) (Farm setup), [`pages/solar.py`](https://github.com/mirajus-salehin/smartsip_dss_engine/blob/main/pages/solar.py) (Solar sizing), [`services/pump_pv_service.py`](https://github.com/mirajus-salehin/smartsip_dss_engine/blob/main/services/pump_pv_service.py) (Pump and PV sizing), [`pages/irrigation.py`](https://github.com/mirajus-salehin/smartsip_dss_engine/blob/main/pages/irrigation.py) (Irrigation analysis)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Application pages"]
  node_home["Farm setup<br/>[app.py]"]
  node_irrigation["Irrigation analysis<br/>[irrigation.py]"]
  node_climate["Climate explorer<br/>[climate.py]"]
  node_solar["Solar sizing<br/>[solar.py]"]
  node_business["Farm advisory<br/>[business.py]"]
  node_nearby["Nearby panels<br/>[nearest_panels.py]"]
end

subgraph group_agronomy["Crop and irrigation"]
  node_crops["Crop coefficients<br/>[crop_service.py]"]
  node_cropdata[("Crop dataset")]
  node_water["Water demand model"]
  node_weather["Weather service<br/>[weather_service.py]"]
end

subgraph group_energy["Solar and panels"]
  node_pump["Pump and PV sizing<br/>[pump_pv_service.py]"]
  node_pumpdata[("Pump head ranges")]
  node_selector["Panel selection<br/>[pv_selector.py]"]
  node_paneldata[("SREDA plant dataset")]
end

subgraph group_shared["Shared interface"]
  node_sidebar["Page navigation<br/>[sidebar.py]"]
  node_styles["Page styling<br/>[styles.py]"]
end

node_farmer(("Farm user"))
node_weatherapi["Open-Meteo Archive"]

node_farmer -->|"sets farm inputs"| node_home
node_home -->|"loads crop choices"| node_crops
node_home -->|"infers division"| node_pump
node_home -->|"opens panel search"| node_nearby
node_home -->|"reads crop data"| node_cropdata
node_irrigation -->|"calculates demand"| node_water
node_irrigation -->|"opens sizing"| node_solar
node_irrigation -->|"opens advisory"| node_business
node_water -->|"gets crop data"| node_crops
node_water -->|"fetches climate"| node_weather
node_weather -->|"requests archive data"| node_weatherapi
node_climate -->|"fetches climate"| node_weather
node_climate -->|"infers division"| node_pump
node_solar -->|"calculates demand"| node_water
node_solar -->|"sizes pump and PV"| node_pump
node_solar -->|"selects nearby panels"| node_selector
node_business -->|"calculates stage plan"| node_water
node_business -->|"sizes pump"| node_pump
node_pump -->|"loads head ranges"| node_pumpdata
node_pump -->|"uses panel selection"| node_selector
node_nearby -.->|"may query panels"| node_selector
node_selector -.->|"reads plant records"| node_paneldata
node_home -->|"renders navigation"| node_sidebar
node_irrigation -->|"renders navigation"| node_sidebar
node_climate -->|"renders navigation"| node_sidebar
node_solar -->|"renders navigation"| node_sidebar
node_business -->|"renders navigation"| node_sidebar
node_nearby -->|"renders navigation"| node_sidebar
node_home -->|"loads styling"| node_styles
node_irrigation -->|"loads styling"| node_styles
node_climate -->|"loads styling"| node_styles
node_solar -->|"loads styling"| node_styles
node_business -->|"loads styling"| node_styles
node_nearby -->|"loads styling"| node_styles

click node_home "https://github.com/mirajus-salehin/smartsip_dss_engine/blob/main/app.py"
click node_irrigation "https://github.com/mirajus-salehin/smartsip_dss_engine/blob/main/pages/irrigation.py"
click node_climate "https://github.com/mirajus-salehin/smartsip_dss_engine/blob/main/pages/climate.py"
click node_solar "https://github.com/mirajus-salehin/smartsip_dss_engine/blob/main/pages/solar.py"
click node_business "https://github.com/mirajus-salehin/smartsip_dss_engine/blob/main/pages/business.py"
click node_nearby "https://github.com/mirajus-salehin/smartsip_dss_engine/blob/main/pages/nearest_panels.py"
click node_crops "https://github.com/mirajus-salehin/smartsip_dss_engine/blob/main/services/crop_service.py"
click node_cropdata "https://github.com/mirajus-salehin/smartsip_dss_engine/blob/main/db/crop_coefficients.json"
click node_water "https://github.com/mirajus-salehin/smartsip_dss_engine/blob/main/services/irrigation_service.py"
click node_weather "https://github.com/mirajus-salehin/smartsip_dss_engine/blob/main/services/weather_service.py"
click node_pump "https://github.com/mirajus-salehin/smartsip_dss_engine/blob/main/services/pump_pv_service.py"
click node_pumpdata "https://github.com/mirajus-salehin/smartsip_dss_engine/blob/main/db/pump%2Cjson"
click node_selector "https://github.com/mirajus-salehin/smartsip_dss_engine/blob/main/services/pv_selector.py"
click node_paneldata "https://github.com/mirajus-salehin/smartsip_dss_engine/blob/main/db/SREDA_data_2026_updated.csv"
click node_sidebar "https://github.com/mirajus-salehin/smartsip_dss_engine/blob/main/sidebar.py"
click node_styles "https://github.com/mirajus-salehin/smartsip_dss_engine/blob/main/ui/styles.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_home,node_irrigation,node_climate,node_solar,node_business,node_nearby,node_farmer toneBlue
class node_crops,node_cropdata,node_water,node_weather toneAmber
class node_pump,node_pumpdata,node_selector,node_paneldata toneMint
class node_sidebar,node_styles toneRose
class node_weatherapi toneIndigo
```

## Components

### Application pages

- [Farm setup](https://github.com/mirajus-salehin/smartsip_dss_engine/blob/main/app.py): `app.py`
- [Irrigation analysis](https://github.com/mirajus-salehin/smartsip_dss_engine/blob/main/pages/irrigation.py): `pages/irrigation.py`
- [Climate explorer](https://github.com/mirajus-salehin/smartsip_dss_engine/blob/main/pages/climate.py): `pages/climate.py`
- [Solar sizing](https://github.com/mirajus-salehin/smartsip_dss_engine/blob/main/pages/solar.py): `pages/solar.py`
- [Farm advisory](https://github.com/mirajus-salehin/smartsip_dss_engine/blob/main/pages/business.py): `pages/business.py`
- [Nearby panels](https://github.com/mirajus-salehin/smartsip_dss_engine/blob/main/pages/nearest_panels.py): `pages/nearest_panels.py`

### Crop and irrigation

- [Crop coefficients](https://github.com/mirajus-salehin/smartsip_dss_engine/blob/main/services/crop_service.py): `services/crop_service.py`
- [Crop dataset](https://github.com/mirajus-salehin/smartsip_dss_engine/blob/main/db/crop_coefficients.json): `db/crop_coefficients.json`
- [Water demand model](https://github.com/mirajus-salehin/smartsip_dss_engine/blob/main/services/irrigation_service.py): `services/irrigation_service.py`
- [Weather service](https://github.com/mirajus-salehin/smartsip_dss_engine/blob/main/services/weather_service.py): `services/weather_service.py`

### Solar and panels

- [Pump and PV sizing](https://github.com/mirajus-salehin/smartsip_dss_engine/blob/main/services/pump_pv_service.py): `services/pump_pv_service.py`
- [Pump head ranges](https://github.com/mirajus-salehin/smartsip_dss_engine/blob/main/db/pump%2Cjson): `db/pump,json`
- [Panel selection](https://github.com/mirajus-salehin/smartsip_dss_engine/blob/main/services/pv_selector.py): `services/pv_selector.py`
- [SREDA plant dataset](https://github.com/mirajus-salehin/smartsip_dss_engine/blob/main/db/SREDA_data_2026_updated.csv): `db/SREDA_data_2026_updated.csv`

### Shared interface

- [Page navigation](https://github.com/mirajus-salehin/smartsip_dss_engine/blob/main/sidebar.py): `sidebar.py`
- [Page styling](https://github.com/mirajus-salehin/smartsip_dss_engine/blob/main/ui/styles.py): `ui/styles.py`

### Other components

- **Farm user**
- **Open-Meteo Archive**

## Connections

- Farm user → Farm setup: sets farm inputs (evidence: `app.py`)
- Farm setup → Crop coefficients: loads crop choices (evidence: `app.py`)
- Farm setup → Pump and PV sizing: infers division (evidence: `app.py`)
- Farm setup → Nearby panels: opens panel search (evidence: `app.py`)
- Farm setup → Crop dataset: reads crop data
- Irrigation analysis → Water demand model: calculates demand (evidence: `pages/irrigation.py`)
- Irrigation analysis → Solar sizing: opens sizing (evidence: `pages/irrigation.py`)
- Irrigation analysis → Farm advisory: opens advisory (evidence: `pages/irrigation.py`)
- Water demand model → Crop coefficients: gets crop data (evidence: `services/irrigation_service.py`)
- Water demand model → Weather service: fetches climate (evidence: `services/irrigation_service.py`)
- Weather service → Open-Meteo Archive: requests archive data (evidence: `services/weather_service.py`)
- Climate explorer → Weather service: fetches climate (evidence: `pages/climate.py`)
- Climate explorer → Pump and PV sizing: infers division (evidence: `pages/climate.py`)
- Solar sizing → Water demand model: calculates demand (evidence: `pages/solar.py`)
- Solar sizing → Pump and PV sizing: sizes pump and PV (evidence: `pages/solar.py`)
- Solar sizing → Panel selection: selects nearby panels (evidence: `pages/solar.py`)
- Farm advisory → Water demand model: calculates stage plan (evidence: `pages/business.py`)
- Farm advisory → Pump and PV sizing: sizes pump (evidence: `pages/business.py`)
- Pump and PV sizing → Pump head ranges: loads head ranges (evidence: `services/pump_pv_service.py`)
- Pump and PV sizing → Panel selection: uses panel selection (evidence: `services/pump_pv_service.py`)
- Nearby panels → Panel selection: may query panels (evidence: `pages/nearest_panels.py`)
- Panel selection → SREDA plant dataset: reads plant records
- Farm setup → Page navigation: renders navigation (evidence: `app.py`)
- Irrigation analysis → Page navigation: renders navigation (evidence: `pages/irrigation.py`)
- Climate explorer → Page navigation: renders navigation (evidence: `pages/climate.py`)
- Solar sizing → Page navigation: renders navigation (evidence: `pages/solar.py`)
- Farm advisory → Page navigation: renders navigation (evidence: `pages/business.py`)
- Nearby panels → Page navigation: renders navigation (evidence: `pages/nearest_panels.py`)
- Farm setup → Page styling: loads styling (evidence: `app.py`)
- Irrigation analysis → Page styling: loads styling (evidence: `pages/irrigation.py`)
- Climate explorer → Page styling: loads styling (evidence: `pages/climate.py`)
- Solar sizing → Page styling: loads styling (evidence: `pages/solar.py`)
- Farm advisory → Page styling: loads styling (evidence: `pages/business.py`)
- Nearby panels → Page styling: loads styling (evidence: `pages/nearest_panels.py`)
