How suchithrasaravanan05-afk/kisansense-ai works
KisanSense AI is a multilingual farm-advisory web app. A farmer enters through the app, manages field and crop records, and can request a crop-image assessment; the app also presents irrigation, fertilizer, weather, activity-history, and expert-review capabilities. The central page coordinates state and services, while browser storage supports offline records and queued synchronization. Vision analysis has a server API entry point and a provider-selection layer with validation and demo fallback. The README is empty, so capability scope comes from the source tree; unsampled view-to-service connections are not inferred.
Main entry points: page.tsx App coordinator · index.ts Vision dispatcher · imageAnalysisService.ts Image analysis · ScanView.tsx Crop scanning
Components 28
Application
- App coordinator
src/app/page.tsx - Settings
src/components/views/SettingsView.tsx
Farm workflows
- Crop scanning
src/components/views/ScanView.tsx - Scan results
src/components/views/ScanResultView.tsx - Farm dashboard
src/components/views/DashboardView.tsx - Water planning
src/components/views/WaterView.tsx - Fertilizer advice
src/components/views/FertilizerView.tsx - Field timeline
src/components/views/TimelineView.tsx - Expert review
src/components/views/ExpertView.tsx
Advisory services
- Image analysis
src/services/imageAnalysisService.ts - Scan API
src/app/api/scan/route.ts - Vision dispatcher
src/services/vision/index.ts - Demo provider
src/services/vision/providers/demoProvider.ts - Gemini provider
src/services/vision/providers/geminiProvider.ts - OpenAI provider
src/services/vision/providers/openaiProvider.ts - Response validator
src/services/vision/validator.ts - Irrigation services
src/services/irrigationService.ts - Irrigation calculator
src/services/irrigationCalculator.ts - Fertilizer service
src/services/fertilizerService.ts - Weather service
src/services/weatherService.ts - Weather API
src/app/api/weather/route.ts
Data and platform
- Farm data storage
src/services/storageService.ts - Domain types
src/types/index.ts - Translations
src/i18n/translations.ts - Demo farm data
src/data/mockData.ts - Sample scan images
src/data/sampleImages.ts - Offline worker
public/sw.js
Other components
- Farmer
Connections 30
- Farmer → App coordinator: uses
- App coordinator → Farm data storage: reads and updates
src/app/page.tsx - App coordinator → Weather service: fetches weather
src/app/page.tsx - App coordinator → Translations: translates labels
src/app/page.tsx - App coordinator → Farm dashboard: renders
src/app/page.tsx - App coordinator → Crop scanning: renders
src/app/page.tsx - App coordinator → Scan results: renders
src/app/page.tsx - App coordinator → Water planning: renders
src/app/page.tsx - App coordinator → Fertilizer advice: renders
src/app/page.tsx - App coordinator → Field timeline: renders
src/app/page.tsx - App coordinator → Expert review: renders
src/app/page.tsx - App coordinator → Settings: renders
src/app/page.tsx - Crop scanning → Image analysis: requests analysis
src/components/views/ScanView.tsx - Image analysis → Sample scan images: checks samples
src/services/imageAnalysisService.ts - Image analysis → Scan API: posts image
src/services/imageAnalysisService.ts - Scan API → Vision dispatcher: analyzes crop
src/app/api/scan/route.ts - Vision dispatcher → Demo provider: selects or falls back
src/services/vision/index.ts - Vision dispatcher → Gemini provider: dispatches
src/services/vision/index.ts - Vision dispatcher → OpenAI provider: dispatches
src/services/vision/index.ts - Demo provider → Response validator: validates output
src/services/vision/providers/demoProvider.ts - Gemini provider → Response validator: validates output
src/services/vision/providers/geminiProvider.ts - OpenAI provider → Response validator: validates output
src/services/vision/providers/openaiProvider.ts - Water planning → Irrigation calculator: calculates needs
src/components/views/WaterView.tsx - Irrigation services → Irrigation calculator: uses calculations
src/services/irrigationService.ts - App coordinator → Irrigation services: fetches recommendations
src/app/page.tsx - App coordinator → Fertilizer service: fetches advice
- Weather service → Farm data storage: caches weather
src/services/weatherService.ts - Farm data storage → Demo farm data: loads defaults
src/services/storageService.ts - Crop scanning → Image analysis: compresses images
src/components/views/ScanView.tsx - App coordinator → Offline worker: registers worker