# bhaveshsuryavanshi21/pashumitra architecture

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

- Interactive diagram: https://gitdiagram.com/bhaveshsuryavanshi21/pashumitra
- Repository: https://github.com/bhaveshsuryavanshi21/pashumitra

## Overview

PashuMitra is a livestock health and veterinary case-management application. Farmers submit animal health reports; the backend assesses risk and persists cases, while farmer and veterinary views support monitoring, treatment, vaccination, and outbreak response. The sampled frontend shows report-list and weather requests, and backend excerpts show report, update, and weather endpoints. Some page-to-backend actions and unsampled subsystem wiring cannot be confirmed from the excerpts, so those links are omitted or kept at the documented API level.

Main entry points: [`frontend/src/App.jsx`](https://github.com/bhaveshsuryavanshi21/pashumitra/blob/main/frontend/src/App.jsx) (App navigation), [`backend/main.py`](https://github.com/bhaveshsuryavanshi21/pashumitra/blob/main/backend/main.py) (Report API), [`frontend/src/pages/HealthRecords.jsx`](https://github.com/bhaveshsuryavanshi21/pashumitra/blob/main/frontend/src/pages/HealthRecords.jsx) (Health records), [`frontend/src/pages/OutbreakMap.jsx`](https://github.com/bhaveshsuryavanshi21/pashumitra/blob/main/frontend/src/pages/OutbreakMap.jsx) (Outbreak map)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Web experience"]
  node_app["App navigation<br/>[App.jsx]"]
  node_login["Login<br/>[Login.jsx]"]
  node_report["Report animal<br/>[ReportAnimal.jsx]"]
  node_farmerdash["Farmer dashboard"]
  node_vetdash["Veterinary dashboard<br/>[VetDashboard.jsx]"]
  node_records["Health records<br/>[HealthRecords.jsx]"]
  node_alerts["Alerts<br/>[Alerts.jsx]"]
  node_map["Outbreak map<br/>[OutbreakMap.jsx]"]
end

subgraph group_casework["Case management"]
  node_database[("PostgreSQL reports")]
end

subgraph group_services["Backend services"]
  node_reportapi["Report API<br/>[main.py]"]
  node_risk["Risk calculation<br/>[main.py]"]
  node_caseupdates["Case updates API<br/>[main.py]"]
  node_weatherapi["Weather API<br/>[main.py]"]
end

subgraph group_integrations["External services"]
  node_supabaseclient["Supabase client<br/>[supabaseClient.js]"]
  node_supabaseauth["Supabase authentication"]
  node_openweather["OpenWeather"]
end

node_farmer(("Farmer"))
node_vet(("Veterinarian"))

node_farmer -->|"uses"| node_app
node_vet -->|"uses"| node_app
node_app -->|"renders"| node_login
node_app -->|"renders"| node_report
node_app -->|"renders"| node_farmerdash
node_app -->|"renders"| node_vetdash
node_app -->|"renders"| node_records
node_app -->|"renders"| node_alerts
node_app -->|"renders"| node_map
node_app -->|"auth calls"| node_supabaseclient
node_supabaseclient -->|"creates client"| node_supabaseauth
node_farmerdash -->|"fetches reports"| node_reportapi
node_records -->|"fetches reports"| node_reportapi
node_records -->|"updates vaccination"| node_caseupdates
node_alerts -->|"fetches reports"| node_reportapi
node_map -->|"fetches reports"| node_reportapi
node_map -->|"fetches weather"| node_weatherapi
node_reportapi -->|"calculates risk"| node_risk
node_reportapi -->|"reads and writes"| node_database
node_caseupdates -->|"updates cases"| node_database
node_weatherapi -->|"requests conditions"| node_openweather

click node_app "https://github.com/bhaveshsuryavanshi21/pashumitra/blob/main/frontend/src/App.jsx"
click node_login "https://github.com/bhaveshsuryavanshi21/pashumitra/blob/main/frontend/src/pages/Login.jsx"
click node_report "https://github.com/bhaveshsuryavanshi21/pashumitra/blob/main/frontend/src/pages/ReportAnimal.jsx"
click node_farmerdash "https://github.com/bhaveshsuryavanshi21/pashumitra/blob/main/frontend/src/pages/FarmerDashboard.jsx"
click node_vetdash "https://github.com/bhaveshsuryavanshi21/pashumitra/blob/main/frontend/src/pages/VetDashboard.jsx"
click node_records "https://github.com/bhaveshsuryavanshi21/pashumitra/blob/main/frontend/src/pages/HealthRecords.jsx"
click node_alerts "https://github.com/bhaveshsuryavanshi21/pashumitra/blob/main/frontend/src/pages/Alerts.jsx"
click node_map "https://github.com/bhaveshsuryavanshi21/pashumitra/blob/main/frontend/src/pages/OutbreakMap.jsx"
click node_supabaseclient "https://github.com/bhaveshsuryavanshi21/pashumitra/blob/main/frontend/src/supabaseClient.js"
click node_reportapi "https://github.com/bhaveshsuryavanshi21/pashumitra/blob/main/backend/main.py"
click node_risk "https://github.com/bhaveshsuryavanshi21/pashumitra/blob/main/backend/main.py"
click node_caseupdates "https://github.com/bhaveshsuryavanshi21/pashumitra/blob/main/backend/main.py"
click node_weatherapi "https://github.com/bhaveshsuryavanshi21/pashumitra/blob/main/backend/main.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_app,node_login,node_report,node_farmerdash,node_vetdash,node_records,node_alerts,node_map toneBlue
class node_database toneAmber
class node_reportapi,node_risk,node_caseupdates,node_weatherapi toneMint
class node_supabaseclient,node_supabaseauth,node_openweather toneRose
class node_farmer,node_vet toneIndigo
```

## Components

### Web experience

- [App navigation](https://github.com/bhaveshsuryavanshi21/pashumitra/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Login](https://github.com/bhaveshsuryavanshi21/pashumitra/blob/main/frontend/src/pages/Login.jsx): `frontend/src/pages/Login.jsx`
- [Report animal](https://github.com/bhaveshsuryavanshi21/pashumitra/blob/main/frontend/src/pages/ReportAnimal.jsx): `frontend/src/pages/ReportAnimal.jsx`
- [Farmer dashboard](https://github.com/bhaveshsuryavanshi21/pashumitra/blob/main/frontend/src/pages/FarmerDashboard.jsx): `frontend/src/pages/FarmerDashboard.jsx`
- [Veterinary dashboard](https://github.com/bhaveshsuryavanshi21/pashumitra/blob/main/frontend/src/pages/VetDashboard.jsx): `frontend/src/pages/VetDashboard.jsx`
- [Health records](https://github.com/bhaveshsuryavanshi21/pashumitra/blob/main/frontend/src/pages/HealthRecords.jsx): `frontend/src/pages/HealthRecords.jsx`
- [Alerts](https://github.com/bhaveshsuryavanshi21/pashumitra/blob/main/frontend/src/pages/Alerts.jsx): `frontend/src/pages/Alerts.jsx`
- [Outbreak map](https://github.com/bhaveshsuryavanshi21/pashumitra/blob/main/frontend/src/pages/OutbreakMap.jsx): `frontend/src/pages/OutbreakMap.jsx`

### Case management

- **PostgreSQL reports**

### Backend services

- [Report API](https://github.com/bhaveshsuryavanshi21/pashumitra/blob/main/backend/main.py): `backend/main.py`
- [Risk calculation](https://github.com/bhaveshsuryavanshi21/pashumitra/blob/main/backend/main.py): `backend/main.py`
- [Case updates API](https://github.com/bhaveshsuryavanshi21/pashumitra/blob/main/backend/main.py): `backend/main.py`
- [Weather API](https://github.com/bhaveshsuryavanshi21/pashumitra/blob/main/backend/main.py): `backend/main.py`

### External services

- [Supabase client](https://github.com/bhaveshsuryavanshi21/pashumitra/blob/main/frontend/src/supabaseClient.js): `frontend/src/supabaseClient.js`
- **Supabase authentication**
- **OpenWeather**

### Other components

- **Farmer**
- **Veterinarian**

## Connections

- Farmer → App navigation: uses
- Veterinarian → App navigation: uses
- App navigation → Login: renders
- App navigation → Report animal: renders
- App navigation → Farmer dashboard: renders
- App navigation → Veterinary dashboard: renders
- App navigation → Health records: renders
- App navigation → Alerts: renders
- App navigation → Outbreak map: renders
- App navigation → Supabase client: auth calls
- Supabase client → Supabase authentication: creates client
- Farmer dashboard → Report API: fetches reports
- Health records → Report API: fetches reports
- Health records → Case updates API: updates vaccination
- Alerts → Report API: fetches reports
- Outbreak map → Report API: fetches reports
- Outbreak map → Weather API: fetches weather
- Report API → Risk calculation: calculates risk
- Report API → PostgreSQL reports: reads and writes
- Case updates API → PostgreSQL reports: updates cases
- Weather API → OpenWeather: requests conditions
