How harshshirke66/project-kisan works
Project Type & Purpose
• This is a frontend-heavy React/TypeScript SPA (built with Vite) that interfaces with:
• Supabase (Auth & PostgreSQL)
• AI engine (Gemini)
• External data APIs (OpenWeatherMap, IQAir, WAQI)
• Data-viz libs (Chart.js, Leaflet)
Main Components
• UI Layer (src/components)
• LandingPage, Dashboard, Alerts, CropDiagnosis, etc.
• MainApp wraps all feature-specific modules
• Service Layer (src/services + src/config)
• geminiService → AI chatbot/analytics
• Supabase client → auth & data storage
• Hooks & Utils
• useSpeechRecognition (voice control)
• textFormatter
• External Systems
• Supabase (Auth + Postgres)
• OpenWeatherMap, IQAir, WAQI
• Gemini AI
Relationships & Data Flows
• User → UI Layer: interactions (clicks, voice commands)
• UI → Service Layer: fetch/send requests
• Auth calls → Supabase Auth
• Data queries → Supabase DB
• AI prompts → Gemini API
• Weather/Market data → respective APIs
• Responses → UI: update charts, alerts, maps
Architectural Highlights
• Single-Page App with clear separation of concerns
• Service abstraction: all external calls live in src/services
• Composable components: each feature is a self-contained React component
• Hook-based extensions: re-usable behavior (speech recognition)