How moodgame/ecommerce works
This repository implements a fashion e-commerce application: shoppers browse products, manage a cart, and place or review orders; administrators manage catalog items and orders. The backend exposes user, product, cart, and order APIs, with MongoDB-backed models and Cloudinary image uploads. The tree contains three closely related storefront copies (frontend, frontsnd, and play); the graph uses frontend as the representative storefront and includes play’s additional welcome route. Several UI and route relationships are supported only by the SOURCE INDEX, so unsampled behavior is not expanded.
Main entry points: server.js API server · src/App.jsx Storefront routes · Shopcontext.jsx Shop state · src/App.jsx Admin routes
Components 28
Storefront
- Storefront routes
frontend/src/App.jsx - Catalog browsing
frontend/src/pages/Collection.jsx - Product details
frontend/src/pages/Product.jsx - Shop state
frontend/src/context/Shopcontext.jsx - Cart and checkout
frontend/src/pages/PlaceOrder.jsx - Accounts and orders
frontend/src/pages/Orders.jsx - Product search
frontend/src/components/SearchBar.jsx
Admin console
- Admin routes
admin/src/App.jsx - Admin login
admin/src/components/Login.jsx - Catalog management
admin/src/pages/Add.jsx - Order management
admin/src/pages/Orders.jsx
Backend API
- API server
backend/server.js - User API
backend/routes/userRoute.js - Product API
backend/routes/productRoute.js - Cart API
backend/routes/cartRoute.js - Order API
backend/routes/orderRoute.js - User operations
backend/controllers/userController.js - Product operations
backend/controllers/productController.js - Cart operations
backend/controllers/cartController.js - Order operations
backend/controllers/orderController.js
Persistence and media
- MongoDB connection
backend/config/mongodb.js - Cloudinary connection
backend/config/cloudinary.js - User records
backend/models/userModel.js - Product records
backend/models/productModel.js - Order records
backend/models/orderModel.js
Other components
- Shopper
- Administrator
- Cloudinary
Connections 32
- Shopper → Storefront routes: uses
frontend/src/App.jsx - Storefront routes → Catalog browsing: routes to
frontend/src/App.jsx - Storefront routes → Product details: routes to
frontend/src/App.jsx - Storefront routes → Cart and checkout: routes to
frontend/src/App.jsx - Storefront routes → Accounts and orders: routes to
frontend/src/App.jsx - Storefront routes → Product search: renders
frontend/src/App.jsx - Catalog browsing → Shop state: uses state
- Product details → Shop state: uses state
- Cart and checkout → Shop state: uses state
frontend/src/pages/PlaceOrder.jsx - Product search → Shop state: reads state
frontend/src/components/SearchBar.jsx - Shop state → API server: requests API
frontend/src/context/Shopcontext.jsx - Administrator → Admin routes: uses
admin/src/App.jsx - Admin routes → Admin login: renders
admin/src/App.jsx - Admin routes → Catalog management: routes to
admin/src/App.jsx - Admin routes → Order management: routes to
admin/src/App.jsx - API server → MongoDB connection: connects
backend/server.js - API server → Cloudinary connection: connects
backend/server.js - API server → User API: mounts
backend/server.js - API server → Product API: mounts
backend/server.js - API server → Cart API: mounts
backend/server.js - API server → Order API: mounts
backend/server.js - User API → User operations: routes to
backend/routes/userRoute.js - Product API → Product operations: routes to
backend/routes/productRoute.js - Cart API → Cart operations: routes to
- Order API → Order operations: routes to
backend/routes/orderRoute.js - User operations → User records: queries
backend/controllers/userController.js - Product operations → Product records: queries
backend/controllers/productController.js - Product operations → Cloudinary: uploads images
backend/controllers/productController.js - Order operations → User records: reads and updates
backend/controllers/orderController.js - Order operations → Order records: stores orders
backend/controllers/orderController.js - Cart operations → User records: updates cart
backend/controllers/cartController.js - Cloudinary connection → Cloudinary: configures