How suvrajitpatari2023/ecofarm works
Green & White is a farmer-facing agriculture monitoring and recommendation app. The documented workflow runs from account access and farm setup through monitoring and recommendations to dashboard and expert support. The sampled frontend routes these experiences and uses Supabase for authentication, data access, and chat invocation. README-described sensor ingestion and several AI/alert capabilities are not confirmed by the sampled source, so their links are shown as unverified rather than as implemented calls.
Main entry points: App.tsx Application routes · client.ts Supabase service · Auth.tsx Sign in / signup · Chatbot.tsx AI chatbot
Components 20
Farmer experience
- Application routes
src/App.tsx - Sign in / signup
src/pages/Auth.tsx - Navigation
src/components/Navigation.tsx - Farmer dashboard
src/pages/Dashboard.tsx - Expert portal
src/pages/Experts.tsx - Admin panel
src/pages/Admin.tsx - Help and tickets
src/pages/Help.tsx - AI chatbot
src/components/Chatbot.tsx
Farm operations
- Farm details
src/pages/FarmDetails.tsx - Field monitoring
src/pages/Monitoring.tsx - Recommendations
src/pages/Recommendations.tsx
Backend services
- Auth session
src/hooks/useAuth.tsx - Supabase service
src/integrations/supabase/client.ts - Chat function
supabase/functions/chat/index.ts - Weather function
supabase/functions/fetch-weather/index.ts - Recommendation function
supabase/functions/generate-recommendations/index.ts
Shared frontend
- UI components
src/components/ui - Class utilities
src/lib/utils.ts
Other components
- Farmer
- Farm sensors
Connections 30
- Farmer → Application routes: uses
src/App.tsx - Application routes → Sign in / signup: routes to
src/App.tsx - Application routes → Farm details: routes to
src/App.tsx - Application routes → Field monitoring: routes to
src/App.tsx - Application routes → Recommendations: routes to
src/App.tsx - Application routes → Farmer dashboard: routes to
src/App.tsx - Application routes → Expert portal: routes to
src/App.tsx - Application routes → Admin panel: routes to
src/App.tsx - Application routes → Help and tickets: routes to
src/App.tsx - Sign in / signup → Supabase service: authenticates with
src/pages/Auth.tsx - Sign in / signup → Auth session: checks session
src/pages/Auth.tsx - Auth session → Supabase service: reads auth state
src/hooks/useAuth.tsx - Navigation → Auth session: uses session
src/components/Navigation.tsx - Farm details → Supabase service: accesses farm data
src/pages/FarmDetails.tsx - Field monitoring → Supabase service: accesses monitoring data
src/pages/Monitoring.tsx - Recommendations → Supabase service: accesses data
src/pages/Recommendations.tsx - Farmer dashboard → Supabase service: accesses dashboard data
src/pages/Dashboard.tsx - Expert portal → Supabase service: accesses expert data
src/pages/Experts.tsx - Admin panel → Supabase service: accesses admin data
src/pages/Admin.tsx - Help and tickets → Supabase service: submits tickets
src/pages/Help.tsx - Help and tickets → AI chatbot: renders
src/pages/Help.tsx - AI chatbot → Supabase service: invokes function
src/components/Chatbot.tsx - AI chatbot → Chat function: sends chat request
src/components/Chatbot.tsx - Farmer → Farm sensors: provides farm context
README.md - Farm sensors → Field monitoring: supplies readings
- Field monitoring → Weather function: may fetch weather
- Recommendations → Recommendation function: may generate advice
- Sign in / signup → UI components: renders controls
src/pages/Auth.tsx - AI chatbot → UI components: renders controls
src/components/Chatbot.tsx - UI components → Class utilities: merges classes
src/components/ui/button.tsx