How rohitvaddepalli/mern-marketplace works
Marketplace is a role-based commerce application: buyers discover products, check out, and follow orders; sellers manage stores, listings, inventory, and sales; administrators oversee platform entities and analytics. The React app provides role-specific interfaces and shared auth, cart, and socket state, while Express routes dispatch requests to controllers and MongoDB models. The README documents product capabilities beyond the sampled implementation, so those subsystems are represented at their supported directory paths; links whose wiring was not sampled are omitted.
Main entry points: server.js HTTP server · App.js React app · adminController.js Platform administration · orderController.js Order operations
Components 34
Marketplace UI
- React app
frontend/src/App.js - Buyer pages
frontend/src/pages - Seller pages
frontend/src/pages/Seller - Admin pages
frontend/src/pages/Admin - Shared state
frontend/src/context - API client
frontend/src/services/api.js
API and Access
- HTTP server
backend/server.js - Auth routes
backend/routes/authRoutes.js - Auth controller
backend/controllers/authController.js - Auth service
backend/services/authService.js - Product routes
backend/routes/productRoutes.js - Store routes
backend/routes/storeRoutes.js - Order routes
backend/routes/orderRoutes.js - Admin routes
backend/routes/adminRoutes.js - Analytics routes
backend/routes/analyticsRoutes.js - Chat routes
backend/routes/chat.js
Commerce Operations
- Product operations
backend/controllers/productController.js - Store operations
backend/controllers/storeController.js - Order operations
backend/controllers/orderController.js - Review operations
backend/controllers/reviewController.js - Platform administration
backend/controllers/adminController.js
Marketplace Data
- User records
backend/models/User.js - Product records
backend/models/Product.js - Store records
backend/models/Store.js - Order records
backend/models/Order.js - Review records
backend/models/Review.js - Platform settings
backend/models/Settings.js
Realtime and Insights
- Sales analytics
backend/services/analyticsService.js - Chat interface
frontend/src/components/Chat/ChatBox.js - Socket context
frontend/src/context/SocketContext.js - Socket.IO
backend/server.js
Other components
- Buyer
- Seller
- Administrator
Connections 43
- Buyer → React app: uses
- Seller → React app: uses
- Administrator → React app: uses
- React app → Buyer pages: renders
- React app → Seller pages: renders
- React app → Admin pages: renders
- React app → Shared state: provides
- Buyer pages → API client: requests
- Seller pages → API client: requests
- Admin pages → API client: requests
- API client → HTTP server: calls API
- HTTP server → Auth routes: mounts
- HTTP server → Product routes: mounts
- HTTP server → Store routes: mounts
- HTTP server → Order routes: mounts
- HTTP server → Admin routes: mounts
- HTTP server → Analytics routes: mounts
- HTTP server → Chat routes: mounts
- Auth routes → Auth controller: dispatches
- Auth controller → Auth service: calls
- Auth controller → User records: reads/writes
- Product routes → Product operations: dispatches
- Product routes → Review operations: dispatches
- Store routes → Store operations: dispatches
- Order routes → Order operations: dispatches
- Admin routes → Platform administration: dispatches
- Analytics routes → Sales analytics: dispatches
- Product operations → Product records: reads/writes
- Store operations → Store records: reads/writes
- Order operations → Order records: reads/writes
- Order operations → Product records: checks items
- Order operations → Platform settings: reads settings
- Review operations → Product records: checks product
- Review operations → Order records: checks purchase
- Review operations → Review records: reads/writes
- Platform administration → User records: manages
- Platform administration → Store records: manages
- Platform administration → Product records: manages
- Platform administration → Order records: manages
- Platform administration → Platform settings: reads settings
- Chat interface → Socket context: uses
- Socket context → Socket.IO: connects
- Order operations → Socket.IO: emits events