How abbaskhudayer/setuplab works
SetupLab is a full-stack computer-hardware e-commerce application. A shopper browses and filters products, views details, manages favorites and a persistent cart, then submits customer and payment details to place an order and view confirmation. Users can also register and log in. The graph combines the documented product capabilities with source-index relationships; some backend and checkout links are supported by the README rather than sampled call sites, so those edges cite the README.
Main entry points: AppRoutes.jsx Page Routing · CheckoutPage.jsx Checkout Page · server.js Express Server · ProductsPage.jsx Product Catalog
Components 34
Storefront
- Page Routing
setuplab-frontend/src/routes/AppRoutes.jsx - Home Page
setuplab-frontend/src/pages/HomePage/HomePage.jsx - Product Catalog
setuplab-frontend/src/pages/ProductsPage/ProductsPage.jsx - Category Filter
setuplab-frontend/src/components/CategoryFilter/CategoryFilter.jsx - Product Details
setuplab-frontend/src/pages/ProductDetailsPage/ProductDetailsPage.jsx - Product Service
setuplab-frontend/src/services/productService.js - Product List
setuplab-frontend/src/components/ProductList/ProductList.jsx - Product Card
setuplab-frontend/src/components/ProductCard/ProductCard.jsx - Favorites Page
setuplab-frontend/src/pages/FavoritesPage/FavoritesPage.jsx - Cart Page
setuplab-frontend/src/pages/CartPage/CartPage.jsx - Cart Item
setuplab-frontend/src/components/CartItem/CartItem.jsx - Checkout Page
setuplab-frontend/src/pages/CheckoutPage/CheckoutPage.jsx - Checkout Form
setuplab-frontend/src/components/CheckoutForm/CheckoutForm.jsx - Order Service
setuplab-frontend/src/services/orderService.js - Order Confirmation
setuplab-frontend/src/pages/ConfirmationPage/ConfirmationPage.jsx
Shopper State
- Favorites State
setuplab-frontend/src/context/FavoritesContext.jsx - Cart State
setuplab-frontend/src/context/CartContext.jsx
Identity
- Login and Register
setuplab-frontend/src/pages/LoginRegisterPage/LoginRegisterPage.jsx - Authentication State
setuplab-frontend/src/context/AuthContext.jsx - Auth Service
setuplab-frontend/src/services/authService.js
Backend API
- HTTP Client
setuplab-frontend/src/api/apiClient.js - Express Server
setuplab-backend/server.js - Product Routes
setuplab-backend/routes/productRoutes.js - Product Controller
setuplab-backend/controllers/productController.js - Product Model
setuplab-backend/models/productModel.js - User Routes
setuplab-backend/routes/userRoutes.js - User Controller
setuplab-backend/controllers/userController.js - User Model
setuplab-backend/models/userModel.js - Token Validation
setuplab-backend/middleware/validateTokenHandler.js - Order Routes
setuplab-backend/routes/orderRoutes.js - Order Controller
setuplab-backend/controllers/orderController.js - Order Model
setuplab-backend/models/orderModel.js - Database Connection
setuplab-backend/config/dbConnection.js
Other components
- Shopper
Connections 43
- Shopper → Page Routing: visits pages
setuplab-frontend/src/routes/AppRoutes.jsx - Page Routing → Home Page: routes to
setuplab-frontend/src/routes/AppRoutes.jsx - Page Routing → Product Catalog: routes to
setuplab-frontend/src/routes/AppRoutes.jsx - Page Routing → Product Details: routes to
setuplab-frontend/src/routes/AppRoutes.jsx - Page Routing → Favorites Page: routes to
setuplab-frontend/src/routes/AppRoutes.jsx - Page Routing → Cart Page: routes to
setuplab-frontend/src/routes/AppRoutes.jsx - Page Routing → Checkout Page: routes to
setuplab-frontend/src/routes/AppRoutes.jsx - Page Routing → Order Confirmation: routes to
setuplab-frontend/src/routes/AppRoutes.jsx - Page Routing → Login and Register: routes to
setuplab-frontend/src/routes/AppRoutes.jsx - Home Page → Product Service: fetches products
setuplab-frontend/src/pages/HomePage/HomePage.jsx - Product Catalog → Product Service: fetches products
setuplab-frontend/src/pages/ProductsPage/ProductsPage.jsx - Product Details → Product Service: fetches product
setuplab-frontend/src/pages/ProductDetailsPage/ProductDetailsPage.jsx - Product Catalog → Category Filter: renders filter
setuplab-frontend/src/pages/ProductsPage/ProductsPage.jsx - Product Catalog → Product List: renders products
setuplab-frontend/src/pages/ProductsPage/ProductsPage.jsx - Home Page → Product List: renders products
setuplab-frontend/src/pages/HomePage/HomePage.jsx - Favorites Page → Product List: renders favorites
setuplab-frontend/src/pages/FavoritesPage/FavoritesPage.jsx - Product List → Product Card: renders cards
- Product Card → Cart State: updates cart
setuplab-frontend/src/components/ProductCard/ProductCard.jsx - Product Card → Favorites State: updates favorites
setuplab-frontend/src/components/ProductCard/ProductCard.jsx - Favorites Page → Favorites State: reads favorites
setuplab-frontend/src/pages/FavoritesPage/FavoritesPage.jsx - Cart Page → Cart State: reads cart
setuplab-frontend/src/pages/CartPage/CartPage.jsx - Cart Page → Cart Item: renders items
setuplab-frontend/src/pages/CartPage/CartPage.jsx - Checkout Page → Cart State: reads cart
setuplab-frontend/src/pages/CheckoutPage/CheckoutPage.jsx - Checkout Page → Checkout Form: renders form
setuplab-frontend/src/pages/CheckoutPage/CheckoutPage.jsx - Checkout Page → Order Service: submits order
setuplab-frontend/src/pages/CheckoutPage/CheckoutPage.jsx - Checkout Page → Order Confirmation: shows success
README.md - Login and Register → Authentication State: invokes auth
setuplab-frontend/src/pages/LoginRegisterPage/LoginRegisterPage.jsx - Authentication State → Auth Service: calls auth
setuplab-frontend/src/context/AuthContext.jsx - Auth Service → HTTP Client: sends requests
setuplab-frontend/src/services/authService.js - Product Service → HTTP Client: sends requests
setuplab-frontend/src/services/productService.js - Order Service → HTTP Client: sends requests
- HTTP Client → Express Server: HTTP requests
setuplab-frontend/src/api/apiClient.js - Express Server → Product Routes: mounts routes
setuplab-backend/server.js - Express Server → User Routes: mounts routes
setuplab-backend/server.js - Express Server → Order Routes: mounts routes
setuplab-backend/server.js - Product Routes → Product Controller: dispatches to
setuplab-backend/routes/productRoutes.js - Product Controller → Product Model: queries model
setuplab-backend/controllers/productController.js - User Routes → User Controller: dispatches to
setuplab-backend/routes/userRoutes.js - User Routes → Token Validation: validates token
setuplab-backend/routes/userRoutes.js - User Controller → User Model: queries model
setuplab-backend/controllers/userController.js - Order Routes → Order Controller: dispatches to
setuplab-backend/routes/orderRoutes.js - Order Controller → Order Model: creates orders
setuplab-backend/controllers/orderController.js - Express Server → Database Connection: connects database
setuplab-backend/server.js