How abdelmajeed28/ecommerce-app works
MyStore is a full-stack shop: shoppers browse and filter products, manage a cart or wishlist, authenticate, and check out; staff-facing functionality is not apparent in the supplied evidence. The client uses routed React pages, Redux state, and RTK Query, while Express routes dispatch to controllers that work with MongoDB models. Checkout creates a Stripe session, and a signed Stripe webhook confirms payment and updates stock and cart state. The graph follows the sampled wiring and README capabilities; unsampled frontend calls and some optional integrations are left unlinked where their relationships are not shown.
Main entry points: App.jsx App Routes · orderController.js Order & Payment · server.js Express Entry · useUserSync.js User Data Sync
Components 30
Storefront
- App Routes
client/src/App.jsx - Catalog Pages
client/src/pages/Products.jsx - Product Details
client/src/pages/ProductDetails.jsx - Cart & Checkout
client/src/pages/Checkout.jsx - Account Pages
client/src/pages/Profile.jsx - Order Results
client/src/pages/OrderSuccess.jsx
Client State
- Auth State & API
client/src/features/auth/authApiSlice.js - Cart State
client/src/features/cart/cartSlice.js - Wishlist State
client/src/features/wishlist/wishlistSlice.js - Product API
client/src/features/products/productsApiSlice.js - User Data Sync
client/src/hooks/useUserSync.js - Session Check
client/src/hooks/useAuthCheck.js - Theme Preference
client/src/context/ThemeContext.jsx
API Services
- Express Entry
server/server.js - Auth Routes
server/src/routes/auth.js - User Routes
server/src/routes/user.js - Product Routes
server/src/routes/products.js - Order Routes
server/src/routes/orders.js - Auth Controller
server/src/controllers/authController.js - Product Controller
server/src/controllers/productController.js - User Controller
server/src/controllers/userController.js - Order & Payment
server/src/controllers/orderController.js - JWT Middleware
server/src/middleware/auth.js
Domain Data
- Product Model
server/src/models/Product.js - User Model
server/src/models/User.js - Order Model
server/src/models/Order.js
External Services
- MongoDB
- Stripe
- Email Service
Other components
- Shopper
Connections 45
- Shopper → App Routes: uses
client/src/App.jsx - App Routes → Catalog Pages: routes to
client/src/App.jsx - App Routes → Product Details: routes to
client/src/App.jsx - App Routes → Cart & Checkout: protects routes
client/src/App.jsx - App Routes → Account Pages: routes to
client/src/App.jsx - App Routes → Order Results: routes to
client/src/App.jsx - App Routes → Session Check: checks session
client/src/App.jsx - App Routes → User Data Sync: syncs user data
client/src/App.jsx - Catalog Pages → Product API: queries catalog
- Product Details → Product API: loads product
- Cart & Checkout → Cart State: uses cart
- Cart & Checkout → Product API: requests checkout
client/src/pages/Checkout.jsx - Session Check → Auth State & API: fetches session
client/src/hooks/useAuthCheck.js - Session Check → Auth State & API: updates auth state
client/src/hooks/useAuthCheck.js - User Data Sync → Auth State & API: fetches and updates
client/src/hooks/useUserSync.js - User Data Sync → Cart State: hydrates cart
client/src/hooks/useUserSync.js - User Data Sync → Wishlist State: hydrates wishlist
client/src/hooks/useUserSync.js - Shopper → Theme Preference: sets preference
- Express Entry → Auth Routes: mounts routes
server/server.js - Express Entry → User Routes: mounts routes
server/server.js - Express Entry → Product Routes: mounts routes
server/server.js - Express Entry → Order Routes: mounts routes
server/server.js - Express Entry → Order & Payment: routes webhook
server/server.js - Auth Routes → Auth Controller: dispatches to
server/src/routes/auth.js - Auth Routes → JWT Middleware: protects endpoints
server/src/routes/auth.js - User Routes → User Controller: dispatches to
server/src/routes/user.js - User Routes → JWT Middleware: protects endpoints
server/src/routes/user.js - Product Routes → Product Controller: dispatches to
server/src/routes/products.js - Order Routes → Order & Payment: dispatches to
server/src/routes/orders.js - Order Routes → JWT Middleware: protects endpoints
server/src/routes/orders.js - Auth Controller → User Model: reads and writes
server/src/controllers/authController.js - Auth Controller → Email Service: sends reset email
server/src/controllers/authController.js - Product Controller → Product Model: queries products
server/src/controllers/productController.js - User Controller → User Model: updates user
server/src/controllers/userController.js - Order & Payment → Product Model: validates stock
server/src/controllers/orderController.js - Order & Payment → Order Model: creates and reads
server/src/controllers/orderController.js - Order & Payment → User Model: clears cart
server/src/controllers/orderController.js - Order & Payment → Stripe: creates session and verifies webhook
server/src/controllers/orderController.js - Product Model → MongoDB: persists
- User Model → MongoDB: persists
- Order Model → MongoDB: persists
- Auth State & API → Auth Routes: calls auth endpoints
client/src/features/auth/authApiSlice.js - User Data Sync → User Routes: syncs account data
- Product API → Product Routes: queries catalog
- Cart & Checkout → Stripe: checkout redirect