How sohantayyab/hubly works
Hubly is a client-side storefront for browsing products, viewing details, saving favorites, and managing a cart. The main journey runs from the home catalog through product details and cart actions; a cart drawer provides a demo checkout that clears the cart rather than processing a real order. Catalog and detail pages retrieve product data through a fetch hook, while cart and wishlist state persist in browser localStorage. The README describes only the Vite/React template, so product capabilities are inferred from the source excerpts and index; unsampled page behavior and integrations are not expanded beyond supported links.
Main entry points: App.jsx App routing · ProductDetails.jsx Product details · ProductCard.jsx Product card · CartContext.jsx Cart state
Components 25
Storefront experience
- App routing
src/App.jsx - Cart page
src/pages/Cart.jsx - Wishlist page
src/pages/Wishlist.jsx - Not found
src/pages/NotFound.jsx - Cart drawer
src/components/CartDrawer.jsx - Navigation bar
src/components/Navbar.jsx
Product discovery
- Home catalog
src/pages/Home.jsx - Product details
src/pages/ProductDetails.jsx - Fetch hook
src/hooks/useFetch.js - API base URL
src/lib/api.js - Product card
src/components/ProductCard.jsx
Customer state
- Cart state
src/context/CartContext.jsx - Wishlist state
src/context/WishlistContext.jsx - Toast state
src/context/ToastContext.jsx - Provider setup
src/main.jsx
Shared UI and utilities
- Background
src/components/Background.jsx - Footer
src/components/Footer.jsx - Brand logo
src/components/Logo.jsx - Icon set
src/components/Icon.jsx - Rating display
src/components/Rating.jsx - Error display
src/components/ErrorMessage.jsx - Product skeleton
src/components/ProductSkeleton.jsx - Display utilities
src/lib/utils.js
Other components
- Shopper
- Product API
Connections 48
- Shopper → App routing: uses storefront
- App routing → Home catalog: routes to
src/App.jsx - App routing → Product details: routes to
src/App.jsx - App routing → Cart page: routes to
src/App.jsx - App routing → Wishlist page: routes to
src/App.jsx - App routing → Not found: routes to
src/App.jsx - App routing → Navigation bar: renders
src/App.jsx - App routing → Cart drawer: renders
src/App.jsx - App routing → Footer: renders
src/App.jsx - App routing → Background: renders
src/App.jsx - Home catalog → Fetch hook: requests data
src/pages/Home.jsx - Home catalog → API base URL: uses base URL
src/pages/Home.jsx - Product details → Fetch hook: requests data
src/pages/ProductDetails.jsx - Product details → API base URL: uses base URL
src/pages/ProductDetails.jsx - Fetch hook → Product API: fetches products
src/hooks/useFetch.js - Home catalog → Product card: renders products
src/pages/Home.jsx - Product details → Product card: renders related
src/pages/ProductDetails.jsx - Home catalog → Error display: renders errors
src/pages/Home.jsx - Product details → Error display: renders errors
src/pages/ProductDetails.jsx - Home catalog → Product skeleton: renders loading
src/pages/Home.jsx - Product details → Rating display: renders ratings
src/pages/ProductDetails.jsx - Product card → Cart state: adds items
src/components/ProductCard.jsx - Product card → Wishlist state: toggles favorite
src/components/ProductCard.jsx - Product details → Cart state: adds items
src/pages/ProductDetails.jsx - Product details → Wishlist state: toggles favorite
src/pages/ProductDetails.jsx - Cart page → Cart state: reads and updates
src/pages/Cart.jsx - Wishlist page → Wishlist state: reads favorites
src/pages/Wishlist.jsx - Wishlist page → Product card: renders favorites
src/pages/Wishlist.jsx - Cart drawer → Cart state: reads and updates
src/components/CartDrawer.jsx - Cart drawer → Toast state: shows checkout toast
src/components/CartDrawer.jsx - Cart state → Toast state: shows cart notices
src/context/CartContext.jsx - Wishlist state → Toast state: shows favorite notices
src/context/WishlistContext.jsx - Navigation bar → Cart state: reads cart count
src/components/Navbar.jsx - Navigation bar → Wishlist state: reads favorite count
src/components/Navbar.jsx - Provider setup → App routing: mounts
src/main.jsx - Provider setup → Cart state: provides state
src/main.jsx - Provider setup → Wishlist state: provides state
src/main.jsx - Provider setup → Toast state: provides state
src/main.jsx - Footer → Brand logo: renders
src/components/Footer.jsx - Navigation bar → Brand logo: renders
src/components/Navbar.jsx - Product card → Rating display: renders
src/components/ProductCard.jsx - Product card → Display utilities: formats display
src/components/ProductCard.jsx - Product details → Display utilities: formats display
src/pages/ProductDetails.jsx - Cart page → Display utilities: formats display
src/pages/Cart.jsx - Cart drawer → Display utilities: formats display
src/components/CartDrawer.jsx - Product card → Icon set: renders controls
src/components/ProductCard.jsx - Product details → Icon set: renders controls
src/pages/ProductDetails.jsx - Cart drawer → Icon set: renders controls
src/components/CartDrawer.jsx