How qs-ashish05/farmers-app works
Kisan Haat is an India-focused agricultural marketplace. The documented farmer journey runs from registration and document submission through admin review, approval or rejection, and farmer login; the app also supports buyer access, product listings, marketplace orders, and India-specific location and bank lookups. The primary runtime is the Express backend and React frontend; the Spring Boot-era frontend and backup Java files appear to be a separate prototype, so they are not presented as part of the live flow. Some backend route relationships are based on the source index and README, not inspected route excerpts.
Main entry points: server.js Express API · App.jsx Web app routes · auth.js Login and signup · admin.js Review decisions
Components 28
Web experience
- Web app routes
frontend/src/App.jsx - Farmer registration
frontend/src/pages/FarmerRegister.jsx - Registration status
frontend/src/pages/RegistrationStatus.jsx - Admin desk
frontend/src/pages/AdminDesk.jsx - Farmer desk
frontend/src/pages/FarmerDesk.jsx - Buyer access
frontend/src/pages/BuyerAuth.jsx - Marketplace view
frontend/src/pages/Market.jsx - API and session
frontend/src/api.js
Registration and identity
- Express API
backend/src/server.js - Farmer registration
backend/src/routes/farmers.js - Login and signup
backend/src/routes/auth.js - Review decisions
backend/src/routes/admin.js - JWT authorization
backend/src/middleware/auth.js - India field validation
backend/src/validators/common.js - User records
backend/src/models/User.js - Captcha checks
backend/src/routes/captcha.js - Contact OTP
backend/src/routes/otp.js
Marketplace
- Marketplace endpoints
backend/src/routes/marketplace.js - Product records
backend/src/models/Product.js - Order records
backend/src/models/Order.js
India-specific services
- Location lookup
backend/src/routes/locations.js - IFSC lookup
backend/src/routes/ifsc.js - Registration sheet export
backend/src/config/googleSheets.js - Email delivery
backend/src/utils/email.js
Other components
- Farmer
- Buyer
- Admin
- India Post and Razorpay
Connections 40
- Farmer → Farmer registration: submits request
README.md - Farmer registration → API and session: sends form
frontend/src/pages/FarmerRegister.jsx - Registration status → API and session: checks status
frontend/src/pages/RegistrationStatus.jsx - Admin → Admin desk: reviews requests
README.md - Admin desk → API and session: requests decisions
frontend/src/pages/AdminDesk.jsx - Farmer → Farmer desk: uses desk
frontend/src/pages/FarmerDesk.jsx - Buyer → Buyer access: signs up
frontend/src/pages/BuyerAuth.jsx - Buyer → Marketplace view: browses produce
- Web app routes → Farmer registration: routes to
frontend/src/App.jsx - Web app routes → Registration status: routes to
frontend/src/App.jsx - Web app routes → Admin desk: routes to
frontend/src/App.jsx - Web app routes → Farmer desk: routes to
frontend/src/App.jsx - Web app routes → Buyer access: routes to
frontend/src/App.jsx - Web app routes → Marketplace view: routes to
frontend/src/App.jsx - API and session → Express API: calls API
README.md - Express API → Farmer registration: mounts routes
backend/src/server.js - Express API → Login and signup: mounts routes
backend/src/server.js - Express API → Review decisions: mounts routes
backend/src/server.js - Express API → Marketplace endpoints: mounts routes
backend/src/server.js - Express API → Location lookup: mounts routes
backend/src/server.js - Express API → IFSC lookup: mounts routes
backend/src/server.js - Express API → Captcha checks: mounts routes
backend/src/server.js - Express API → Contact OTP: mounts routes
backend/src/server.js - Farmer registration → User records: reads and writes
backend/src/routes/farmers.js - Farmer registration → Registration sheet export: appends registration
backend/src/routes/farmers.js - Farmer registration → India field validation: validates fields
backend/src/routes/farmers.js - Login and signup → User records: reads and writes
backend/src/routes/auth.js - Login and signup → Captcha checks: consumes captcha
backend/src/routes/auth.js - Login and signup → JWT authorization: uses token auth
backend/src/routes/auth.js - Login and signup → India field validation: validates fields
backend/src/routes/auth.js - Review decisions → User records: reviews users
backend/src/routes/admin.js - Review decisions → Product records: manages products
backend/src/routes/admin.js - Review decisions → Order records: handles orders
backend/src/routes/admin.js - Review decisions → JWT authorization: guards routes
backend/src/routes/admin.js - Marketplace endpoints → Product records: serves listings
- Marketplace endpoints → Order records: handles orders
- Location lookup → India Post and Razorpay: queries postcodes
README.md - IFSC lookup → India Post and Razorpay: queries IFSC
README.md - Login and signup → Registration sheet export: exports signup
backend/src/routes/auth.js - Review decisions → Email delivery: sends decisions
backend/src/routes/admin.js