How jeevansrinivasan/uzhavar-market works
Uzhavar Market is a farmer-to-customer marketplace with customer shopping and ordering, farmer product and order management, and admin oversight. The visible shopping flow runs from browsing the storefront to product details and cart preparation, then checkout and payment/order handling, with customer order history afterward. Separate branches cover account access, farmer operations, admin notifications, and push alerts. Evidence is limited to the supplied excerpts and SOURCE INDEX references; unsampled route behavior and some service wiring are not asserted.
Main entry points: checkout/page.js Checkout · ProductDetailsClient.js Product details · admin/page.js Admin console · supabase.js Supabase
Components 31
Marketplace shopping
- Browse storefront
app/page.js - Product details
app/products/[id]/ProductDetailsClient.js - Product presentation
app/components/ProductView.js - Cart
app/cart/page.js - Checkout
app/checkout/page.js - Create payment
app/api/razorpay/create-order/route.js - Verify payment
app/api/razorpay/verify-payment/route.js - Stock adjustment
app/api/orders/deduct-stock/route.js - Restore stock
app/api/orders/restore-stock/route.js - Customer orders
app/customer/orders/page.js
Farmer operations
- Product management
app/farmer/products/page.js - Add product
app/farmer/add-product/page.js - Farmer orders
app/farmer/orders/page.js - Farmer earnings
app/farmer/earnings/page.js - Farmer profile
app/farmer/profile/page.js
Admin oversight
- Admin console
app/admin/page.js - Product administration
app/admin/products/page.js - Category administration
app/admin/categories/page.js - Admin notifications
lib/adminNotifications.js
Shared platform services
- Pricing and delivery
lib/pricing.js - Sign in and register
app/login/page.js - Role and profile sync
lib/farmerAuth.js - Farmer notifications
lib/notifications.js - Browser push client
lib/pushClient.js - Notification manager
app/components/MobileNotificationManager.js - Push delivery endpoint
app/api/push/send/route.js - Push subscription endpoint
app/api/push/subscribe/route.js - Supabase
lib/supabase.js - Language context
app/context/LanguageContext.js
Other components
- Customer
- Farmer
Connections 41
- Customer → Browse storefront: browses
app/page.js - Browse storefront → Product details: opens product
app/page.js - Product details → Supabase: reads product data
app/products/[id]/ProductDetailsClient.js - Product details → Pricing and delivery: gets delivery price
app/products/[id]/ProductDetailsClient.js - Product details → Product presentation: renders
app/products/[id]/ProductDetailsClient.js - Product details → Cart: stores cart item
app/products/[id]/ProductDetailsClient.js - Browse storefront → Pricing and delivery: calculates display prices
app/page.js - Customer → Cart: reviews cart
- Cart → Checkout: proceeds to checkout
- Checkout → Supabase: reads marketplace data
app/checkout/page.js - Checkout → Pricing and delivery: uses pricing
app/checkout/page.js - Checkout → Create payment: requests payment
- Create payment → Pricing and delivery: calculates order price
app/api/razorpay/create-order/route.js - Customer → Verify payment: confirms payment
- Checkout → Stock adjustment: updates stock
- Checkout → Restore stock: restores stock
- Customer → Customer orders: views orders
- Farmer → Product management: manages products
- Farmer → Add product: creates listing
- Farmer → Farmer orders: handles orders
- Farmer → Farmer earnings: views earnings
- Farmer → Farmer profile: manages profile
- Sign in and register → Role and profile sync: resolves role
app/login/page.js - Role and profile sync → Supabase: syncs profile
lib/farmerAuth.js - Farmer profile → Role and profile sync: checks access
app/farmer/profile/page.js - Admin console → Supabase: reads marketplace data
app/admin/page.js - Admin console → Admin notifications: records admin alerts
app/admin/page.js - Admin console → Pricing and delivery: uses pricing
app/admin/page.js - Admin console → Product administration: manages products
- Admin console → Category administration: manages categories
- Notification manager → Role and profile sync: checks role
app/components/MobileNotificationManager.js - Notification manager → Farmer notifications: fetches alerts
app/components/MobileNotificationManager.js - Farmer notifications → Supabase: reads notifications
lib/notifications.js - Notification manager → Browser push client: subscribes and displays
app/components/MobileNotificationManager.js - Browser push client → Supabase: saves subscription
lib/pushClient.js - Browser push client → Push delivery endpoint: requests delivery
lib/pushClient.js - Browser push client → Push subscription endpoint: registers subscription
- Notification manager → Push delivery endpoint: may trigger alert
- Language context → Browse storefront: provides translations
app/page.js - Language context → Product details: provides translations
app/products/[id]/ProductDetailsClient.js - Language context → Checkout: provides translations
app/checkout/page.js