How trunghai04/muasamviet_old works
MuaSamViet is a React storefront backed by an Express/MySQL API. The main customer journey is browsing products, managing a cart, checking out, and tracking orders; separate branches cover accounts, administration, partner operations, and customer support. The graph includes documented capabilities even where source was not sampled. Dashed links mark documented or plausible integration points whose implementation-level wiring was not shown.
Main entry points: App.jsx Web app router · Checkout.jsx Checkout · server.js Express API and sockets · CartContext.jsx Cart state
Components 29
Storefront
- Web app router
client/src/App.jsx - Home and catalog
client/src/pages/Home.jsx - Product details
client/src/pages/products/ProductDetails.jsx - Flash sales
client/src/pages/flash-sale/FlashSale.jsx
Commerce
- Cart state
client/src/context/CartContext.jsx - Cart
client/src/pages/cart/Cart.jsx - Checkout
client/src/pages/checkout/Checkout.jsx - Order confirmation
client/src/pages/checkout/OrderConfirmation.jsx - Order history
client/src/pages/user/OrderHistory.jsx - Wishlist
client/src/pages/wishlist/Wishlist.jsx - Catalog endpoints
server/src/routes/products.js - Product controller
server/src/controllers/productController.js - Product model
server/src/models/Product.js - Order endpoints
server/src/routes/orders.js - Order controller
server/src/controllers/orderController.js
Identity
- Auth state
client/src/context/AuthContext.jsx - Account and loyalty
client/src/pages/user/MyAccount.jsx - Sign-in and registration
client/src/pages/auth/Register.jsx - Auth routes
server/src/routes/auth.js - Auth controller
server/src/controllers/authController.js - User model
server/src/models/User.js - Email service
server/src/config/email.js
Operations
- Admin dashboard
client/src/pages/admin/AdminDashboard.jsx - Partner dashboard
client/src/pages/partner/PartnerDashboard.jsx - Support and feedback
client/src/pages/support/Support.jsx - Real-time chat
client/src/pages/chat/Chat.jsx - Express API and sockets
server/src/server.js - MySQL database
server/src/config/database.js
Other components
- Shopper
Connections 37
- Shopper → Web app router: uses
README.md - Web app router → Home and catalog: routes to
client/src/App.jsx - Web app router → Product details: routes to
client/src/App.jsx - Web app router → Flash sales: routes to
client/src/App.jsx - Web app router → Cart: routes to
client/src/App.jsx - Web app router → Checkout: routes to
client/src/App.jsx - Web app router → Order confirmation: routes to
client/src/App.jsx - Web app router → Wishlist: routes to
client/src/App.jsx - Web app router → Sign-in and registration: routes to
client/src/App.jsx - Web app router → Account and loyalty: routes to
client/src/App.jsx - Web app router → Admin dashboard: routes to
client/src/App.jsx - Web app router → Partner dashboard: routes to
client/src/App.jsx - Web app router → Support and feedback: routes to
client/src/App.jsx - Web app router → Real-time chat: routes to
client/src/App.jsx - Web app router → Auth state: provides
client/src/App.jsx - Web app router → Cart state: provides
client/src/App.jsx - Cart → Cart state: uses
client/src/pages/cart/Cart.jsx - Checkout → Cart state: uses
client/src/pages/checkout/Checkout.jsx - Checkout → Auth state: uses
client/src/pages/checkout/Checkout.jsx - Product details → Cart state: uses
client/src/pages/products/ProductDetails.jsx - Sign-in and registration → Auth state: uses
client/src/pages/auth/Register.jsx - Express API and sockets → Auth routes: mounts
server/src/server.js - Auth routes → Auth controller: dispatches
server/src/routes/auth.js - Auth controller → User model: reads and writes
server/src/controllers/authController.js - Auth controller → Email service: sends email
server/src/controllers/authController.js - Express API and sockets → Catalog endpoints: mounts
server/src/server.js - Product controller → Product model: uses
server/src/controllers/productController.js - Order controller → MySQL database: queries
server/src/controllers/orderController.js - Product model → MySQL database: queries
server/src/models/Product.js - User model → MySQL database: queries
server/src/models/User.js - Shopper → Home and catalog: browses
README.md - Shopper → Cart: manages cart
README.md - Checkout → Order endpoints: submits order
- Order endpoints → Order controller: dispatches
- Order history → Order endpoints: requests history
- Real-time chat → Express API and sockets: realtime connection
- Wishlist → Express API and sockets: requests wishlist