How suriyanandhimalai555-prog/avg_mart works
AVG Mart is a multi-role ecommerce application: customers browse products, manage a cart, check out and follow orders, while admins, branch staff, sellers and marketers manage catalog, stock and sales operations. The sampled code shows React route composition and an Express API, with PostgreSQL-backed order and catalog work plus S3 media and payment/shipping integrations. Several UI-to-API calls and unsampled operational handlers are not shown, so those links are omitted or marked unverified rather than inferred as confirmed calls.
Main entry points: App.jsx React route app · server.js HTTP route registration · db.js PostgreSQL pool · productController.js Product and review API
Components 24
Customer storefront
- React route app
client/src/App.jsx - Product browsing
client/src/pages/AllProducts.jsx - Product detail
client/src/pages/ProductDetailView.jsx - Cart
client/src/pages/Cart.jsx - Checkout
client/src/pages/Checkout.jsx - Account and orders
client/src/pages/Profile.jsx - Customer signup
client/src/pages/Signup.jsx
Commerce services
- Product and review API
server/controllers/productController.js - Review handling
server/controllers/reviewController.js - Authentication
server/controllers/authController.js - Cart handling
server/controllers/cartController.js - Orders and payment
server/controllers/paymentController.js - HTTP route registration
server/server.js
Marketplace operations
- Admin catalog and orders
client/src/pages/admin/AddProducts.jsx - Branch stock and orders
client/src/pages/branchAdmin/BranchOrders.jsx - Seller workspace
client/src/pages/seller/SellerProduct.jsx - Seller services
server/controllers/sellerController.js - Stock operations
server/controllers/stockController.js
Data and integrations
- PostgreSQL pool
server/config/db.js - S3 media storage
server/config/s3.js - Token authorization
server/middleware/authMiddleware.js
Other components
- Customer
- Razorpay
- Shypfy shipping
Connections 33
- Customer → React route app: opens
client/src/App.jsx - React route app → Product browsing: routes to
client/src/App.jsx - React route app → Product detail: routes to
client/src/App.jsx - React route app → Cart: routes to
client/src/App.jsx - React route app → Checkout: routes to
client/src/App.jsx - React route app → Account and orders: routes to
client/src/App.jsx - React route app → Customer signup: routes to
client/src/App.jsx - React route app → Admin catalog and orders: routes to
client/src/App.jsx - React route app → Branch stock and orders: routes to
client/src/App.jsx - React route app → Seller workspace: routes to
client/src/App.jsx - HTTP route registration → Product and review API: mounts routes
server/server.js - HTTP route registration → Authentication: mounts routes
server/server.js - HTTP route registration → Seller services: mounts routes
server/server.js - HTTP route registration → Stock operations: mounts routes
server/server.js - Product and review API → Review handling: routes reviews
server/routes/productRoutes.js - Product and review API → Token authorization: protects writes
server/routes/productRoutes.js - Seller services → Token authorization: protects endpoints
server/routes/sellerRoutes.js - Product and review API → PostgreSQL pool: queries
server/controllers/productController.js - Review handling → PostgreSQL pool: reads and writes
server/controllers/reviewController.js - Review handling → S3 media storage: uploads images
server/controllers/reviewController.js - Seller services → PostgreSQL pool: queries
server/controllers/sellerController.js - Seller services → S3 media storage: uploads documents
server/controllers/sellerController.js - Authentication → PostgreSQL pool: uses user models
server/controllers/authController.js - Cart handling → PostgreSQL pool: queries
server/controllers/cartController.js - Orders and payment → PostgreSQL pool: queries and writes
server/controllers/paymentController.js - Orders and payment → Razorpay: creates payment orders
server/controllers/paymentController.js - Orders and payment → Shypfy shipping: creates and tracks shipments
server/controllers/paymentController.js - Checkout → HTTP route registration: submits checkout
- Product browsing → HTTP route registration: loads catalog
- Account and orders → HTTP route registration: requests account data
- Admin catalog and orders → HTTP route registration: manages catalog
- Branch stock and orders → HTTP route registration: manages stock
- Seller workspace → HTTP route registration: manages listings