How shubhamdutta2000/eshop-ecommerce-site works
eShop is a MERN storefront with customer shopping and checkout, account management, and admin catalog/order/user workflows. The principal journey is browsing/searching products, adding items to a cart, entering shipping and payment details, placing an order, and viewing its status. The React app communicates with an Express API; controllers use MongoDB models for product, user, and order data. Stripe, PayPal, and image uploads support checkout and administration. The README also documents reviews, pagination, and offline/PWA behavior; several corresponding source files were not sampled, so uncertain internal links are omitted.
Main entry points: App.js App routes · server.js Express server · store.js Redux actions and state · OrderRoutes.js Order routes
Components 28
Storefront client
- App routes
frontend/src/App.js - Catalog screens
frontend/src/screen/HomeScreen.js - Product details
frontend/src/screen/ProductScreen.js - Cart and checkout
frontend/src/screen/CartScreen.js - Order placement
frontend/src/screen/PlaceOrderScreen.js - Redux actions and state
frontend/src/redux/store.js
Backend API
- Express server
server.js - Product routes
backened/routes/productRoutes.js - Order routes
backened/routes/OrderRoutes.js - User routes
backened/routes/userRouter.js - Product operations
backened/controllers/productController.js - Order operations
backened/controllers/orderController.js - Account operations
backened/controllers/userController.js - Authentication checks
backened/middleware/authMiddleware.js
Commerce data
- Product records
backened/models/productsModel.js - Order records
backened/models/orderModel.js - User records
backened/models/userModel.js
Payments and uploads
- Stripe payment
backened/controllers/stripePaymentController.js - Stripe checkout UI
frontend/src/components/StripeCheckout.js - PayPal checkout UI
frontend/src/components/PayPalCheckout.js - PayPal service
- Local image upload
backened/routes/uploadRoutes.js - Upload client
frontend/src/imageUpload/multerStorage.js - Firebase image storage
frontend/src/imageUpload/firebaseStorage.js - Firebase Storage
Account and offline
- Profile and admin screens
frontend/src/screen/ProfileScreen.js - Offline service worker
frontend/public/serviceworker.js
Other components
- Shopper or admin
Connections 35
- Shopper or admin → App routes: uses
- App routes → Catalog screens: routes to
- App routes → Product details: routes to
- App routes → Cart and checkout: routes to
- App routes → Order placement: routes to
- App routes → Profile and admin screens: routes to
- App routes → Redux actions and state: checks auth
- Catalog screens → Redux actions and state: dispatches
- Product details → Redux actions and state: dispatches
- Cart and checkout → Redux actions and state: dispatches
- Order placement → Redux actions and state: dispatches
- Profile and admin screens → Redux actions and state: dispatches
- Redux actions and state → Express server: API requests
- Express server → Product routes: mounts
- Express server → Order routes: mounts
- Express server → User routes: mounts
- Product routes → Product operations: dispatches
- Order routes → Order operations: dispatches
- User routes → Account operations: dispatches
- Product routes → Authentication checks: guards
- Order routes → Authentication checks: guards
- User routes → Authentication checks: guards
- Product operations → Product records: reads and writes
- Order operations → Order records: reads and writes
- Account operations → User records: reads and writes
- Stripe checkout UI → Express server: requests payment
- Express server → Stripe payment: mounts payment route
- Stripe payment → Order records: updates payment
- PayPal checkout UI → PayPal service: processes payment
- Order placement → Order routes: submits order
- Profile and admin screens → Order routes: loads orders
- Upload client → Local image upload: uploads image
- Express server → Local image upload: mounts
- Firebase image storage → Firebase Storage: uploads image
- App routes → Offline service worker: registers offline support