How sudharshank-git/react-day4 works
Minion is a small e-commerce storefront with an Express API. The main shopper flow is routed through the React app to the home page, where category and product views fetch product data and render cards; the backend validates requests and reads or changes database records. Registration and login are a separate API workflow, while cart and wishlist pages are present in the client. The README is empty, so capability coverage comes from the source tree and available excerpts; some unsampled connections are left out.
Main entry points: Route.jsx Page Router · Home.jsx Home Page · authController.js Auth Controller · productController.js Product Controller
Components 25
Storefront
- Page Router
client/src/Routing/Route.jsx - Home Page
client/src/Pages/Home.jsx - Store Header
client/src/Components/Header.jsx - Category List
client/src/Components/CategoryList.jsx - Product List
client/src/Components/ProductList.jsx - Product Card
client/src/Components/ProductCard.jsx - Product Fetch Hook
client/src/hooks/useProducts.js - Login Page
client/src/Pages/Login.jsx - Cart Page
client/src/Pages/Cart.jsx - Wishlist Page
client/src/Pages/Wishlist.jsx - Dashboard Page
client/src/Pages/Dashboard.jsx
API Runtime
- Express App
backend/app.js - PostgreSQL
backend/db.js - Request Validator
backend/utils/validate.js - HTTP Error
backend/utils/httpError.js - Error Handler
backend/middlewares/errorHandler.js
Authentication
- Auth Routes
backend/routes/authRoute.js - Auth Controller
backend/controllers/authController.js - Auth Schemas
backend/schemas/authSchema.js - Auth Model
backend/models/authModel.js
Product Catalog
- Product Routes
backend/routes/productRoute.js - Product Controller
backend/controllers/productController.js - Product Schemas
backend/schemas/productSchema.js - Product Model
backend/models/productModel.js
Other components
- Shopper
Connections 28
- Shopper → Page Router: uses storefront
client/src/Routing/Route.jsx - Page Router → Home Page: routes to
client/src/Routing/Route.jsx - Page Router → Login Page: routes to
client/src/Routing/Route.jsx - Page Router → Cart Page: guards route
client/src/Routing/Route.jsx - Page Router → Wishlist Page: routes to
client/src/Routing/Route.jsx - Page Router → Dashboard Page: guards route
client/src/Routing/Route.jsx - Home Page → Store Header: renders
client/src/Pages/Home.jsx - Home Page → Category List: renders
client/src/Pages/Home.jsx - Home Page → Product List: renders
client/src/Pages/Home.jsx - Store Header → Shopper: accepts search
- Category List → Product Fetch Hook: fetches products
client/src/Components/CategoryList.jsx - Product List → Product Fetch Hook: fetches products
client/src/Components/ProductList.jsx - Product List → Product Card: renders
client/src/Components/ProductList.jsx - Product Fetch Hook → Product Routes: requests products
- Express App → Auth Routes: mounts at auth
backend/app.js - Express App → Product Routes: mounts at products
backend/app.js - Express App → Error Handler: handles errors
backend/app.js - Auth Routes → Auth Controller: dispatches to
backend/routes/authRoute.js - Auth Controller → Auth Schemas: validates with
backend/controllers/authController.js - Auth Controller → Request Validator: validates input
backend/controllers/authController.js - Auth Controller → Auth Model: reads and creates
backend/controllers/authController.js - Auth Model → PostgreSQL: queries
backend/models/authModel.js - Product Routes → Product Controller: dispatches to
backend/routes/productRoute.js - Product Controller → Product Schemas: validates with
backend/controllers/productController.js - Product Controller → Request Validator: validates input
backend/controllers/productController.js - Product Controller → Product Model: reads and writes
backend/controllers/productController.js - Product Model → PostgreSQL: queries
backend/models/productModel.js - Request Validator → HTTP Error: throws
backend/utils/validate.js