How rakshitkashyap1/farmer-marketplace works
HERM Agro is a frontend-only farmer marketplace prototype. Buyers browse and filter produce, add items to a persistent cart, and place mock orders; farmers manage produce and fulfil orders, while buyers and farmers also use role-specific dashboards. A separate expert directory supports consultation requests, and a keyword-based AI widget is a mock assistant. README documents a service layer over in-memory mock data; source excerpts confirm some service and persistence details, but do not establish every dashboard interaction.
Main entry points: productService.ts Product service · expertService.ts Expert service · farmer/page.tsx Farmer dashboard · marketplace/page.tsx Browse produce
Components 30
Marketplace
- Browse produce
src/app/marketplace/page.tsx - Product details
src/app/marketplace/[id]/page.tsx - Farmer storefront
src/app/farmers/[id]/page.tsx - Product cards
src/components/marketplace/ProductCard.tsx - Search bar
src/components/marketplace/SearchBar.tsx - Product service
src/services/productService.ts - Product seeds
src/data/products.ts
Commerce
- Cart state
src/context/CartContext.tsx - Cart
src/app/cart/page.tsx - Checkout
src/app/checkout/page.tsx - Order service
src/services/orderService.ts
Role dashboards
- Buyer dashboard
src/app/dashboard/buyer/page.tsx - Buyer orders
src/app/dashboard/buyer/orders/page.tsx - Farmer dashboard
src/app/dashboard/farmer/page.tsx - Produce editor
src/components/dashboard/ProduceForm.tsx - Order fulfilment
src/app/dashboard/farmer/orders/page.tsx - Earnings
src/app/dashboard/farmer/earnings/page.tsx
Expert consultations
- Expert directory
src/app/experts/page.tsx - Expert profile
src/app/experts/[id]/page.tsx - Booking modal
src/components/experts/ConsultationModal.tsx - Expert service
src/services/expertService.ts - Expert seeds
src/data/experts.ts
Shared platform
- HERM AI widget
src/components/ai/HERMChat.tsx - Login and register
src/app/login/page.tsx - Session state
src/context/AuthContext.tsx - Auth service
src/services/authService.ts - In-memory database
src/services/db.ts - Notifications
src/context/ToastContext.tsx
Other components
- Buyer
- Farmer
Connections 33
- Buyer → Browse produce: browses
README.md - Search bar → Browse produce: navigates to
src/components/marketplace/SearchBar.tsx - Browse produce → Product service: queries listings
README.md - Browse produce → Product cards: renders
src/app/marketplace/page.tsx - Product details → Product service: loads product
src/app/marketplace/[id]/page.tsx - Farmer storefront → Product service: loads farmer data
- Product service → Product seeds: seeds listings
src/services/productService.ts - Product service → In-memory database: reads and mutates
src/services/productService.ts - Product details → Cart state: adds items
src/app/marketplace/[id]/page.tsx - Cart state → Cart: supplies items
src/app/cart/page.tsx - Cart state → Checkout: supplies items
src/app/checkout/page.tsx - Checkout → Order service: places order
README.md - Order service → In-memory database: reads and writes
src/services/orderService.ts - Buyer → Checkout: submits purchase
README.md - Buyer → Buyer dashboard: manages account
README.md - Buyer dashboard → Buyer orders: tracks orders
README.md - Farmer → Farmer dashboard: manages sales
README.md - Farmer dashboard → Produce editor: edits produce
README.md - Produce editor → Product service: saves produce
src/components/dashboard/ProduceForm.tsx - Farmer dashboard → Order fulfilment: fulfils orders
README.md - Farmer dashboard → Earnings: reviews payouts
README.md - Buyer → Expert directory: finds experts
README.md - Expert directory → Expert service: searches experts
src/app/experts/page.tsx - Expert profile → Expert service: loads profile
src/app/experts/[id]/page.tsx - Expert profile → Booking modal: opens booking
src/app/experts/[id]/page.tsx - Booking modal → Expert service: requests consultation
src/components/experts/ConsultationModal.tsx - Expert service → Expert seeds: seeds directory
src/services/expertService.ts - Expert service → In-memory database: reads and writes
src/services/expertService.ts - Buyer → HERM AI widget: asks questions
- Login and register → Session state: submits credentials
- Session state → Auth service: authenticates
src/context/AuthContext.tsx - Auth service → In-memory database: uses delay helper
src/services/authService.ts - Checkout → Notifications: shows feedback
src/app/checkout/page.tsx