How sabi0603/amazon-frontend-clone works
This is a React storefront clone whose main journey is browse or search products, inspect an item, add it to the cart, complete checkout, and view order confirmation. Routing and shared providers form the application shell; product data is local, while cart, wishlist, authentication, and order state are managed in contexts with browser storage. The graph preserves the README’s additional account, deals, theme, and informational-page capabilities. Some page implementations were not sampled, so their presence and route wiring rely on the route index and README rather than inspected page internals.
Main entry points: index.jsx Route table · App.jsx App providers · CartProvider.jsx Cart state · ProductDetails.jsx Product details
Components 28
Application shell
- React entry
src/main.jsx - App providers
src/App.jsx - Route table
src/routes/index.jsx - Store layout
src/components/layout/AppLayout.jsx - Navigation header
src/components/layout/Header.jsx - Browser storage
src/utils/storage.js
Product discovery
- Catalog and deals
src/pages - Product catalog data
src/data/products.js - Product service
src/services/productService.js - Product query hooks
src/hooks - Search results
src/pages/SearchResults.jsx - Product details
src/pages/ProductDetails.jsx - Product components
src/components/product
Shopping and orders
- Cart page
src/pages/Cart.jsx - Checkout flow
src/pages/Checkout.jsx - Order confirmation
src/pages/OrderConfirmation.jsx - Cart state
src/context/CartProvider.jsx - Order state
src/context/OrderProvider.jsx - Checkout helper
src/utils/checkout.js
Account and preferences
- Sign-in and profile
src/pages - Authentication state
src/context/AuthProvider.jsx - Protected access
src/components/common/ProtectedRoute.jsx - Wishlist
src/pages/Wishlist.jsx - Wishlist state
src/context/WishlistProvider.jsx - Theme state
src/context/ThemeProvider.jsx
Storefront services
- Store information pages
src/pages - Shared UI states
src/components/ui
Other components
- Shopper
Connections 43
- Shopper → Route table: opens store
README.md - React entry → App providers: renders
src/main.jsx - App providers → Route table: provides routes
src/App.jsx - App providers → Authentication state: wraps
src/App.jsx - App providers → Cart state: wraps
src/App.jsx - App providers → Order state: wraps
src/App.jsx - App providers → Wishlist state: wraps
src/App.jsx - App providers → Theme state: wraps
src/App.jsx - Route table → Store layout: routes through
src/routes/index.jsx - Route table → Catalog and deals: routes to
src/routes/index.jsx - Route table → Search results: routes to
src/routes/index.jsx - Route table → Product details: routes to
src/routes/index.jsx - Route table → Cart page: routes to
src/routes/index.jsx - Route table → Checkout flow: routes to
src/routes/index.jsx - Route table → Order confirmation: routes to
src/routes/index.jsx - Route table → Sign-in and profile: routes to
src/routes/index.jsx - Route table → Wishlist: routes to
src/routes/index.jsx - Route table → Store information pages: routes to
src/routes/index.jsx - Store layout → Navigation header: renders
src/components/layout/AppLayout.jsx - Search results → Product query hooks: queries through
src/pages/SearchResults.jsx - Search results → Product components: renders cards
src/pages/SearchResults.jsx - Search results → Shared UI states: renders states
src/pages/SearchResults.jsx - Product query hooks → Product service: calls search
src/hooks/useSearchProducts.js - Product query hooks → Product service: loads products
src/hooks/useProducts.js - Product service → Product catalog data: reads catalog
src/services/productService.js - Product details → Product query hooks: loads item
src/pages/ProductDetails.jsx - Product details → Product components: renders gallery
src/pages/ProductDetails.jsx - Product details → Cart state: adds item
src/pages/ProductDetails.jsx - Product details → Wishlist state: toggles item
src/pages/ProductDetails.jsx - Cart page → Cart state: uses cart
- Checkout flow → Cart state: uses cart
- Checkout flow → Checkout helper: uses helper
- Checkout flow → Order state: creates order
- Order confirmation → Order state: reads order
- Sign-in and profile → Authentication state: uses account state
- Protected access → Authentication state: checks identity
src/components/common/ProtectedRoute.jsx - Wishlist → Wishlist state: uses wishlist
- Authentication state → Browser storage: persists auth
src/context/AuthProvider.jsx - Cart state → Browser storage: persists cart
src/context/CartProvider.jsx - Order state → Browser storage: persists order
src/context/OrderProvider.jsx - Wishlist state → Browser storage: persists wishlist
src/context/WishlistProvider.jsx - Navigation header → Cart state: reads cart
src/components/layout/Header.jsx - Navigation header → Authentication state: reads account
src/components/layout/Header.jsx