# mugilarasu041-dotcom/ai-uzhavan architecture

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

- Interactive diagram: https://gitdiagram.com/mugilarasu041-dotcom/ai-uzhavan
- Repository: https://github.com/mugilarasu041-dotcom/ai-uzhavan

## Overview

Uzhavan is a Tamil Nadu agriculture and weather dashboard with Tamil/English support. Users select or search a district to view weather, forecasts, alerts and a map, then access agricultural advice and specialist tools for crop disease, dams, market prices and government schemes. The frontend is coordinated by App; a server provides API routes, including weather fallback handling and scheme data. Edges reflect the supplied excerpts and SOURCE INDEX references; some UI-to-feature connections are shown at the App level because implementation details were not sampled.

Main entry points: [`src/App.tsx`](https://github.com/mugilarasu041-dotcom/ai-uzhavan/blob/main/src/App.tsx) (Dashboard App), [`server.ts`](https://github.com/mugilarasu041-dotcom/ai-uzhavan/blob/main/server.ts) (API Server), [`src/types/weather.ts`](https://github.com/mugilarasu041-dotcom/ai-uzhavan/blob/main/src/types/weather.ts) (Weather Types), [`src/services/weatherService.ts`](https://github.com/mugilarasu041-dotcom/ai-uzhavan/blob/main/src/services/weatherService.ts) (Weather Service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard Experience"]
  node_app["Dashboard App<br/>[App.tsx]"]
  node_weather_card["Weather Card<br/>[WeatherCard.tsx]"]
  node_forecast["Forecast Strip<br/>[ForecastStrip.tsx]"]
  node_map["District Map<br/>[TamilNaduMap.tsx]"]
  node_alerts["Weather Alerts<br/>[AlertsSection.tsx]"]
  node_analytics["Weather Analytics"]
end

subgraph group_advisory["Weather &amp; Advisory"]
  node_weather_service["Weather Service<br/>[weatherService.ts]"]
  node_agri_advice["Agri Weather Bulletin"]
  node_ai_assistant["AI Weather Assistant"]
end

subgraph group_farm_tools["Farmer Tools"]
  node_crop_scanner["Crop Disease Scanner"]
  node_dam_monitor["Dam Water Monitor"]
  node_market_board["Market Price Board"]
  node_schemes_portal["Schemes Portal"]
end

subgraph group_backend["API &amp; Domain Data"]
  node_server["API Server<br/>[server.ts]"]
  node_weather_types["Weather Types<br/>[weather.ts]"]
  node_district_data["District &amp; Soil Data<br/>[districts.ts]"]
  node_alert_data["Alert Data<br/>[alerts.ts]"]
  node_disease_data["Disease &amp; Remedy Data<br/>[cropDiseases.ts]"]
  node_dam_data["Dam Records<br/>[damData.ts]"]
  node_market_data["Market Prices<br/>[marketPrices.ts]"]
  node_scheme_data["Agriculture Schemes<br/>[agriSchemes.ts]"]
end

node_farmer(("Farmer"))

node_farmer -->|"uses"| node_app
node_app -->|"renders"| node_weather_card
node_app -->|"renders"| node_forecast
node_app -->|"renders"| node_map
node_app -->|"renders"| node_alerts
node_app -->|"renders"| node_analytics
node_app -->|"renders"| node_agri_advice
node_app -->|"renders"| node_ai_assistant
node_app -->|"renders"| node_crop_scanner
node_app -->|"renders"| node_dam_monitor
node_app -->|"renders"| node_market_board
node_app -->|"renders"| node_schemes_portal
node_app -->|"gets weather"| node_weather_service
node_weather_service -->|"requests weather"| node_server
node_server -->|"fetches weather"| node_weather_service
node_server -->|"reads"| node_district_data
node_server -->|"reads"| node_dam_data
node_server -->|"reads"| node_market_data
node_server -->|"serves schemes"| node_scheme_data
node_server -->|"uses"| node_disease_data
node_weather_service -->|"uses types"| node_weather_types
node_weather_card -->|"uses types"| node_weather_types
node_forecast -->|"uses types"| node_weather_types
node_map -->|"filters districts"| node_district_data
node_map -->|"uses types"| node_weather_types
node_alerts -->|"uses alerts"| node_alert_data
node_alerts -->|"uses types"| node_weather_types
node_agri_advice -->|"uses soil data"| node_district_data
node_agri_advice -->|"uses types"| node_weather_types
node_ai_assistant -->|"uses district data"| node_district_data
node_ai_assistant -->|"uses types"| node_weather_types
node_crop_scanner -->|"uses remedies"| node_disease_data
node_dam_monitor -->|"uses records"| node_dam_data
node_market_board -->|"uses prices"| node_market_data
node_schemes_portal -->|"uses schemes"| node_scheme_data
node_analytics -->|"uses types"| node_weather_types

click node_app "https://github.com/mugilarasu041-dotcom/ai-uzhavan/blob/main/src/App.tsx"
click node_weather_card "https://github.com/mugilarasu041-dotcom/ai-uzhavan/blob/main/src/components/WeatherCard.tsx"
click node_forecast "https://github.com/mugilarasu041-dotcom/ai-uzhavan/blob/main/src/components/ForecastStrip.tsx"
click node_map "https://github.com/mugilarasu041-dotcom/ai-uzhavan/blob/main/src/components/TamilNaduMap.tsx"
click node_alerts "https://github.com/mugilarasu041-dotcom/ai-uzhavan/blob/main/src/components/AlertsSection.tsx"
click node_analytics "https://github.com/mugilarasu041-dotcom/ai-uzhavan/blob/main/src/components/YearlyRealTimeAnalytics.tsx"
click node_weather_service "https://github.com/mugilarasu041-dotcom/ai-uzhavan/blob/main/src/services/weatherService.ts"
click node_agri_advice "https://github.com/mugilarasu041-dotcom/ai-uzhavan/blob/main/src/components/AgriWeatherBulletin.tsx"
click node_ai_assistant "https://github.com/mugilarasu041-dotcom/ai-uzhavan/blob/main/src/components/AiWeatherAssistant.tsx"
click node_crop_scanner "https://github.com/mugilarasu041-dotcom/ai-uzhavan/blob/main/src/components/CropDiseaseScanner.tsx"
click node_dam_monitor "https://github.com/mugilarasu041-dotcom/ai-uzhavan/blob/main/src/components/DamWaterMonitor.tsx"
click node_market_board "https://github.com/mugilarasu041-dotcom/ai-uzhavan/blob/main/src/components/MarketPriceBoard.tsx"
click node_schemes_portal "https://github.com/mugilarasu041-dotcom/ai-uzhavan/blob/main/src/components/TnAgriSchemesPortal.tsx"
click node_server "https://github.com/mugilarasu041-dotcom/ai-uzhavan/blob/main/server.ts"
click node_weather_types "https://github.com/mugilarasu041-dotcom/ai-uzhavan/blob/main/src/types/weather.ts"
click node_district_data "https://github.com/mugilarasu041-dotcom/ai-uzhavan/blob/main/src/data/districts.ts"
click node_alert_data "https://github.com/mugilarasu041-dotcom/ai-uzhavan/blob/main/src/data/alerts.ts"
click node_disease_data "https://github.com/mugilarasu041-dotcom/ai-uzhavan/blob/main/src/data/cropDiseases.ts"
click node_dam_data "https://github.com/mugilarasu041-dotcom/ai-uzhavan/blob/main/src/data/damData.ts"
click node_market_data "https://github.com/mugilarasu041-dotcom/ai-uzhavan/blob/main/src/data/marketPrices.ts"
click node_scheme_data "https://github.com/mugilarasu041-dotcom/ai-uzhavan/blob/main/src/data/agriSchemes.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_app,node_weather_card,node_forecast,node_map,node_alerts,node_analytics toneBlue
class node_weather_service,node_agri_advice,node_ai_assistant toneAmber
class node_crop_scanner,node_dam_monitor,node_market_board,node_schemes_portal toneMint
class node_server,node_weather_types,node_district_data,node_alert_data,node_disease_data,node_dam_data,node_market_data,node_scheme_data toneRose
class node_farmer toneIndigo
```

## Components

### Dashboard Experience

- [Dashboard App](https://github.com/mugilarasu041-dotcom/ai-uzhavan/blob/main/src/App.tsx): `src/App.tsx`
- [Weather Card](https://github.com/mugilarasu041-dotcom/ai-uzhavan/blob/main/src/components/WeatherCard.tsx): `src/components/WeatherCard.tsx`
- [Forecast Strip](https://github.com/mugilarasu041-dotcom/ai-uzhavan/blob/main/src/components/ForecastStrip.tsx): `src/components/ForecastStrip.tsx`
- [District Map](https://github.com/mugilarasu041-dotcom/ai-uzhavan/blob/main/src/components/TamilNaduMap.tsx): `src/components/TamilNaduMap.tsx`
- [Weather Alerts](https://github.com/mugilarasu041-dotcom/ai-uzhavan/blob/main/src/components/AlertsSection.tsx): `src/components/AlertsSection.tsx`
- [Weather Analytics](https://github.com/mugilarasu041-dotcom/ai-uzhavan/blob/main/src/components/YearlyRealTimeAnalytics.tsx): `src/components/YearlyRealTimeAnalytics.tsx`

### Weather & Advisory

- [Weather Service](https://github.com/mugilarasu041-dotcom/ai-uzhavan/blob/main/src/services/weatherService.ts): `src/services/weatherService.ts`
- [Agri Weather Bulletin](https://github.com/mugilarasu041-dotcom/ai-uzhavan/blob/main/src/components/AgriWeatherBulletin.tsx): `src/components/AgriWeatherBulletin.tsx`
- [AI Weather Assistant](https://github.com/mugilarasu041-dotcom/ai-uzhavan/blob/main/src/components/AiWeatherAssistant.tsx): `src/components/AiWeatherAssistant.tsx`

### Farmer Tools

- [Crop Disease Scanner](https://github.com/mugilarasu041-dotcom/ai-uzhavan/blob/main/src/components/CropDiseaseScanner.tsx): `src/components/CropDiseaseScanner.tsx`
- [Dam Water Monitor](https://github.com/mugilarasu041-dotcom/ai-uzhavan/blob/main/src/components/DamWaterMonitor.tsx): `src/components/DamWaterMonitor.tsx`
- [Market Price Board](https://github.com/mugilarasu041-dotcom/ai-uzhavan/blob/main/src/components/MarketPriceBoard.tsx): `src/components/MarketPriceBoard.tsx`
- [Schemes Portal](https://github.com/mugilarasu041-dotcom/ai-uzhavan/blob/main/src/components/TnAgriSchemesPortal.tsx): `src/components/TnAgriSchemesPortal.tsx`

### API & Domain Data

- [API Server](https://github.com/mugilarasu041-dotcom/ai-uzhavan/blob/main/server.ts): `server.ts`
- [Weather Types](https://github.com/mugilarasu041-dotcom/ai-uzhavan/blob/main/src/types/weather.ts): `src/types/weather.ts`
- [District & Soil Data](https://github.com/mugilarasu041-dotcom/ai-uzhavan/blob/main/src/data/districts.ts): `src/data/districts.ts`
- [Alert Data](https://github.com/mugilarasu041-dotcom/ai-uzhavan/blob/main/src/data/alerts.ts): `src/data/alerts.ts`
- [Disease & Remedy Data](https://github.com/mugilarasu041-dotcom/ai-uzhavan/blob/main/src/data/cropDiseases.ts): `src/data/cropDiseases.ts`
- [Dam Records](https://github.com/mugilarasu041-dotcom/ai-uzhavan/blob/main/src/data/damData.ts): `src/data/damData.ts`
- [Market Prices](https://github.com/mugilarasu041-dotcom/ai-uzhavan/blob/main/src/data/marketPrices.ts): `src/data/marketPrices.ts`
- [Agriculture Schemes](https://github.com/mugilarasu041-dotcom/ai-uzhavan/blob/main/src/data/agriSchemes.ts): `src/data/agriSchemes.ts`

### Other components

- **Farmer**

## Connections

- Farmer → Dashboard App: uses
- Dashboard App → Weather Card: renders (evidence: `src/App.tsx`)
- Dashboard App → Forecast Strip: renders (evidence: `src/App.tsx`)
- Dashboard App → District Map: renders (evidence: `src/App.tsx`)
- Dashboard App → Weather Alerts: renders (evidence: `src/App.tsx`)
- Dashboard App → Weather Analytics: renders (evidence: `src/App.tsx`)
- Dashboard App → Agri Weather Bulletin: renders (evidence: `src/App.tsx`)
- Dashboard App → AI Weather Assistant: renders (evidence: `src/App.tsx`)
- Dashboard App → Crop Disease Scanner: renders (evidence: `src/App.tsx`)
- Dashboard App → Dam Water Monitor: renders (evidence: `src/App.tsx`)
- Dashboard App → Market Price Board: renders (evidence: `src/App.tsx`)
- Dashboard App → Schemes Portal: renders (evidence: `src/App.tsx`)
- Dashboard App → Weather Service: gets weather (evidence: `src/App.tsx`)
- Weather Service → API Server: requests weather (evidence: `src/services/weatherService.ts`)
- API Server → Weather Service: fetches weather (evidence: `server.ts`)
- API Server → District & Soil Data: reads (evidence: `server.ts`)
- API Server → Dam Records: reads (evidence: `server.ts`)
- API Server → Market Prices: reads (evidence: `server.ts`)
- API Server → Agriculture Schemes: serves schemes (evidence: `server.ts`)
- API Server → Disease & Remedy Data: uses (evidence: `server.ts`)
- Weather Service → Weather Types: uses types (evidence: `src/services/weatherService.ts`)
- Weather Card → Weather Types: uses types (evidence: `src/components/WeatherCard.tsx`)
- Forecast Strip → Weather Types: uses types (evidence: `src/components/ForecastStrip.tsx`)
- District Map → District & Soil Data: filters districts (evidence: `src/components/TamilNaduMap.tsx`)
- District Map → Weather Types: uses types (evidence: `src/components/TamilNaduMap.tsx`)
- Weather Alerts → Alert Data: uses alerts (evidence: `src/components/AlertsSection.tsx`)
- Weather Alerts → Weather Types: uses types (evidence: `src/components/AlertsSection.tsx`)
- Agri Weather Bulletin → District & Soil Data: uses soil data (evidence: `src/components/AgriWeatherBulletin.tsx`)
- Agri Weather Bulletin → Weather Types: uses types (evidence: `src/components/AgriWeatherBulletin.tsx`)
- AI Weather Assistant → District & Soil Data: uses district data (evidence: `src/components/AiWeatherAssistant.tsx`)
- AI Weather Assistant → Weather Types: uses types (evidence: `src/components/AiWeatherAssistant.tsx`)
- Crop Disease Scanner → Disease & Remedy Data: uses remedies (evidence: `src/components/CropDiseaseScanner.tsx`)
- Dam Water Monitor → Dam Records: uses records (evidence: `src/components/DamWaterMonitor.tsx`)
- Market Price Board → Market Prices: uses prices (evidence: `src/components/MarketPriceBoard.tsx`)
- Schemes Portal → Agriculture Schemes: uses schemes (evidence: `src/components/TnAgriSchemesPortal.tsx`)
- Weather Analytics → Weather Types: uses types (evidence: `src/components/YearlyRealTimeAnalytics.tsx`)
