How devkaushik2112/e--fash works
E-Fash is a fashion e-commerce application: customers browse and review products, manage a cart or wishlist, check out, and track orders; administrators manage inventory and orders. The frontend routes pages and keeps client state in Redux slices, which call the Express API; backend controllers use Mongoose models for persistent product, user, and order data. The README documents the major capabilities and API, while source excerpts confirm key routing, state, and controller behavior. Some page-to-API and route-to-controller details are documented or indexed rather than shown in excerpts.
Main entry points: app.js Express API routing · App.tsx App routing · User.js User records · ProductDetail.tsx Product detail
Components 25
Customer storefront
- App routing
frontend/src/App.tsx - Product discovery
frontend/src/pages/Products.tsx - Product detail
frontend/src/pages/ProductDetail.tsx - Cart and checkout
frontend/src/pages/Checkout.tsx - Orders and profile
frontend/src/pages/Orders.tsx - Admin workspace
frontend/src/pages/AdminProducts.tsx
Client state and experience
- Authentication state
frontend/src/store/slices/authSlice.ts - Product state
frontend/src/store/slices/productSlice.ts - Cart state
frontend/src/store/slices/cartSlice.ts - Wishlist state
frontend/src/store/slices/wishlistSlice.ts - Checkout state
frontend/src/store/slices/checkoutSlice.ts - Theme and language
frontend/src/contexts/ThemeContext.tsx
Backend API
- Express API routing
backend/app.js - Authentication
backend/controllers/authController.js - Catalog and reviews
backend/controllers/productController.js - Cart operations
backend/controllers/cartController.js - Wishlist operations
backend/controllers/wishlistController.js - Order operations
backend/controllers/orderController.js - User profile
backend/controllers/userController.js - Admin operations
backend/controllers/adminController.js - JWT authorization
backend/middleware/auth.js
Commerce data
- Product records
backend/models/Product.js - User records
backend/models/User.js - Order records
backend/models/Order.js
Other components
- Customer
Connections 45
- Customer → App routing: uses
README.md - App routing → Product discovery: routes to
frontend/src/App.tsx - App routing → Product detail: routes to
frontend/src/App.tsx - App routing → Cart and checkout: routes to
frontend/src/App.tsx - App routing → Orders and profile: routes to
frontend/src/App.tsx - App routing → Admin workspace: routes to
frontend/src/App.tsx - App routing → Authentication state: loads session
frontend/src/App.tsx - App routing → Cart state: loads cart
frontend/src/App.tsx - App routing → Wishlist state: loads wishlist
frontend/src/App.tsx - Product detail → Product state: dispatches
frontend/src/pages/ProductDetail.tsx - Product detail → Cart state: dispatches
frontend/src/pages/ProductDetail.tsx - Product detail → Wishlist state: dispatches
frontend/src/pages/ProductDetail.tsx - Product detail → Checkout state: dispatches
frontend/src/pages/ProductDetail.tsx - Cart and checkout → Cart state: uses
- Cart and checkout → Checkout state: uses
frontend/src/pages/Checkout.tsx - Authentication state → Express API routing: calls auth API
frontend/src/store/slices/authSlice.ts - Cart state → Express API routing: calls cart API
frontend/src/store/slices/cartSlice.ts - Product discovery → Product state: uses
- Product state → Express API routing: calls catalog API
- Wishlist state → Express API routing: calls wishlist API
- Checkout state → Express API routing: submits orders
- Orders and profile → Express API routing: requests orders
- Admin workspace → Express API routing: requests admin API
- Theme and language → Customer: localizes display
- Express API routing → Authentication: mounts auth routes
backend/app.js - Express API routing → Catalog and reviews: mounts catalog routes
backend/app.js - Express API routing → Cart operations: mounts cart routes
backend/app.js - Express API routing → Wishlist operations: mounts wishlist routes
backend/app.js - Express API routing → Order operations: mounts order routes
backend/app.js - Express API routing → User profile: mounts user routes
backend/app.js - Express API routing → Admin operations: mounts admin routes
backend/app.js - Authentication → User records: reads and writes
backend/controllers/authController.js - Cart operations → User records: updates cart
backend/controllers/cartController.js - Cart operations → Product records: looks up products
backend/controllers/cartController.js - Catalog and reviews → Product records: reads and writes
backend/controllers/productController.js - Wishlist operations → User records: updates wishlist
backend/controllers/wishlistController.js - Wishlist operations → Product records: looks up products
backend/controllers/wishlistController.js - Order operations → Order records: creates and reads
backend/controllers/orderController.js - Order operations → Product records: checks stock
backend/controllers/orderController.js - Order operations → User records: clears cart
backend/controllers/orderController.js - Admin operations → Product records: manages inventory
backend/controllers/adminController.js - Admin operations → User records: counts users
backend/controllers/adminController.js - Admin operations → Order records: reads order metrics
backend/controllers/adminController.js - JWT authorization → User records: loads identity
backend/middleware/auth.js - JWT authorization → Admin operations: protects admin routes
backend/routes/adminRoutes.js