How sharpwill24/flair-project works
This repository is a Shopify-backed storefront for customizable products, with customer-facing browsing, product design and cart operations, plus an administrative area for users and product management. The central customer workflow is browsing products, configuring a product in the interactive preview, then validating and adding the customization to a cart. The graph also preserves the preview-generation and admin/API branches. Source excerpts show several customizer and cart calls; other links are limited to relationships explicitly listed in the source index, so unsampled routes are not connected speculatively.
Main entry points: useCartOperations.ts Cart operations · Header.tsx Storefront header · PreviewCanvas.tsx Interactive preview · customization-cart.ts Shopify customization cart
Components 24
Storefront
- Home page
src/app/page.tsx - Product showcase
src/components/home/HomeShowcaseSection.tsx - Storefront header
src/components/layout/Header.tsx - Product pages
src/app/products
Product customization
- Product customizer
src/components/products/customizer - Preview section
src/components/products/customizer/components/PreviewSection.tsx - Interactive preview
src/components/products/customizer/PreviewCanvas.tsx - Overlay views
src/components/products/customizer/components/overlays - Design area
src/components/products/customizer/components/DesignArea.tsx - Customization state
src/types/customization.ts - Cart operations
src/components/products/customizer/hooks/useCartOperations.ts - Customization validation
src/lib/customization/utils.ts
Commerce services
- Preview generation
src/lib/customization/preview.ts - Server preview endpoint
src/app/api/generate-preview/route.ts - Shopify customization cart
src/lib/shopify/customization-cart.ts - Shopify Storefront client
src/lib/shopify/client.ts - Shopify
- Cart count events
src/lib/cart/events.ts - Orders endpoint
src/app/api/orders/route.ts
Administration
- Login and logout
src/app/api/login/route.ts - User session context
src/components/UserContext.tsx - Admin pages
src/app/adminpanel - Product management APIs
src/pages/api
Other components
- Shopper
Connections 20
- Home page → Storefront header: renders
src/app/page.tsx - Home page → Product showcase: renders
src/app/page.tsx - Product showcase → Product pages: renders cards
src/components/home/HomeShowcaseSection.tsx - Storefront header → User session context: reads session
src/components/layout/Header.tsx - Storefront header → Cart count events: refreshes count
src/components/layout/Header.tsx - Storefront header → Shopify customization cart: uses cart
src/components/layout/Header.tsx - Product customizer → Preview section: renders
src/components/products/customizer/components/PreviewSection.tsx - Preview section → Interactive preview: renders
src/components/products/customizer/components/PreviewSection.tsx - Interactive preview → Overlay views: renders overlays
src/components/products/customizer/PreviewCanvas.tsx - Interactive preview → Design area: renders design area
src/components/products/customizer/PreviewCanvas.tsx - Cart operations → Customization validation: validates
src/components/products/customizer/hooks/useCartOperations.ts - Cart operations → Preview generation: generates preview
src/components/products/customizer/hooks/useCartOperations.ts - Cart operations → Shopify customization cart: adds customization
src/components/products/customizer/hooks/useCartOperations.ts - Cart operations → Cart count events: refreshes count
src/components/products/customizer/hooks/useCartOperations.ts - Preview generation → Customization validation: converts coordinates
src/lib/customization/preview.ts - Server preview endpoint → Customization validation: converts coordinates
src/app/api/generate-preview/route.ts - Shopify Storefront client → Shopify: queries products
- Shopify customization cart → Shopify: manages cart
- Admin pages → User session context: uses session
src/app/adminpanel/product/[id]/page.tsx - Shopify Storefront client → Shopify: fetches catalog