How councicroff-commits/cc-main works
This is a React storefront with account management and an e-commerce flow: visitors browse and inspect products, add items to a cart, proceed through checkout, and view orders. The router selects public and protected pages; shared contexts hold authentication, product, cart, checkout, and order state. Product and account contexts make API requests, while cart context also handles cart-related requests. The source excerpts show only part of the routing and context behavior, so unsampled page links are included only where the SOURCE INDEX or excerpts name them; no payment provider or persistent order backend is inferred.
Main entry points: AppRouter.tsx Route selection · main.tsx App setup · CartContext.tsx Cart state · CheckoutPage.tsx Checkout
Components 18
App navigation
- App setup
src/main.tsx - Route selection
src/router/AppRouter.tsx - Access guard
src/router/ProtectedRoute.tsx - Store layout
src/components/layout/Navbar.tsx
Storefront
- Home storefront
src/pages/Home.tsx - Product catalog
src/components/product/ProductGrid.tsx - Product detail
src/pages/ProductDetail.tsx - Cart
src/pages/CartPage.tsx - Checkout
src/pages/CheckoutPage.tsx - Order views
src/pages/OrderPage.tsx
Commerce state
- Product state
src/context/ProductContext.tsx - Cart state
src/context/CartContext.tsx - Checkout state
src/context/CheckoutContext.tsx - Order state
src/context/OrderContext.tsx
Account
- Sign-in and profile
src/pages/LoginPage.tsx - Authentication
src/context/AuthContext.tsx
Other components
- Shopper
- Application API
Connections 29
- Shopper → Route selection: browses
src/router/AppRouter.tsx - App setup → Route selection: renders
- App setup → Authentication: provides
src/main.tsx - App setup → Product state: provides
src/main.tsx - App setup → Cart state: provides
src/main.tsx - App setup → Checkout state: provides
src/main.tsx - App setup → Order state: provides
src/main.tsx - Route selection → Store layout: renders
src/router/AppRouter.tsx - Route selection → Home storefront: routes
src/router/AppRouter.tsx - Route selection → Product catalog: routes
src/router/AppRouter.tsx - Route selection → Product detail: routes
src/router/AppRouter.tsx - Route selection → Access guard: guards
src/router/AppRouter.tsx - Access guard → Authentication: checks
src/router/ProtectedRoute.tsx - Route selection → Cart: routes
src/router/AppRouter.tsx - Route selection → Checkout: routes
src/router/AppRouter.tsx - Route selection → Order views: routes
src/router/AppRouter.tsx - Route selection → Sign-in and profile: routes
src/router/AppRouter.tsx - Product detail → Product state: fetches product
src/pages/ProductDetail.tsx - Product detail → Cart state: adds items
src/pages/ProductDetail.tsx - Cart → Cart state: uses cart
src/pages/CartPage.tsx - Checkout → Cart state: uses cart
src/pages/CheckoutPage.tsx - Checkout → Checkout state: uses checkout
src/pages/CheckoutPage.tsx - Checkout → Order state: uses orders
src/pages/CheckoutPage.tsx - Order views → Order state: uses orders
- Store layout → Cart state: reads count
src/components/layout/Navbar.tsx - Sign-in and profile → Authentication: authenticates
src/pages/LoginPage.tsx - Authentication → Application API: requests account
src/context/AuthContext.tsx - Product state → Application API: fetches products
src/context/ProductContext.tsx - Cart state → Application API: requests cart data
src/context/CartContext.tsx