# prathamtagad/framer---sih---the-iterators architecture

> Architecture diagram of the GitHub repository prathamtagad/framer---sih---the-iterators, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/prathamtagad/framer---sih---the-iterators
- Repository: https://github.com/prathamtagad/framer---sih---the-iterators

## Overview

#### Purpose and Entry Points
This is a Vite-served React single-page agricultural services application. It presents farmer/dealer workflows for dashboards, weather, markets, crop advice, disease detection, harvest prediction, seed recommendations, equipment, and dealer discovery. Browser bootstrap and application composition begin at `src/main.jsx` and `src/App.jsx`; static install metadata is in `public/manifest.json`.

#### Application Shell and Navigation
`src/App.jsx` is the top-level control boundary, assembling page-level experiences and shared application styling from `src/App.css`. Responsive navigation is implemented through `src/components/layout/TopBar.jsx`, `src/components/layout/Sidebar.jsx`, and `src/components/layout/BottomNav.jsx`, allowing the same feature areas to be reached in desktop and mobile-oriented layouts.

#### Identity and User Segmentation
Authentication state is centralized in `src/context/AuthContext.jsx`, with login and OAuth/callback-facing screens in `src/pages/Auth/Login.jsx` and `src/pages/Auth/AuthCallback.jsx`. The Supabase client boundary is `src/lib/supabase.js`. Authenticated identity likely controls the dashboard split between farmer and dealer views: `src/pages/Dashboard/FarmerDashboard.jsx` and `src/pages/Dashboard/DealerDashboard.jsx`, while `src/pages/Profile/Profile.jsx` handles user-facing profile state.

#### Agricultural Decision Workflows
Core decision-support pages are organized as independently rendered feature modules:
- Advisory interaction: `src/pages/Advisor/Advisor.jsx`, backed by `src/lib/advisorAI.js`.
- Crop disease lookup/detection: `src/pages/DiseaseDetection/DiseaseDetection.jsx`, informed by `src/data/diseaseDatabase.js`.
- Harvest estimation: `src/pages/HarvestPrediction/HarvestPrediction.jsx`, using `src/lib/harvestEngine.js`.
- Seed selection: `src/pages/SeedRecommendation/SeedRecommendation.jsx`, using `src/data/seedDatabase.js`.

These pages form a UI-to-domain-logic boundary: React collects/display inputs and results, while `src/lib` and `src/data` hold the service integration and deterministic/reference-data concerns.

#### Location, Weather, and Market Flow
Location selection is a reusable subsystem in `src/components/LocationAutocomplete.jsx` and `src/components/LocationPicker.jsx`, with Indian location reference data in `src/data/indianLocations.js`. Location-aware features consume external-service adapters rather than embedding request logic in pages: weather uses `src/pages/Weather/Weather.jsx` with `src/lib/weatherAPI.js`; market pricing uses `src/pages/Market/Market.jsx` with `src/lib/mandiAPI.js` and fallback/reference data in `src/data/mandiData.js`.

#### Commerce and Directory Features
Dealer discovery is represented by `src/pages/Dealers/Dealers.jsx` and its API boundary `src/lib/directoryAPI.js`, with local mock data at `src/data/mockDealers.js`. Equipment browsing is isolated in `src/pages/Equipment/Equipment.jsx` with `src/data/mockEquipment.js`. This indicates a mix of live adapter-backed integrations and bundled mock/reference datasets.

#### Runtime and Presentation Infrastructure
The frontend runs as a JavaScript React application built and served by Vite (`vite.config.js`, `package.json`). Localization is initialized in `src/i18n.js` and ships English, Hindi, and Tamil resources under `src/locales/en.json`, `src/locales/hi.json`, and `src/locales/ta.json`. Shared rendering support includes `src/components/common/MarkdownRenderer.jsx`, useful for formatted advisory or AI-originated content.

