How shraddhas007/ecom works
This is a women’s fashion e-commerce application with a customer storefront, an Express/MongoDB API, and a separate admin panel. The main customer flow is browsing category collections, managing a cart, placing an order, and completing payment; administrators manage products and orders. The graph also preserves account and password-reset flows, product image uploads, and catalog merchandising. Several page-to-API links are documented or visible in the sampled context; unsampled admin API wiring is left unasserted.
Main entry points: orderController.js Order processing · productController.js Product catalog · server.js API server · App.jsx Storefront router
Components 33
Customer storefront
- Storefront router
frontend/src/App.jsx - Shop context
frontend/src/context/ShopContext.jsx - Home and merchandising
frontend/src/pages/Home.jsx - Category collections
frontend/src/pages - Product detail
frontend/src/pages/Product.jsx
Cart and checkout
- Cart
frontend/src/pages/Cart.jsx - Place order
frontend/src/pages/PlaceOrder.jsx - Payment verification
frontend/src/pages/Verify.jsx - Customer orders
frontend/src/pages/Orders.jsx
Accounts and access
- Customer login
frontend/src/pages/Login.jsx
Backend services
- Product catalog
backend/controllers/productController.js - Product records
backend/models/productModel.js - Cart operations
backend/controllers/cartController.js - Order processing
backend/controllers/orderController.js - Order records
backend/models/orderModel.js - User and admin auth
backend/controllers/userController.js - User and cart data
backend/models/userModel.js - API server
backend/server.js - User routes
backend/routes/userRoute.js - Product routes
backend/routes/productRoute.js - Cart routes
backend/routes/cartRoute.js - Order routes
backend/routes/orderRoute.js - MongoDB connection
backend/config/mongodb.js
Admin operations
- Admin application
admin/src/App.jsx - Admin login
admin/src/components/Login.jsx - Add products
admin/src/pages/Add.jsx - Product list
admin/src/pages/List.jsx - Order management
admin/src/pages/Orders.jsx
Other components
- Customer
- Stripe
- Email service
- Cloudinary
- Administrator
Connections 39
- Customer → Storefront router: uses
- Storefront router → Home and merchandising: routes to
frontend/src/App.jsx - Storefront router → Category collections: routes to
frontend/src/App.jsx - Storefront router → Product detail: routes to
frontend/src/App.jsx - Storefront router → Shop context: provides
frontend/src/App.jsx - Shop context → Product catalog: requests catalog
frontend/src/context/ShopContext.jsx - Product catalog → Product records: queries
backend/controllers/productController.js - Shop context → Cart operations: requests cart
frontend/src/context/ShopContext.jsx - Cart operations → User and cart data: reads and updates
backend/controllers/cartController.js - Cart operations → Product records: loads item details
backend/controllers/cartController.js - Cart → Shop context: uses
frontend/src/pages/Cart.jsx - Place order → Order processing: submits order
- Order processing → Order records: creates and queries
backend/controllers/orderController.js - Order processing → User and cart data: updates cart
backend/controllers/orderController.js - Order processing → Product records: loads order items
backend/controllers/orderController.js - Order processing → Stripe: creates checkout
backend/controllers/orderController.js - Payment verification → Order processing: verifies payment
- Customer orders → Order processing: requests orders
- Customer login → User and admin auth: authenticates
- User and admin auth → User and cart data: reads and saves
backend/controllers/userController.js - User and admin auth → Email service: sends reset OTP
backend/controllers/userController.js - API server → User routes: mounts
backend/server.js - API server → Product routes: mounts
backend/server.js - API server → Cart routes: mounts
backend/server.js - API server → Order routes: mounts
backend/server.js - User routes → User and admin auth: dispatches to
backend/routes/userRoute.js - Product routes → Product catalog: dispatches to
backend/routes/productRoute.js - Cart routes → Cart operations: dispatches to
backend/routes/cartRoute.js - Order routes → Order processing: dispatches to
backend/routes/orderRoute.js - API server → MongoDB connection: connects
backend/server.js - Product catalog → Cloudinary: uploads images
backend/controllers/productController.js - Administrator → Admin application: uses
- Admin application → Admin login: renders when logged out
admin/src/App.jsx - Admin application → Add products: routes to
admin/src/App.jsx - Admin application → Product list: routes to
admin/src/App.jsx - Admin application → Order management: routes to
admin/src/App.jsx - Add products → Product catalog: manages products
- Product list → Product catalog: manages products
- Order management → Order processing: manages orders