How avn2312/marketnest works
MarketNest is a grocery-commerce application: customers browse products, manage a cart and delivery address, apply coupons, pay by COD or Razorpay, and track orders; sellers manage products, stock, coupons, and orders. React routes and shared context drive the storefront and seller dashboard, while Express exposes the API and backend services handle catalog, checkout, order state, payments, and notifications. The README documents additional capabilities not fully sampled; those are represented at subsystem level. Some backend route/controller wiring and frontend API usage are unsampled, so uncertain links are omitted.
Main entry points: App.jsx Route application · orderService.js Order lifecycle · controllers API controllers · razorpayPaymentService.js Razorpay payments
Components 26
Customer storefront
- Route application
frontend/src/App.jsx - Shared app context
frontend/src/context/AppContext.jsx - Browse products
frontend/src/pages/ProductDetails.jsx - Cart and checkout
frontend/src/pages/Cart.jsx - Order history
frontend/src/pages/MyOrders.jsx
Seller workspace
- Seller dashboard
frontend/src/pages/seller/Orders.jsx - Product and stock tools
frontend/src/pages/seller/ProductList.jsx - Coupon management
frontend/src/pages/seller/Coupons.jsx
Express API
- API server
backend/server.js - API gateway
backend/src/gateway/apiGateway.js - API controllers
backend/src/controllers
Commerce services
- Product catalog
backend/src/services/productCatalogService.js - Order lifecycle
backend/src/services/orderService.js - Checkout calculations
backend/src/services/checkoutService.js - Razorpay payments
backend/src/services/razorpayPaymentService.js - Inventory controls
backend/src/services/inventoryService.js - Order event bus
backend/src/services/orderEventBus.js - Notifications
backend/src/services/notificationService.js
Persistence and integrations
- Mongo domain models
backend/src/models - Postgres checkout writes
backend/src/repositories/postgresCheckoutRepository.js - Postgres order repository
backend/src/repositories/postgresOrderRepository.js - Postgres payment repository
backend/src/repositories/postgresPaymentRepository.js - Postgres connection
backend/src/db/postgres.js
Other components
- Customer
- Seller
- Razorpay
Connections 36
- Customer → Route application: uses
README.md - Seller → Route application: uses
README.md - Route application → Browse products: routes to
frontend/src/App.jsx - Route application → Cart and checkout: routes to
frontend/src/App.jsx - Route application → Order history: routes to
frontend/src/App.jsx - Route application → Seller dashboard: routes to
frontend/src/App.jsx - Route application → Product and stock tools: routes to
frontend/src/App.jsx - Route application → Coupon management: routes to
frontend/src/App.jsx - Route application → Shared app context: reads
frontend/src/App.jsx - Cart and checkout → Shared app context: reads
frontend/src/pages/Cart.jsx - Order history → Shared app context: reads
frontend/src/pages/MyOrders.jsx - Cart and checkout → API controllers: requests checkout
frontend/src/pages/Cart.jsx - Seller dashboard → API controllers: manages orders
README.md - Product and stock tools → API controllers: manages products
README.md - Coupon management → API controllers: manages coupons
README.md - API server → API gateway: mounts
backend/server.js - API server → Notifications: registers consumers
backend/server.js - API server → Razorpay payments: routes webhook
backend/server.js - API controllers → Product catalog: calls catalog
backend/src/controllers/productController.js - API controllers → Order lifecycle: calls order service
backend/src/controllers/orderController.js - API controllers → Razorpay payments: calls payment service
backend/src/controllers/paymentController.js - Product catalog → Mongo domain models: reads and writes
backend/src/services/productCatalogService.js - Order lifecycle → Checkout calculations: calculates subtotal
backend/src/services/orderService.js - Order lifecycle → Razorpay payments: initiates payment
backend/src/services/orderService.js - Order lifecycle → Inventory controls: reserves stock
backend/src/services/orderService.js - Order lifecycle → Order event bus: publishes events
backend/src/services/orderService.js - Order lifecycle → Mongo domain models: reads and writes
backend/src/services/orderService.js - Order lifecycle → Postgres checkout writes: uses checkout storage
backend/src/services/orderService.js - Order lifecycle → Postgres order repository: uses order storage
backend/src/services/orderService.js - Razorpay payments → Mongo domain models: persists payment events
backend/src/services/razorpayPaymentService.js - Razorpay payments → Postgres payment repository: writes payments
backend/src/services/razorpayPaymentService.js - Postgres checkout writes → Postgres connection: runs transactions
backend/src/repositories/postgresCheckoutRepository.js - Postgres order repository → Postgres connection: uses connection
backend/src/repositories/postgresOrderRepository.js - Postgres payment repository → Postgres connection: uses connection
backend/src/repositories/postgresPaymentRepository.js - Razorpay payments → Razorpay: calls API
backend/src/services/razorpayPaymentService.js - Notifications → Order event bus: subscribes
backend/src/services/notificationService.js