Main entry points: [`src/App.jsx`](https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/App.jsx) (Application composition), [`src/context/AuthContext.jsx`](https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/context/AuthContext.jsx) (Auth state), [`src/pages/Advisor/Advisor.jsx`](https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/pages/Advisor/Advisor.jsx) (Crop advisor), [`src/pages/Weather/Weather.jsx`](https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/pages/Weather/Weather.jsx) (Weather)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shell["Application Shell"]
  node_main(("Browser bootstrap<br/>React entry<br/>[main.jsx]"))
  node_app["Application composition<br/>React root<br/>[App.jsx]"]
  node_navigation["Responsive navigation<br/>layout components<br/>[TopBar.jsx]"]
end

subgraph group_identity["Identity &amp; Segmentation"]
  node_auth["Auth state<br/>React context<br/>[AuthContext.jsx]"]
  node_auth_screens["Login &amp; callback<br/>auth pages<br/>[Login.jsx]"]
  node_supabase[("Supabase client<br/>backend adapter<br/>[supabase.js]")]
  node_dashboards["Farmer &amp; dealer dashboards<br/>role-based pages"]
  node_profile["Profile<br/>user page<br/>[Profile.jsx]"]
end

subgraph group_decision["Decision Workflows"]
  node_advisor["Crop advisor<br/>advisory page<br/>[Advisor.jsx]"]
  node_advisor_ai["Advisor AI adapter<br/>service adapter<br/>[advisorAI.js]"]
  node_disease["Disease detection<br/>feature page"]
  node_disease_data["Disease reference data<br/>bundled data<br/>[diseaseDatabase.js]"]
  node_harvest["Harvest prediction<br/>feature page"]
  node_harvest_engine["Harvest engine<br/>domain logic<br/>[harvestEngine.js]"]
  node_seeds["Seed recommendation<br/>feature page"]
  node_seed_data["Seed reference data<br/>bundled data<br/>[seedDatabase.js]"]
end

subgraph group_location["Location, Weather &amp; Markets"]
  node_location_picker["Location selection<br/>shared components"]
  node_weather["Weather<br/>feature page<br/>[Weather.jsx]"]
  node_weather_api["Weather API adapter<br/>external adapter<br/>[weatherAPI.js]"]
  node_market["Market prices<br/>feature page<br/>[Market.jsx]"]
  node_mandi_api["Mandi API adapter<br/>external adapter<br/>[mandiAPI.js]"]
end

subgraph group_commerce["Commerce &amp; Directory"]
  node_dealers["Dealer discovery<br/>feature page<br/>[Dealers.jsx]"]
  node_directory_api["Directory API adapter<br/>external adapter<br/>[directoryAPI.js]"]
  node_equipment["Equipment browsing<br/>feature page<br/>[Equipment.jsx]"]
end

subgraph group_platform["Platform &amp; Shared Services"]
  node_vite{{"Vite runtime<br/>build runtime<br/>[vite.config.js]"}}
  node_i18n["Localization<br/>i18n initialization<br/>[i18n.js]"]
  node_markdown["Markdown rendering<br/>shared component"]
end

node_vite -->|"serves"| node_main
node_main -->|"mounts"| node_app
node_app -->|"composes"| node_navigation
node_app -->|"uses identity"| node_auth
node_app -->|"routes to"| node_dashboards
node_app -->|"routes to"| node_advisor
node_app -->|"routes to"| node_disease
node_app -->|"routes to"| node_harvest
node_app -->|"routes to"| node_seeds
node_app -->|"routes to"| node_weather
node_app -->|"routes to"| node_market
node_app -->|"routes to"| node_dealers
node_app -->|"routes to"| node_equipment
node_app -->|"initializes"| node_i18n
node_auth_screens -->|"updates"| node_auth
node_auth -->|"authenticates via"| node_supabase
node_auth -->|"selects role view"| node_dashboards
node_dashboards -.->|"links user state"| node_profile
node_advisor -->|"requests advice"| node_advisor_ai
node_advisor -->|"renders formatted output"| node_markdown
node_disease -->|"queries"| node_disease_data
node_harvest -->|"calculates with"| node_harvest_engine
node_seeds -->|"queries"| node_seed_data
node_weather -->|"uses location"| node_location_picker
node_weather -->|"fetches forecast"| node_weather_api
node_market -->|"uses location"| node_location_picker
node_market -->|"fetches prices"| node_mandi_api
node_dealers -->|"searches directory"| node_directory_api

