How md-suhail07-code/durable-sofa works
Durable Sofa is a furniture e-commerce application. Customers discover products, authenticate, manage a cart and delivery addresses, pay for orders, and review order history; admins manage products, users, orders, and sales. The graph separates the React experience, Express routing and security, domain controllers, persistence, and external services. README documents the broad frontend-to-API workflow and major unsampled capabilities; source-index references and excerpts support the specific backend routing and controller-to-model links shown.
Main entry points: App.jsx React application · server.js Express API server · isAuthenticated.js JWT and admin guards · db.js MongoDB
Components 28
Customer and admin UI
- React application
Frontend/src/App.jsx - Global state
Frontend/src/redux - Sign-in and verification
Frontend/src/pages/Signup.jsx - Catalog and product detail
Frontend/src/pages/Products.jsx - Cart and checkout
Frontend/src/pages/Cart.jsx - Delivery addresses
Frontend/src/pages/AddressForm.jsx - Order history
Frontend/src/pages/Orders.jsx - Profile management
Frontend/src/pages/Profile.jsx - Admin dashboard
Frontend/src/pages/admin
API and security
- Express API server
Backend/server.js - Identity routes
Backend/Routes/authRoute.js - User routes
Backend/Routes/userRoute.js - Product routes
Backend/Routes/productRoute.js - Cart routes
Backend/Routes/cartRoute.js - Address routes
Backend/Routes/addressRoute.js - Order routes
Backend/Routes/orderRoute.js - JWT and admin guards
Backend/middleware/isAuthenticated.js
Commerce services
- Identity and profile
Backend/Controllers/userController.js - Catalog management
Backend/Controllers/productController.js - Cart management
Backend/Controllers/cartController.js - Address management
Backend/Controllers/addressController.js - Order and payment
Backend/Controllers/orderController.js
Persistent data
- MongoDB
Backend/Database/db.js
External services
- Email delivery
Backend/emailVerify - Cloudinary media
Backend/utils/cloudinary.js - Razorpay
Backend/config/razorpay.js - Google OAuth
Backend/config/passport.js
Other components
- Shopper or admin
Connections 39
- Shopper or admin → React application: uses
- React application → Global state: manages state
Frontend/src/main.jsx - React application → Sign-in and verification: routes to
Frontend/src/App.jsx - React application → Catalog and product detail: routes to
Frontend/src/App.jsx - React application → Cart and checkout: routes to
Frontend/src/App.jsx - React application → Delivery addresses: routes to
Frontend/src/App.jsx - React application → Order history: routes to
Frontend/src/App.jsx - React application → Profile management: routes to
Frontend/src/App.jsx - React application → Admin dashboard: routes to
Frontend/src/App.jsx - React application → Express API server: calls API
- Express API server → MongoDB: connects
Backend/server.js - Express API server → Identity routes: mounts
Backend/server.js - Express API server → User routes: mounts
Backend/server.js - Express API server → Product routes: mounts
Backend/server.js - Express API server → Cart routes: mounts
Backend/server.js - Express API server → Address routes: mounts
Backend/server.js - Express API server → Order routes: mounts
Backend/server.js - Identity routes → JWT and admin guards: guards identity
Backend/Routes/authRoute.js - Identity routes → Google OAuth: authenticates with
Backend/Routes/authRoute.js - User routes → Identity and profile: dispatches to
Backend/Routes/userRoute.js - Product routes → Catalog management: dispatches to
Backend/Routes/productRoute.js - Cart routes → Cart management: dispatches to
Backend/Routes/cartRoute.js - Address routes → Address management: dispatches to
Backend/Routes/addressRoute.js - Order routes → Order and payment: dispatches to
Backend/Routes/orderRoute.js - Product routes → JWT and admin guards: guards routes
Backend/Routes/productRoute.js - User routes → JWT and admin guards: guards routes
Backend/Routes/userRoute.js - Cart routes → JWT and admin guards: guards routes
Backend/Routes/cartRoute.js - Address routes → JWT and admin guards: guards routes
Backend/Routes/addressRoute.js - Order routes → JWT and admin guards: guards routes
Backend/Routes/orderRoute.js - Identity and profile → MongoDB: reads and writes
Backend/Controllers/userController.js - Catalog management → MongoDB: reads and writes
Backend/Controllers/productController.js - Cart management → MongoDB: reads and writes
Backend/Controllers/cartController.js - Address management → MongoDB: reads and writes
Backend/Controllers/addressController.js - Order and payment → MongoDB: reads and writes
Backend/Controllers/orderController.js - Identity and profile → Email delivery: sends verification and OTP
Backend/Controllers/userController.js - Catalog management → Cloudinary media: uploads product images
Backend/Controllers/productController.js - Identity and profile → Cloudinary media: manages profile images
Backend/Controllers/userController.js - Order and payment → Razorpay: creates payment order
Backend/Controllers/orderController.js - Order and payment → Cart management: clears cart
Backend/Controllers/orderController.js