How burakorkmez/mern-ecommerce works
This is a full-stack e-commerce store. Customers browse products, authenticate, manage a persistent cart, apply coupons, and complete checkout through Stripe; successful payment creates an order. Admins manage products and view sales analytics. The graph follows the documented and indexed frontend-to-API workflow and sampled backend calls. Analytics and several UI subsystems are represented from the tree and README, but their internal behavior is not inferred beyond documented or indexed relationships.
Main entry points: App.jsx App Routes · server.js Express API · auth.middleware.js Route Protection · useCartStore.js Cart State
Components 34
Storefront
- App Routes
frontend/src/App.jsx - Product Browsing
frontend/src/pages/HomePage.jsx - Category View
frontend/src/pages/CategoryPage.jsx
Identity and Access
- Login and Signup
frontend/src/pages/LoginPage.jsx - User State
frontend/src/stores/useUserStore.js - Authentication
backend/controllers/auth.controller.js - Route Protection
backend/middleware/auth.middleware.js
Cart and Checkout
- Cart and Coupon UI
frontend/src/pages/CartPage.jsx - Cart State
frontend/src/stores/useCartStore.js - Purchase Results
frontend/src/pages/PurchaseSuccessPage.jsx - Cart Services
backend/controllers/cart.controller.js - Coupon Services
backend/controllers/coupon.controller.js - Checkout and Orders
backend/controllers/payment.controller.js
Catalog Administration
- Admin Dashboard
frontend/src/pages/AdminPage.jsx - Product State
frontend/src/stores/useProductStore.js - Sales Analytics
frontend/src/components/AnalyticsTab.jsx - Product Services
backend/controllers/product.controller.js - Analytics Services
backend/controllers/analytics.controller.js
API and Integrations
- Express API
backend/server.js - Auth Routes
backend/routes/auth.route.js - Product Routes
backend/routes/product.route.js - Cart Routes
backend/routes/cart.route.js - Coupon Routes
backend/routes/coupon.route.js - Payment Routes
backend/routes/payment.route.js - Analytics Routes
backend/routes/analytics.route.js - User Records
backend/models/user.model.js - Product Records
backend/models/product.model.js - Coupon Records
backend/models/coupon.model.js - Order Records
backend/models/order.model.js - Redis Cache
backend/lib/redis.js - Stripe Checkout
backend/lib/stripe.js - Image Hosting
backend/lib/cloudinary.js - MongoDB
Other components
- Customer
Connections 48
- Customer → App Routes: uses
frontend/src/App.jsx - App Routes → Login and Signup: routes to
frontend/src/App.jsx - App Routes → Cart and Coupon UI: routes to
frontend/src/App.jsx - App Routes → Admin Dashboard: routes to
frontend/src/App.jsx - App Routes → Product Browsing: routes to
frontend/src/App.jsx - App Routes → Category View: routes to
frontend/src/App.jsx - App Routes → Purchase Results: routes to
frontend/src/App.jsx - App Routes → User State: checks auth
frontend/src/App.jsx - App Routes → Cart State: loads cart
frontend/src/App.jsx - Login and Signup → User State: uses
frontend/src/pages/LoginPage.jsx - User State → Auth Routes: requests auth
frontend/src/stores/useUserStore.js - Cart and Coupon UI → Cart State: uses
frontend/src/pages/CartPage.jsx - Cart State → Cart Routes: requests cart
frontend/src/stores/useCartStore.js - Cart State → Coupon Routes: requests coupons
frontend/src/stores/useCartStore.js - Purchase Results → Cart State: clears cart
frontend/src/pages/PurchaseSuccessPage.jsx - Admin Dashboard → Product State: uses
frontend/src/pages/AdminPage.jsx - Admin Dashboard → Sales Analytics: renders
frontend/src/pages/AdminPage.jsx - Product State → Product Routes: requests products
frontend/src/stores/useProductStore.js - Sales Analytics → Analytics Routes: requests analytics
- Express API → Auth Routes: mounts
backend/server.js - Express API → Product Routes: mounts
backend/server.js - Express API → Cart Routes: mounts
backend/server.js - Express API → Coupon Routes: mounts
backend/server.js - Express API → Payment Routes: mounts
backend/server.js - Express API → Analytics Routes: mounts
backend/server.js - Auth Routes → Authentication: dispatches
backend/routes/auth.route.js - Auth Routes → Route Protection: protects profile
backend/routes/auth.route.js - Product Routes → Product Services: dispatches
backend/routes/product.route.js - Product Routes → Route Protection: protects admin
backend/routes/product.route.js - Cart Routes → Cart Services: dispatches
backend/routes/cart.route.js - Cart Routes → Route Protection: protects
backend/routes/cart.route.js - Coupon Routes → Coupon Services: dispatches
backend/routes/coupon.route.js - Coupon Routes → Route Protection: protects
backend/routes/coupon.route.js - Payment Routes → Checkout and Orders: dispatches
backend/routes/payment.route.js - Payment Routes → Route Protection: protects
backend/routes/payment.route.js - Analytics Routes → Analytics Services: dispatches
backend/routes/analytics.route.js - Analytics Routes → Route Protection: protects
backend/routes/analytics.route.js - Authentication → User Records: reads and writes
backend/controllers/auth.controller.js - Authentication → Redis Cache: stores tokens
backend/controllers/auth.controller.js - Route Protection → User Records: loads user
backend/middleware/auth.middleware.js - Product Services → Product Records: queries
backend/controllers/product.controller.js - Product Services → Redis Cache: caches featured
backend/controllers/product.controller.js - Product Services → Image Hosting: uploads images
backend/controllers/product.controller.js - Cart Services → Product Records: loads products
backend/controllers/cart.controller.js - Checkout and Orders → Coupon Records: validates and updates
backend/controllers/payment.controller.js - Checkout and Orders → Order Records: creates order
backend/controllers/payment.controller.js - Checkout and Orders → Stripe Checkout: creates session
backend/controllers/payment.controller.js - Express API → MongoDB: connects
backend/server.js