How thouhidshaik-1920/crop-pro works
PAYIR is a browser-based crop monitoring and farm-management application, designed to work locally with optional Supabase integration. Users enter through the routed dashboard and manage fields, inspect telemetry and health, simulate sensor conditions, diagnose disease, control simulated irrigation, review alerts and reports, and configure settings. The shared context coordinates application state and persistence; domain engines handle health scoring, alerts, simulation, and irrigation. Source excerpts establish key orchestration links; some feature details and integrations are documented in the README but their full implementations were not sampled.
Main entry points: PayirContext.tsx Application state · App.tsx Routed application · DashboardPage.tsx Dashboard · DiseaseDetectionPage.tsx Disease detection
Components 25
Application shell
- Routed application
src/App.tsx - App layout
src/layouts/AppLayout.tsx - Shared interface
src/components/common
Farm monitoring
- Dashboard
src/pages/DashboardPage.tsx - Health scoring
src/services/healthEngine.ts - Field management
src/pages/FieldsPage.tsx - Interactive field map
src/pages/FieldMapPage.tsx - Alerts
src/pages/AlertsPage.tsx - Alert evaluation
src/services/alertEngine.ts
Farm operations
- Sensor simulator
src/pages/SimulatorPage.tsx - Reading generation
src/services/simulatorEngine.ts - Disease detection
src/pages/DiseaseDetectionPage.tsx - Disease classifier
src/services/diseaseClassifier.ts - Disease knowledge base
src/data/diseaseKnowledgeBase.ts - Irrigation management
src/pages/IrrigationPage.tsx - Irrigation simulation
src/services/irrigationEngine.ts - Reports and analytics
src/pages/ReportsPage.tsx - Report aggregation
src/services/reportService.ts
State and services
- Application state
src/context/PayirContext.tsx - Local persistence
src/services/storageService.ts - Supabase integration
src/services/supabaseService.ts - Settings and profile
src/pages/SettingsPage.tsx - Bilingual UI
src/hooks/useTranslation.ts - Translation catalog
src/data/translations.ts
Other components
- Farm user
Connections 39
- Farm user → Routed application: uses
- Routed application → Application state: provides state
src/App.tsx - Routed application → App layout: renders
src/App.tsx - Routed application → Dashboard: routes to
src/App.tsx - Routed application → Sensor simulator: routes to
src/App.tsx - Routed application → Disease detection: routes to
src/App.tsx - Routed application → Irrigation management: routes to
src/App.tsx - Routed application → Alerts: routes to
src/App.tsx - Routed application → Reports and analytics: routes to
src/App.tsx - Routed application → Field management: routes to
src/App.tsx - Routed application → Interactive field map: routes to
src/App.tsx - Routed application → Settings and profile: routes to
src/App.tsx - App layout → Shared interface: uses
src/layouts/AppLayout.tsx - Dashboard → Application state: reads state
src/pages/DashboardPage.tsx - Dashboard → Health scoring: uses scoring
src/pages/DashboardPage.tsx - Dashboard → Report aggregation: uses aggregation
src/pages/DashboardPage.tsx - Field management → Application state: updates fields
src/pages/FieldsPage.tsx - Interactive field map → Application state: uses field data
- Alerts → Application state: reads alerts
src/pages/AlertsPage.tsx - Application state → Alert evaluation: evaluates alerts
src/context/PayirContext.tsx - Alert evaluation → Health scoring: evaluates health
src/services/alertEngine.ts - Sensor simulator → Application state: controls simulation
src/pages/SimulatorPage.tsx - Application state → Reading generation: generates readings
src/context/PayirContext.tsx - Disease detection → Application state: records diagnosis
src/pages/DiseaseDetectionPage.tsx - Disease detection → Disease classifier: requests classification
src/pages/DiseaseDetectionPage.tsx - Disease detection → Disease knowledge base: uses profiles
src/pages/DiseaseDetectionPage.tsx - Irrigation management → Application state: controls irrigation
src/pages/IrrigationPage.tsx - Application state → Irrigation simulation: steps sessions
src/context/PayirContext.tsx - Reports and analytics → Application state: reads records
src/pages/ReportsPage.tsx - Reports and analytics → Report aggregation: aggregates readings
src/pages/ReportsPage.tsx - Settings and profile → Application state: updates settings
src/pages/SettingsPage.tsx - Settings and profile → Local persistence: manages backup
src/pages/SettingsPage.tsx - Application state → Local persistence: loads and saves
src/context/PayirContext.tsx - Application state → Supabase integration: checks configuration
src/context/PayirContext.tsx - Supabase integration → Farm user: optional sync
- Dashboard → Shared interface: renders components
src/pages/DashboardPage.tsx - Reports and analytics → Shared interface: renders badges
src/pages/ReportsPage.tsx - Bilingual UI → Application state: reads language
src/hooks/useTranslation.ts - Bilingual UI → Translation catalog: looks up strings
src/hooks/useTranslation.ts