How sayyamjain2520-jpg/mandi-setu works
This is a role-based mandi procurement application, not the Vite template described by its README. Farmers discover centres, request slots, track tokens and view payment information; operators handle gate calls, inspection and procurement; administrators manage centres, commodities and operators. App.tsx routes authenticated users to these role workspaces, while services/api.ts provides application data operations backed by Supabase or local demo storage. The workflow edges shown are supported by excerpts or the SOURCE INDEX; unsampled page behavior and database schema are not inferred.
Main entry points: api.ts Procurement API · App.tsx Role routing · FarmerApp.tsx Farmer workspace · OperatorDashboard.tsx Operator dashboard
Components 27
Access and shared services
- Role routing
src/App.tsx - Sign in
src/modules/auth/Login.tsx - Authentication
src/context/AuthContext.tsx - Procurement API
src/services/api.ts - Supabase client
src/config/supabase.ts - Demo local store
src/services/mock/localStore.ts - Notifications
src/context/NotificationContext.tsx - Language support
src/context/LanguageContext.tsx - Shared UI controls
src/components/ui
Farmer procurement
- Farmer workspace
src/modules/farmer/FarmerApp.tsx - Centre discovery
src/modules/farmer/pages/CentreDiscovery.tsx - Slot booking
src/modules/farmer/pages/SlotBookingWizard.tsx - Token tracking
src/modules/farmer/pages/MyTokensView.tsx - Payments view
src/modules/farmer/pages/FarmerPayments.tsx - Token QR pass
src/components/qr/TokenQRPass.tsx - Mandi route map
src/components/maps/MandiRouteMap.tsx
Mandi operations
- Operator dashboard
src/modules/operator/OperatorDashboard.tsx - Gate scanning
src/components/qr/GateScanner.tsx - Gate verification
src/modules/operator/components/GateVerificationModal.tsx - Quality inspection
src/modules/operator/components/QCInspectionModal.tsx - Procurement entry
src/modules/operator/components/ProcurementEntryModal.tsx
Administration
- Admin dashboard
src/modules/admin/AdminDashboard.tsx - Centre management
src/modules/admin/components/CentreManagementTab.tsx - Commodity management
src/modules/admin/components/CommodityManagerTab.tsx - Operator management
src/modules/admin/components/OperatorManagementTab.tsx - Bookings ledger
src/modules/admin/components/AllBookingsLedgerTab.tsx
Other components
- Farmers and staff
Connections 32
- Farmers and staff → Role routing: opens app
src/App.tsx - Role routing → Sign in: routes to
src/App.tsx - Role routing → Farmer workspace: routes by role
src/App.tsx - Role routing → Operator dashboard: routes by role
src/App.tsx - Role routing → Admin dashboard: routes by role
src/App.tsx - Sign in → Authentication: authenticates with
src/modules/auth/Login.tsx - Authentication → Supabase client: checks configuration
src/context/AuthContext.tsx - Farmer workspace → Centre discovery: renders
src/modules/farmer/FarmerApp.tsx - Farmer workspace → Slot booking: renders
src/modules/farmer/FarmerApp.tsx - Farmer workspace → Token tracking: renders
src/modules/farmer/FarmerApp.tsx - Farmer workspace → Payments view: renders
src/modules/farmer/FarmerApp.tsx - Farmer workspace → Procurement API: requests data
src/modules/farmer/FarmerApp.tsx - Token tracking → Procurement API: requests data
src/modules/farmer/pages/MyTokensView.tsx - Token tracking → Token QR pass: renders
src/modules/farmer/pages/MyTokensView.tsx - Token tracking → Mandi route map: renders
src/modules/farmer/pages/MyTokensView.tsx - Operator dashboard → Procurement API: requests data
src/modules/operator/OperatorDashboard.tsx - Operator dashboard → Gate scanning: uses scanner
src/modules/operator/OperatorDashboard.tsx - Operator dashboard → Gate verification: renders
src/modules/operator/OperatorDashboard.tsx - Operator dashboard → Quality inspection: renders
src/modules/operator/OperatorDashboard.tsx - Operator dashboard → Procurement entry: renders
src/modules/operator/OperatorDashboard.tsx - Procurement entry → Procurement API: saves entry
src/modules/operator/components/ProcurementEntryModal.tsx - Admin dashboard → Procurement API: requests data
src/modules/admin/AdminDashboard.tsx - Admin dashboard → Centre management: renders
src/modules/admin/AdminDashboard.tsx - Admin dashboard → Commodity management: renders
src/modules/admin/AdminDashboard.tsx - Admin dashboard → Operator management: renders
src/modules/admin/AdminDashboard.tsx - Admin dashboard → Bookings ledger: renders
src/modules/admin/AdminDashboard.tsx - Commodity management → Shared UI controls: uses controls
src/modules/admin/components/CommodityManagerTab.tsx - Procurement API → Supabase client: queries cloud data
src/services/api.ts - Procurement API → Demo local store: uses demo storage
src/services/api.ts - Notifications → Procurement API: loads and updates
src/context/NotificationContext.tsx - Notifications → Authentication: reads user
src/context/NotificationContext.tsx - Role routing → Notifications: provides notifications
src/App.tsx