# baymaxrehaan/jal-sanchay-frontend architecture

> Architecture diagram of the GitHub repository baymaxrehaan/jal-sanchay-frontend, 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/baymaxrehaan/jal-sanchay-frontend
- Repository: https://github.com/baymaxrehaan/jal-sanchay-frontend

## Overview

Jal Sanchay is a web-based geospatial intelligence platform for water conservation and agriculture. Users enter through public pages, register or log in, then access a protected dashboard whose map and time-series views support satellite-index exploration and comparison; chart views add interpolation, derivatives and an AI chat panel. Authentication is managed in a shared context and backed by API calls. The tree contains both root-level and src/dashboard implementations; their documented composition is shown separately. Dashboard map internals are not excerpted, so their data-source relationships are not asserted.

Main entry points: [`src/App.jsx`](https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/src/App.jsx) (App router), [`src/pages/HomePage.jsx`](https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/src/pages/HomePage.jsx) (Home page), [`src/context/AuthContext.jsx`](https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/src/context/AuthContext.jsx) (Auth context), [`src/components/ProtectedRoute.jsx`](https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/src/components/ProtectedRoute.jsx) (Protected routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application and access"]
  node_app["App router<br/>[App.jsx]"]
  node_guard["Protected routes<br/>[ProtectedRoute.jsx]"]
  node_dashboardpage["Dashboard page<br/>[Dashboard.jsx]"]
end

subgraph group_public["Public experience"]
  node_home["Home page<br/>[HomePage.jsx]"]
  node_publicpages["About and contact<br/>[AboutPage.jsx]"]
  node_landing["Landing content<br/>[Hero.jsx]"]
  node_featurecards["Feature cards<br/>[FeatureCards.jsx]"]
  node_navbar["Navigation bar<br/>[Navbar.jsx]"]
  node_footer["Footer<br/>[Footer.jsx]"]
end

subgraph group_analysis["Geospatial analysis"]
  node_analysisview["Dashboard analysis view"]
  node_map["Map selection<br/>[MapSection.jsx]"]
  node_panel["Analysis controls<br/>[TopPanel.jsx]"]
  node_chart["Chart and chat modal<br/>[ChartModal.jsx]"]
  node_timeseries["Series calculations<br/>[timeseriesUtils.js]"]
  node_componentview["Component analysis view"]
  node_componentmap["Component map<br/>[MapSection.jsx]"]
  node_componentpanel["Component controls<br/>[TopPanel.jsx]"]
  node_componentchart["Component chart modal<br/>[ChartModal.jsx]"]
  node_legacyview["Root analysis view"]
  node_legacymap["Root map<br/>[MapSection.jsx]"]
  node_legacypanel["Root controls<br/>[TopPanel.jsx]"]
  node_legacychart["Root chart modal<br/>[ChartModal.jsx]"]
end

subgraph group_identity["Identity and API"]
  node_authpages["Login and registration<br/>[Login.jsx]"]
  node_profile["Profile page<br/>[Profile.jsx]"]
  node_auth["Auth context<br/>[AuthContext.jsx]"]
  node_api["Backend API client<br/>[api.js]"]
end

node_visitor(("Visitor"))
node_backend(("Application backend"))
node_chatbackend(("Chat endpoint"))

node_visitor -->|"opens"| node_app
node_app -->|"provides auth"| node_auth
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_authpages
node_app -->|"routes to"| node_publicpages
node_app -->|"guards"| node_guard
node_guard -->|"checks session"| node_auth
node_guard -->|"renders"| node_dashboardpage
node_guard -->|"renders"| node_profile
node_home -->|"renders"| node_landing
node_home -->|"renders"| node_featurecards
node_home -->|"renders"| node_navbar
node_home -->|"renders"| node_footer
node_publicpages -->|"renders"| node_navbar
node_publicpages -->|"renders"| node_footer
node_authpages -->|"uses auth"| node_auth
node_profile -->|"uses auth"| node_auth
node_auth -->|"calls auth API"| node_api
node_api -->|"requests endpoints"| node_backend
node_dashboardpage -->|"renders"| node_analysisview
node_analysisview -->|"renders"| node_map
node_analysisview -->|"renders"| node_panel
node_analysisview -->|"renders"| node_chart
node_chart -->|"computes series"| node_timeseries
node_componentview -->|"renders"| node_componentmap
node_componentview -->|"renders"| node_componentpanel
node_componentview -->|"renders"| node_componentchart
node_componentchart -->|"computes series"| node_timeseries
node_legacyview -->|"renders"| node_legacymap
node_legacyview -->|"renders"| node_legacypanel
node_legacyview -->|"renders"| node_legacychart
node_legacychart -->|"computes series"| node_timeseries
node_chart -->|"posts questions"| node_chatbackend
node_componentchart -->|"posts questions"| node_chatbackend
node_legacychart -->|"posts questions"| node_chatbackend

click node_app "https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/src/App.jsx"
click node_guard "https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/src/components/ProtectedRoute.jsx"
click node_dashboardpage "https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/src/pages/Dashboard.jsx"
click node_home "https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/src/pages/HomePage.jsx"
click node_authpages "https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/src/pages/Login.jsx"
click node_profile "https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/src/pages/Profile.jsx"
click node_publicpages "https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/src/pages/AboutPage.jsx"
click node_landing "https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/src/components/Hero.jsx"
click node_featurecards "https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/src/components/FeatureCards.jsx"
click node_navbar "https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/src/components/Navbar.jsx"
click node_footer "https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/src/components/Footer.jsx"
click node_analysisview "https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/src/dashboard/MapWithTimeseries.jsx"
click node_map "https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/src/dashboard/MapSection.jsx"
click node_panel "https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/src/dashboard/TopPanel.jsx"
click node_chart "https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/src/dashboard/ChartModal.jsx"
click node_timeseries "https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/src/utils/timeseriesUtils.js"
click node_componentview "https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/src/components/MapWithTimeseries.jsx"
click node_componentmap "https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/src/components/MapSection.jsx"
click node_componentpanel "https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/src/components/TopPanel.jsx"
click node_componentchart "https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/src/components/ChartModal.jsx"
click node_legacyview "https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/dashboard/MapWithTimeseries.jsx"
click node_legacymap "https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/dashboard/MapSection.jsx"
click node_legacypanel "https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/dashboard/TopPanel.jsx"
click node_legacychart "https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/dashboard/ChartModal.jsx"
click node_auth "https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/src/context/AuthContext.jsx"
click node_api "https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/src/services/api.js"

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_guard,node_dashboardpage toneBlue
class node_home,node_publicpages,node_landing,node_featurecards,node_navbar,node_footer toneAmber
class node_analysisview,node_map,node_panel,node_chart,node_timeseries,node_componentview,node_componentmap,node_componentpanel,node_componentchart,node_legacyview,node_legacymap,node_legacypanel,node_legacychart toneMint
class node_authpages,node_profile,node_auth,node_api toneRose
class node_visitor,node_backend,node_chatbackend toneIndigo
```

## Components

### Application and access

- [App router](https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/src/App.jsx): `src/App.jsx`
- [Protected routes](https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/src/components/ProtectedRoute.jsx): `src/components/ProtectedRoute.jsx`
- [Dashboard page](https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/src/pages/Dashboard.jsx): `src/pages/Dashboard.jsx`

### Public experience

- [Home page](https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/src/pages/HomePage.jsx): `src/pages/HomePage.jsx`
- [About and contact](https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/src/pages/AboutPage.jsx): `src/pages/AboutPage.jsx`
- [Landing content](https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/src/components/Hero.jsx): `src/components/Hero.jsx`
- [Feature cards](https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/src/components/FeatureCards.jsx): `src/components/FeatureCards.jsx`
- [Navigation bar](https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/src/components/Navbar.jsx): `src/components/Navbar.jsx`
- [Footer](https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/src/components/Footer.jsx): `src/components/Footer.jsx`

### Geospatial analysis

- [Dashboard analysis view](https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/src/dashboard/MapWithTimeseries.jsx): `src/dashboard/MapWithTimeseries.jsx`
- [Map selection](https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/src/dashboard/MapSection.jsx): `src/dashboard/MapSection.jsx`
- [Analysis controls](https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/src/dashboard/TopPanel.jsx): `src/dashboard/TopPanel.jsx`
- [Chart and chat modal](https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/src/dashboard/ChartModal.jsx): `src/dashboard/ChartModal.jsx`
- [Series calculations](https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/src/utils/timeseriesUtils.js): `src/utils/timeseriesUtils.js`
- [Component analysis view](https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/src/components/MapWithTimeseries.jsx): `src/components/MapWithTimeseries.jsx`
- [Component map](https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/src/components/MapSection.jsx): `src/components/MapSection.jsx`
- [Component controls](https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/src/components/TopPanel.jsx): `src/components/TopPanel.jsx`
- [Component chart modal](https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/src/components/ChartModal.jsx): `src/components/ChartModal.jsx`
- [Root analysis view](https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/dashboard/MapWithTimeseries.jsx): `dashboard/MapWithTimeseries.jsx`
- [Root map](https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/dashboard/MapSection.jsx): `dashboard/MapSection.jsx`
- [Root controls](https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/dashboard/TopPanel.jsx): `dashboard/TopPanel.jsx`
- [Root chart modal](https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/dashboard/ChartModal.jsx): `dashboard/ChartModal.jsx`

### Identity and API

- [Login and registration](https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/src/pages/Login.jsx): `src/pages/Login.jsx`
- [Profile page](https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/src/pages/Profile.jsx): `src/pages/Profile.jsx`
- [Auth context](https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/src/context/AuthContext.jsx): `src/context/AuthContext.jsx`
- [Backend API client](https://github.com/baymaxrehaan/jal-sanchay-frontend/blob/main/src/services/api.js): `src/services/api.js`

### Other components

- **Visitor**
- **Application backend**
- **Chat endpoint**

## Connections

- Visitor → App router: opens (evidence: `src/App.jsx`)
- App router → Auth context: provides auth (evidence: `src/App.jsx`)
- App router → Home page: routes to (evidence: `src/App.jsx`)
- App router → Login and registration: routes to (evidence: `src/App.jsx`)
- App router → About and contact: routes to (evidence: `src/App.jsx`)
- App router → Protected routes: guards (evidence: `src/App.jsx`)
- Protected routes → Auth context: checks session (evidence: `src/components/ProtectedRoute.jsx`)
- Protected routes → Dashboard page: renders (evidence: `src/App.jsx`)
- Protected routes → Profile page: renders (evidence: `src/App.jsx`)
- Home page → Landing content: renders (evidence: `src/pages/HomePage.jsx`)
- Home page → Feature cards: renders (evidence: `src/pages/HomePage.jsx`)
- Home page → Navigation bar: renders (evidence: `src/pages/HomePage.jsx`)
- Home page → Footer: renders (evidence: `src/pages/HomePage.jsx`)
- About and contact → Navigation bar: renders (evidence: `src/pages/AboutPage.jsx`)
- About and contact → Footer: renders (evidence: `src/pages/AboutPage.jsx`)
- Login and registration → Auth context: uses auth (evidence: `src/pages/Login.jsx`)
- Profile page → Auth context: uses auth (evidence: `src/pages/Profile.jsx`)
- Auth context → Backend API client: calls auth API (evidence: `src/context/AuthContext.jsx`)
- Backend API client → Application backend: requests endpoints (evidence: `src/services/api.js`)
- Dashboard page → Dashboard analysis view: renders (evidence: `src/pages/Dashboard.jsx`)
- Dashboard analysis view → Map selection: renders (evidence: `src/dashboard/MapWithTimeseries.jsx`)
- Dashboard analysis view → Analysis controls: renders (evidence: `src/dashboard/MapWithTimeseries.jsx`)
- Dashboard analysis view → Chart and chat modal: renders (evidence: `src/dashboard/MapWithTimeseries.jsx`)
- Chart and chat modal → Series calculations: computes series (evidence: `src/dashboard/ChartModal.jsx`)
- Component analysis view → Component map: renders (evidence: `src/components/MapWithTimeseries.jsx`)
- Component analysis view → Component controls: renders (evidence: `src/components/MapWithTimeseries.jsx`)
- Component analysis view → Component chart modal: renders (evidence: `src/components/MapWithTimeseries.jsx`)
- Component chart modal → Series calculations: computes series (evidence: `src/components/ChartModal.jsx`)
- Root analysis view → Root map: renders (evidence: `dashboard/MapWithTimeseries.jsx`)
- Root analysis view → Root controls: renders (evidence: `dashboard/MapWithTimeseries.jsx`)
- Root analysis view → Root chart modal: renders (evidence: `dashboard/MapWithTimeseries.jsx`)
- Root chart modal → Series calculations: computes series (evidence: `dashboard/ChartModal.jsx`)
- Chart and chat modal → Chat endpoint: posts questions (evidence: `src/dashboard/ChartModal.jsx`)
- Component chart modal → Chat endpoint: posts questions (evidence: `src/components/ChartModal.jsx`)
- Root chart modal → Chat endpoint: posts questions (evidence: `dashboard/ChartModal.jsx`)
