How dipeshpadole786/asymptote_ps09 works
KisanPlan is a mobile farm-planning app: a farmer signs in, sets a farm location and crop, then views weather, soil, and sensor conditions to get irrigation, spraying, and weekly field guidance. The app also offers crop scanning, a field map, alerts, and demo sensor controls. The graph follows the documented app/context/planning relationships and sampled imports; backend and device wiring not demonstrated in the excerpts is left unconnected.
Main entry points: App.tsx App routing · DashboardScreen.tsx Dashboard · PlanContext.tsx Plan state · plannerLogic.ts Weekly plan
Components 34
Mobile app
- App routing
App.tsx - Dashboard
screens/DashboardScreen.tsx - Alerts screen
screens/AlertsScreen.tsx - Shared UI
components/ui.tsx - Bottom navigation
components/BottomNavigation.tsx
Farm setup
- Farm state
context/FarmContext.tsx - Session guard
hooks/useRequireSession.ts - Farm setup
screens/FarmSetupScreen.tsx - Sign in
screens/LoginScreen.tsx - Field map
screens/FieldMapScreen.tsx - Crop scan
screens/ScanCropScreen.tsx - Farm settings
screens/MoreScreen.tsx - Crop check card
components/CropCheckCard.tsx
Farm planning
- Planner screen
screens/PlannerScreen.tsx - Plan state
context/PlanContext.tsx - Seven-day planner
components/SevenDayPlanner.tsx - Weather card
components/WeatherCard.tsx - Soil moisture card
components/SoilMoistureCard.tsx - Alert card
components/AlertCard.tsx - Motor activity
components/MotorActivityCard.tsx
Data integrations
- Weather service
services/weatherService.ts - Soil service
services/soilService.ts - Sensor service
services/sensorService.ts - Crop prediction
services/predictService.ts - Location service
services/locationService.ts - Grok advisor
services/grokService.ts
Planning logic
- Weekly plan
logic/plannerLogic.ts - Irrigation rules
logic/irrigationLogic.ts - Spraying rules
logic/sprayingLogic.ts - Decision thresholds
logic/thresholds.ts
Other components
- Farmer
- Open-Meteo
- SoilGrids
- IoT sensor endpoint
Connections 48
- Farmer → App routing: uses
- App routing → Farm setup: routes to
App.tsx - App routing → Sign in: routes to
App.tsx - App routing → Field map: routes to
App.tsx - App routing → Dashboard: routes to
App.tsx - App routing → Planner screen: routes to
App.tsx - App routing → Alerts screen: routes to
App.tsx - App routing → Crop scan: routes to
App.tsx - App routing → Farm settings: routes to
App.tsx - App routing → Farm state: provides state
App.tsx - App routing → Plan state: provides state
App.tsx - Farm setup → Farm state: saves profile
screens/FarmSetupScreen.tsx - Sign in → Farm state: updates session
screens/LoginScreen.tsx - Field map → Location service: uses location
screens/FieldMapScreen.tsx - Farm setup → Location service: uses location
screens/FarmSetupScreen.tsx - Dashboard → Session guard: checks session
screens/DashboardScreen.tsx - Planner screen → Session guard: checks session
screens/PlannerScreen.tsx - Crop scan → Session guard: checks session
screens/ScanCropScreen.tsx - Field map → Session guard: checks session
screens/FieldMapScreen.tsx - Farm settings → Session guard: checks session
screens/MoreScreen.tsx - Crop scan → Crop prediction: requests prediction
screens/ScanCropScreen.tsx - Plan state → Farm state: reads farm state
context/PlanContext.tsx - Plan state → Weather service: loads forecast
context/PlanContext.tsx - Plan state → Soil service: loads soil data
context/PlanContext.tsx - Plan state → Sensor service: loads readings
context/PlanContext.tsx - Plan state → Weekly plan: builds plan
context/PlanContext.tsx - Plan state → Grok advisor: checks advisor
context/PlanContext.tsx - Weekly plan → Irrigation rules: decides irrigation
logic/plannerLogic.ts - Weekly plan → Spraying rules: decides spraying
logic/plannerLogic.ts - Irrigation rules → Decision thresholds: reads limits
logic/irrigationLogic.ts - Spraying rules → Decision thresholds: reads limits
logic/sprayingLogic.ts - Weather service → Open-Meteo: fetches forecast
services/weatherService.ts - Soil service → SoilGrids: fetches soil
services/soilService.ts - Sensor service → IoT sensor endpoint: fetches readings
services/sensorService.ts - Dashboard → Seven-day planner: renders
screens/DashboardScreen.tsx - Dashboard → Weather card: renders
screens/DashboardScreen.tsx - Dashboard → Soil moisture card: renders
screens/DashboardScreen.tsx - Dashboard → Alert card: renders
screens/DashboardScreen.tsx - Dashboard → Crop check card: renders
screens/DashboardScreen.tsx - Dashboard → Motor activity: renders
screens/DashboardScreen.tsx - Dashboard → Bottom navigation: renders
screens/DashboardScreen.tsx - Planner screen → Seven-day planner: renders
screens/PlannerScreen.tsx - Seven-day planner → Weekly plan: reads plan types
components/SevenDayPlanner.tsx - Weather card → Weather service: reads forecast
components/WeatherCard.tsx - Soil moisture card → Sensor service: reads sensor data
components/SoilMoistureCard.tsx - Soil moisture card → Soil service: reads soil data
components/SoilMoistureCard.tsx - Motor activity → Sensor service: reads motor data
components/MotorActivityCard.tsx - Alert card → Weekly plan: reads alert types
components/AlertCard.tsx