How utkarshgupta05/e-commerce works
This is a clothing-commerce application with a customer storefront, an Express/MongoDB API, and a separate administration console. Customers browse products, manage a size-specific cart, authenticate, and place orders using cash on delivery or online payment; they can then view orders. Administrators authenticate to manage products and order status. The graph includes the major storefront and admin flows plus the API’s principal domain controllers and persistence. Some connections are supported only by the SOURCE INDEX or HTTP paths; unsampled implementation details are not inferred.
Main entry points: server.js HTTP API · src/App.jsx Storefront routes · ShopContext.jsx Shop state · src/App.jsx Admin routes
Components 28
Customer storefront
- Storefront routes
Frontend/src/App.jsx - Browse catalog
Frontend/src/pages/Collection.jsx - Product details
Frontend/src/pages/Product.jsx - Shop state
Frontend/src/context/ShopContext.jsx - Shopping cart
Frontend/src/pages/Cart.jsx - Checkout
Frontend/src/pages/PlaceOrder.jsx - Payment verification
Frontend/src/pages/Verify.jsx - Customer orders
Frontend/src/pages/Orders.jsx - Customer login
Frontend/src/pages/Login.jsx
Commerce API
- HTTP API
Backend/server.js - User endpoints
Backend/routes/userRoute.js - Product endpoints
Backend/routes/productRoute.js - Cart endpoints
Backend/routes/cartRoute.js - Order endpoints
Backend/routes/orderRoute.js - Identity services
Backend/controllers/userController.js - Catalog services
Backend/controllers/productController.js - Cart services
Backend/controllers/cartController.js - Order and payment
Backend/controllers/orderController.js
Admin console
- Admin routes
admin/src/App.jsx - Admin login
admin/src/components/Login.jsx - Product management
admin/src/pages/Add.jsx - Product list
admin/src/pages/List.jsx - Order management
admin/src/pages/Orders.jsx
Persistence and media
- User records
Backend/models/userModel.js - Product records
Backend/models/productModel.js - Order records
Backend/models/orderModel.js - Image hosting
Backend/config/cloudinary.js
Other components
- Customer
Connections 39
- Customer → Storefront routes: uses
- Storefront routes → Browse catalog: routes to
Frontend/src/App.jsx - Storefront routes → Product details: routes to
Frontend/src/App.jsx - Storefront routes → Shopping cart: routes to
Frontend/src/App.jsx - Storefront routes → Checkout: routes to
Frontend/src/App.jsx - Storefront routes → Payment verification: routes to
Frontend/src/App.jsx - Storefront routes → Customer orders: routes to
Frontend/src/App.jsx - Storefront routes → Customer login: routes to
Frontend/src/App.jsx - Browse catalog → Shop state: reads catalog
Frontend/src/pages/Collection.jsx - Product details → Shop state: reads product state
Frontend/src/pages/Product.jsx - Shopping cart → Shop state: uses cart state
- Checkout → Shop state: uses cart state
Frontend/src/pages/PlaceOrder.jsx - Shop state → HTTP API: requests catalog and cart
Frontend/src/context/ShopContext.jsx - Checkout → HTTP API: submits orders
- Payment verification → HTTP API: verifies payment
- Customer orders → HTTP API: requests orders
- Customer login → HTTP API: authenticates
- HTTP API → User endpoints: mounts endpoints
Backend/server.js - HTTP API → Product endpoints: mounts endpoints
Backend/server.js - HTTP API → Cart endpoints: mounts endpoints
Backend/server.js - HTTP API → Order endpoints: mounts endpoints
Backend/server.js - User endpoints → Identity services: dispatches to
Backend/routes/userRoute.js - Product endpoints → Catalog services: dispatches to
Backend/routes/productRoute.js - Cart endpoints → Cart services: dispatches to
Backend/routes/cartRoute.js - Order endpoints → Order and payment: dispatches to
Backend/routes/orderRoute.js - Identity services → User records: reads and writes
Backend/controllers/userController.js - Cart services → User records: reads and updates cart
Backend/controllers/cartController.js - Order and payment → Order records: creates and updates
Backend/controllers/orderController.js - Order and payment → User records: updates cart
Backend/controllers/orderController.js - Catalog services → Product records: reads and writes
Backend/controllers/productController.js - Catalog services → Image hosting: uploads images
Backend/controllers/productController.js - Admin routes → Admin login: shows when unauthenticated
admin/src/App.jsx - Admin routes → Product management: routes to
admin/src/App.jsx - Admin routes → Product list: routes to
admin/src/App.jsx - Admin routes → Order management: routes to
admin/src/App.jsx - Admin login → HTTP API: authenticates
- Product management → HTTP API: manages products
- Product list → HTTP API: requests products
- Order management → HTTP API: manages orders