How letslearndevops9/online_shop works
Online Shop is a React storefront for browsing products, managing a cart, and checking out, with an admin area for product management and a dark/light theme. The principal flow is catalog browsing and filtering, adding products to the cart, then proceeding through checkout. The graph also includes product data, shared state, and navigation. Some component relationships are supported by the SOURCE INDEX or README rather than full excerpts; those limits are reflected in the evidence citations.
Main entry points: App.jsx App Routes · ShoppingCartContext.jsx Cart State · Store.jsx Store Page · ShoppingItemsContext.jsx Product State
Components 21
Application Shell
- App Routes
src/App.jsx - Navigation
src/components/Navbar.jsx - Footer
src/components/Footer.jsx
Product Catalog
- Store Page
src/pages/Store.jsx - Search and Filters
src/components/SearchBar.jsx - Product Listing
src/components/Store.jsx - Product Details
src/components/StoreItem.jsx - Generated Products
src/data/productData.js - Product State
src/context/ShoppingItemsContext.jsx - Demo Products
src/data/demoProducts.js
Cart and Checkout
- Shopping Cart
src/components/ShoppingCart.jsx - Cart Item
src/components/CartItem.jsx - Cart State
src/context/ShoppingCartContext.jsx - Checkout
src/pages/Checkout.jsx - Checkout Modal
src/components/Modals/CheckoutModal.jsx - Currency Formatting
src/utilities/formatCurrency.js
Management and Theme
- Theme State
src/context/ThemeContext.jsx - Theme Toggle
src/components/ThemeToggle.jsx - Admin Dashboard
src/pages/Admin.jsx - Product Modals
src/components/Modals
Other components
- Shopper
Connections 33
- Shopper → App Routes: opens shop
README.md - App Routes → Navigation: renders
src/App.jsx - App Routes → Store Page: routes to
src/App.jsx - App Routes → Admin Dashboard: routes to
src/App.jsx - App Routes → Checkout: routes to
src/App.jsx - App Routes → Footer: renders
src/App.jsx - App Routes → Theme State: provides state
src/App.jsx - App Routes → Product State: provides state
src/App.jsx - App Routes → Cart State: provides state
src/App.jsx - Navigation → Theme Toggle: renders
src/components/Navbar.jsx - Theme Toggle → Theme State: toggles
src/components/ThemeToggle.jsx - Store Page → Search and Filters: renders
src/pages/Store.jsx - Store Page → Product Listing: renders
src/pages/Store.jsx - Store Page → Product State: reads products
src/pages/Store.jsx - Product Listing → Product State: reads products
src/components/Store.jsx - Product Listing → Product Details: renders
src/components/Store.jsx - Search and Filters → Store Page: reports filters
src/components/SearchBar.jsx - Product State → Demo Products: loads products
src/context/ShoppingItemsContext.jsx - Demo Products → Generated Products: imports data
src/data/demoProducts.js - Product Details → Cart State: adds item
src/components/StoreItem.jsx - Product Details → Currency Formatting: formats price
src/components/StoreItem.jsx - Navigation → Cart State: reads cart
src/components/Navbar.jsx - Shopping Cart → Cart State: reads and updates
src/components/ShoppingCart.jsx - Shopping Cart → Cart Item: renders
src/components/ShoppingCart.jsx - Cart Item → Cart State: updates quantity
src/components/CartItem.jsx - Cart Item → Currency Formatting: formats price
src/components/CartItem.jsx - Shopping Cart → Checkout Modal: opens checkout
src/components/ShoppingCart.jsx - Checkout Modal → Cart State: reads and clears
src/components/Modals/CheckoutModal.jsx - Checkout → Cart State: clears cart
src/pages/Checkout.jsx - Checkout → Currency Formatting: formats totals
src/pages/Checkout.jsx - Admin Dashboard → Product State: manages products
src/pages/Admin.jsx - Admin Dashboard → Currency Formatting: formats prices
src/pages/Admin.jsx - Admin Dashboard → Product Modals: uses dialogs