How surya252006/kisanconnect works
KisanConnect is a direct farmer-to-buyer produce marketplace. Users browse and compare listings, farmers manage inventory, buyers place and track orders, and administrators govern verification and view analytics. The React client uses a shared API/auth layer to reach Express routes and controllers, which operate on MongoDB models and optional Cloudinary image storage. The README documents the major features; some client pages and backend controllers were not sampled, so their internal call relationships are not inferred.
Main entry points: App.jsx React app and routes · server.js Express API · api.js API client · AuthContext.jsx Session context
Components 34
Web client
- React app and routes
client/src/App.jsx - Login and registration
client/src/pages/auth/Login.jsx - Session context
client/src/context/AuthContext.jsx - API client
client/src/services/api.js
Marketplace and orders
- Home
client/src/pages/home/Home.jsx - Marketplace browsing
client/src/pages/marketplace/Marketplace.jsx - Product details
client/src/pages/marketplace/ProductDetails.jsx - Farmer listings
client/src/pages/farmer/MyProducts.jsx - Buyer order views
client/src/pages/orders/MyOrders.jsx - Farmer order queue
client/src/pages/farmer/FarmerOrders.jsx
Trust and insights
- Price insights
client/src/pages/price/PriceInsights.jsx - Verification admin
client/src/pages/admin/Verification.jsx - Admin analytics
client/src/pages/admin/AdminDashboard.jsx
API and access
- Express API
server/server.js - Authentication routes
server/routes/authRoutes.js - Product routes
server/routes/productRoutes.js - Order routes
server/routes/orderRoutes.js - Price routes
server/routes/priceInsightRoutes.js - Verification routes
server/routes/verificationRoutes.js - Analytics routes
server/routes/analyticsRoutes.js - Authentication logic
server/controllers/authController.js - Listing logic
server/controllers/productController.js - Order and logistics logic
server/controllers/orderController.js - Benchmark logic
server/controllers/priceInsightController.js - Verification logic
server/controllers/verificationController.js - Analytics logic
server/controllers/analyticsController.js - JWT authentication
server/middleware/authMiddleware.js - Role authorization
server/middleware/roleMiddleware.js
Domain data
- Product records
server/models/Product.js - Order records
server/models/Order.js - User records
server/models/User.js - Price insights
server/models/PriceInsight.js
Other components
- Marketplace users
- Cloudinary storage
Connections 45
- Marketplace users → React app and routes: uses
- React app and routes → Session context: provides session
client/src/App.jsx - React app and routes → Home: routes to
client/src/App.jsx - React app and routes → Marketplace browsing: routes to
client/src/App.jsx - React app and routes → Product details: routes to
client/src/App.jsx - React app and routes → Farmer listings: routes to
client/src/App.jsx - React app and routes → Buyer order views: routes to
client/src/App.jsx - React app and routes → Farmer order queue: routes to
client/src/App.jsx - React app and routes → Price insights: routes to
client/src/App.jsx - React app and routes → Verification admin: routes to
client/src/App.jsx - React app and routes → Admin analytics: routes to
client/src/App.jsx - Login and registration → Session context: authenticates through
client/src/context/AuthContext.jsx - Session context → API client: calls
client/src/context/AuthContext.jsx - Home → Session context: reads session
client/src/pages/home/Home.jsx - Product details → API client: requests data
client/src/pages/marketplace/ProductDetails.jsx - Product details → Session context: reads session
client/src/pages/marketplace/ProductDetails.jsx - Farmer listings → API client: updates listings
- Buyer order views → API client: requests orders
- Price insights → API client: requests benchmarks
client/src/pages/price/PriceInsights.jsx - Price insights → Session context: reads session
client/src/pages/price/PriceInsights.jsx - Verification admin → API client: manages requests
client/src/pages/admin/Verification.jsx - Admin analytics → API client: requests metrics
client/src/pages/admin/AdminDashboard.jsx - API client → Express API: REST requests
- Express API → Authentication routes: mounts
server/server.js - Express API → Product routes: mounts
server/server.js - Express API → Order routes: mounts
server/server.js - Express API → Price routes: mounts
server/server.js - Express API → Verification routes: mounts
server/server.js - Express API → Analytics routes: mounts
server/server.js - Authentication routes → Authentication logic: dispatches
server/routes/authRoutes.js - Product routes → Listing logic: dispatches
server/routes/productRoutes.js - Order routes → Order and logistics logic: dispatches
server/routes/orderRoutes.js - Price routes → Benchmark logic: dispatches
server/routes/priceInsightRoutes.js - Verification routes → Verification logic: dispatches
server/routes/verificationRoutes.js - Analytics routes → Analytics logic: dispatches
server/routes/analyticsRoutes.js - Authentication routes → JWT authentication: protects routes
server/routes/authRoutes.js - Product routes → JWT authentication: protects routes
server/routes/productRoutes.js - Order routes → JWT authentication: protects routes
server/routes/orderRoutes.js - Product routes → Role authorization: checks roles
server/routes/productRoutes.js - Order routes → Role authorization: checks roles
server/routes/orderRoutes.js - Authentication logic → User records: reads and writes
server/controllers/authController.js - JWT authentication → User records: loads user
server/middleware/authMiddleware.js - Listing logic → Product records: reads and writes
server/controllers/productController.js - Listing logic → Cloudinary storage: uploads images
server/controllers/productController.js - Order and logistics logic → Product records: checks and adjusts stock
server/controllers/orderController.js