How duyphan2501/mern-ecommerce-electronic-devices works
This is a MERN ecommerce system with a customer storefront, an admin dashboard, and an Express API. The main customer journey is browsing products, building a guest or signed-in cart, checking out, paying, and tracking the resulting order; Redis supports cart and stock reservations while MongoDB persists application data. The admin dashboard covers catalog, orders, inventory, and site content. The graph combines documented capabilities with sampled routing and service code; unsampled subsystem wiring is shown only at the documented or directory level.
Main entry points: src/App.jsx Storefront routes · controller Request controllers · service Domain services · src/App.jsx Dashboard routes
Components 22
Customer storefront
- Storefront routes
client/src/App.jsx - Product browsing
client/src/pages/ProductPage.jsx - Cart and checkout
client/src/pages/Checkout.jsx - Account and tracking
client/src/pages/OrderTracking.jsx - Client state
client/src/store
Admin operations
- Dashboard routes
admin/src/App.jsx - Catalog and operations
admin/src/Pages - Site content editing
admin/src/Pages/Services/ServiceForm.jsx - Admin state
admin/src/store
API and domain
- REST API entry
server/index.js - API routes
server/routes - Request controllers
server/controller - Domain services
server/service - JWT and sessions
server/helper/jwt_service.js - Reservation reclaim
server/workers/inventory.worker.js
Persistence and integrations
- MongoDB
server/model - Redis
server/config/init.redis.js - PayOS
- Cloudinary
- Email service
server/mail/emails.js
Other components
- Customer
- Admin user
Connections 28
- Customer → Storefront routes: uses
- Storefront routes → Product browsing: routes to
- Storefront routes → Cart and checkout: routes to
- Storefront routes → Account and tracking: routes to
- Storefront routes → Client state: loads state
- Product browsing → Client state: reads catalog
- Cart and checkout → Client state: updates cart
- Account and tracking → Client state: reads account
- Admin user → Dashboard routes: uses
- Dashboard routes → Catalog and operations: routes to
- Dashboard routes → Site content editing: routes to
- Catalog and operations → Admin state: uses state
- Site content editing → Admin state: saves content
- Storefront routes → REST API entry: calls REST API
- Dashboard routes → REST API entry: calls REST API
- REST API entry → API routes: dispatches
- API routes → Request controllers: dispatches
- Request controllers → Domain services: invokes
- Request controllers → MongoDB: reads and writes
- Domain services → MongoDB: reads and writes
- Domain services → Redis: reserves stock
- Domain services → PayOS: creates payment link
- PayOS → REST API entry: sends webhook
- Request controllers → JWT and sessions: issues tokens
- Domain services → Email service: publishes order email
- Request controllers → Cloudinary: uploads media
- Reservation reclaim → Redis: reclaims expired holds
- Reservation reclaim → MongoDB: updates inventory