click node_vite "https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/vite.config.js"
click node_main "https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/main.jsx"
click node_app "https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/App.jsx"
click node_navigation "https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/components/layout/TopBar.jsx"
click node_auth "https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/context/AuthContext.jsx"
click node_auth_screens "https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/pages/Auth/Login.jsx"
click node_supabase "https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/lib/supabase.js"
click node_dashboards "https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/pages/Dashboard/FarmerDashboard.jsx"
click node_profile "https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/pages/Profile/Profile.jsx"
click node_advisor "https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/pages/Advisor/Advisor.jsx"
click node_advisor_ai "https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/lib/advisorAI.js"
click node_disease "https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/pages/DiseaseDetection/DiseaseDetection.jsx"
click node_disease_data "https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/data/diseaseDatabase.js"
click node_harvest "https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/pages/HarvestPrediction/HarvestPrediction.jsx"
click node_harvest_engine "https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/lib/harvestEngine.js"
click node_seeds "https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/pages/SeedRecommendation/SeedRecommendation.jsx"
click node_seed_data "https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/data/seedDatabase.js"
click node_location_picker "https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/components/LocationAutocomplete.jsx"
click node_weather "https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/pages/Weather/Weather.jsx"
click node_weather_api "https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/lib/weatherAPI.js"
click node_market "https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/pages/Market/Market.jsx"
click node_mandi_api "https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/lib/mandiAPI.js"
click node_dealers "https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/pages/Dealers/Dealers.jsx"
click node_directory_api "https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/lib/directoryAPI.js"
click node_equipment "https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/pages/Equipment/Equipment.jsx"
click node_i18n "https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/i18n.js"
click node_markdown "https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/components/common/MarkdownRenderer.jsx"

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_main,node_app,node_navigation toneBlue
class node_auth,node_auth_screens,node_supabase,node_dashboards,node_profile toneAmber
class node_advisor,node_advisor_ai,node_disease,node_disease_data,node_harvest,node_harvest_engine,node_seeds,node_seed_data toneMint
class node_location_picker,node_weather,node_weather_api,node_market,node_mandi_api toneRose
class node_dealers,node_directory_api,node_equipment toneIndigo
class node_vite,node_i18n,node_markdown toneTeal
```

## Components

### Application Shell

- [Browser bootstrap](https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/main.jsx): React entry · `src/main.jsx`
- [Application composition](https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/App.jsx): React root · Top-level page composition and styling boundary. · `src/App.jsx`
- [Responsive navigation](https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/components/layout/TopBar.jsx): layout components · Top bar, sidebar, and bottom navigation expose feature areas across form factors. · `src/components/layout/TopBar.jsx`

### Identity & Segmentation

- [Auth state](https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/context/AuthContext.jsx): React context · Centralizes authenticated identity. · `src/context/AuthContext.jsx`
- [Login & callback](https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/pages/Auth/Login.jsx): auth pages · `src/pages/Auth/Login.jsx`
- [Supabase client](https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/lib/supabase.js): backend adapter · `src/lib/supabase.js`
- [Farmer & dealer dashboards](https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/pages/Dashboard/FarmerDashboard.jsx): role-based pages · Dashboard experience is selected by user segment. · `src/pages/Dashboard/FarmerDashboard.jsx`
- [Profile](https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/pages/Profile/Profile.jsx): user page · `src/pages/Profile/Profile.jsx`

### Decision Workflows

- [Crop advisor](https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/pages/Advisor/Advisor.jsx): advisory page · `src/pages/Advisor/Advisor.jsx`
- [Advisor AI adapter](https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/lib/advisorAI.js): service adapter · `src/lib/advisorAI.js`
- [Disease detection](https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/pages/DiseaseDetection/DiseaseDetection.jsx): feature page · `src/pages/DiseaseDetection/DiseaseDetection.jsx`
- [Disease reference data](https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/data/diseaseDatabase.js): bundled data · `src/data/diseaseDatabase.js`
- [Harvest prediction](https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/pages/HarvestPrediction/HarvestPrediction.jsx): feature page · `src/pages/HarvestPrediction/HarvestPrediction.jsx`
- [Harvest engine](https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/lib/harvestEngine.js): domain logic · `src/lib/harvestEngine.js`
- [Seed recommendation](https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/pages/SeedRecommendation/SeedRecommendation.jsx): feature page · `src/pages/SeedRecommendation/SeedRecommendation.jsx`
- [Seed reference data](https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/data/seedDatabase.js): bundled data · `src/data/seedDatabase.js`

### Location, Weather & Markets

- [Location selection](https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/components/LocationAutocomplete.jsx): shared components · Autocomplete and picker reuse Indian location reference data. · `src/components/LocationAutocomplete.jsx`
- [Weather](https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/pages/Weather/Weather.jsx): feature page · `src/pages/Weather/Weather.jsx`
- [Weather API adapter](https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/lib/weatherAPI.js): external adapter · `src/lib/weatherAPI.js`
- [Market prices](https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/pages/Market/Market.jsx): feature page · `src/pages/Market/Market.jsx`
- [Mandi API adapter](https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/lib/mandiAPI.js): external adapter · Uses bundled market data as fallback/reference. · `src/lib/mandiAPI.js`

### Commerce & Directory

- [Dealer discovery](https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/pages/Dealers/Dealers.jsx): feature page · `src/pages/Dealers/Dealers.jsx`
- [Directory API adapter](https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/lib/directoryAPI.js): external adapter · `src/lib/directoryAPI.js`
- [Equipment browsing](https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/pages/Equipment/Equipment.jsx): feature page · Backed by bundled mock equipment data. · `src/pages/Equipment/Equipment.jsx`

### Platform & Shared Services

- [Vite runtime](https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/vite.config.js): build runtime · Builds and serves the React SPA. · `vite.config.js`
- [Localization](https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/i18n.js): i18n initialization · Loads English, Hindi, and Tamil resources. · `src/i18n.js`
- [Markdown rendering](https://github.com/prathamtagad/framer---sih---the-iterators/blob/main/src/components/common/MarkdownRenderer.jsx): shared component · Formats advisory or AI-originated content. · `src/components/common/MarkdownRenderer.jsx`

## Connections

- Vite runtime → Browser bootstrap: serves
- Browser bootstrap → Application composition: mounts
- Application composition → Responsive navigation: composes
- Application composition → Auth state: uses identity
- Application composition → Farmer & dealer dashboards: routes to
- Application composition → Crop advisor: routes to
- Application composition → Disease detection: routes to
- Application composition → Harvest prediction: routes to
- Application composition → Seed recommendation: routes to
- Application composition → Weather: routes to
- Application composition → Market prices: routes to
- Application composition → Dealer discovery: routes to
- Application composition → Equipment browsing: routes to
- Application composition → Localization: initializes
- Login & callback → Auth state: updates
- Auth state → Supabase client: authenticates via
- Auth state → Farmer & dealer dashboards: selects role view
- Farmer & dealer dashboards → Profile: links user state
- Crop advisor → Advisor AI adapter: requests advice
- Crop advisor → Markdown rendering: renders formatted output
- Disease detection → Disease reference data: queries
- Harvest prediction → Harvest engine: calculates with
- Seed recommendation → Seed reference data: queries
- Weather → Location selection: uses location
- Weather → Weather API adapter: fetches forecast
- Market prices → Location selection: uses location
- Market prices → Mandi API adapter: fetches prices
- Dealer discovery → Directory API adapter: searches directory
