How guli552/flowers-react2 works
This is a flower-shop storefront built as a React single-page application. Shoppers browse categories and products, inspect product details and reviews, manage a cart or favorites, and submit orders at checkout; account, profile, and admin routes support related tasks. App.jsx establishes providers and routes. Product, category, cart, order, review, language, and theme state are separate contexts, with several contexts persisting data in browser localStorage; authentication uses Firebase. Some page and admin internals were only partially sampled, so edges reflect imports or documented routing rather than unverified call sequences.
Main entry points: App.jsx App Router · ProductCard.jsx Product Card · Product.jsx Product Detail · ProductsContext.jsx Product Management
Components 27
Storefront
- App Router
src/App.jsx - Home
src/pages/Home.jsx - Catalog
src/pages/Catalog.jsx - Product Detail
src/pages/Product.jsx - Product Card
src/components/ProductCard.jsx - Category Icon
src/components/CategoryIcon.jsx - About, Contact & Delivery
src/pages
Commerce
Application State
- Product Catalog Data
src/data/products.js - Product Management
src/context/ProductsContext.jsx - Category Management
src/context/CategoriesContext.jsx - Cart & Favorites State
src/context/CartContext.jsx - Browser Storage
Identity & Localization
- Login
src/pages/Login.jsx - Profile
src/pages/Profile.jsx - Authentication State
src/context/AuthContext.jsx - Firebase Auth
src/firebase.js - Language & Text
src/context/LanguageContext.jsx - Translations
src/data/translations.js - Theme State
src/context/ThemeContext.jsx
Other components
- Shopper
Connections 48
- Shopper → App Router: opens storefront
src/App.jsx - App Router → Home: routes to
src/App.jsx - App Router → Catalog: routes to
src/App.jsx - App Router → Product Detail: routes to
src/App.jsx - App Router → Cart: routes to
src/App.jsx - App Router → Favorites: routes to
src/App.jsx - App Router → Checkout: routes to
src/App.jsx - App Router → About, Contact & Delivery: routes to
src/App.jsx - App Router → Login: routes to
src/App.jsx - App Router → Profile: routes to
src/App.jsx - App Router → Admin: routes to
src/App.jsx - Home → Product Card: renders
src/pages/Home.jsx - Catalog → Product Card: renders
src/pages/Catalog.jsx - Favorites → Product Card: renders
src/pages/Favorites.jsx - Product Detail → Product Card: renders related
src/pages/Product.jsx - Home → Product Management: reads products
src/pages/Home.jsx - Catalog → Product Management: reads products
src/pages/Catalog.jsx - Product Detail → Product Management: reads products
src/pages/Product.jsx - Product Management → Product Catalog Data: loads defaults
src/context/ProductsContext.jsx - Product Card → Cart & Favorites State: adds or favorites
src/components/ProductCard.jsx - Cart → Cart & Favorites State: reads cart
src/pages/Cart.jsx - Checkout → Cart & Favorites State: reads cart
src/pages/Checkout.jsx - Favorites → Cart & Favorites State: reads favorites
src/pages/Favorites.jsx - Checkout → Orders: creates orders
src/pages/Checkout.jsx - Profile → Orders: reads user orders
src/pages/Profile.jsx - Admin → Orders: manages orders
src/pages/Admin.jsx - Product Detail → Reviews: reads reviews
src/pages/Product.jsx - Product Detail → Review Form: renders form
src/pages/Product.jsx - Review Form → Reviews: submits reviews
src/components/ReviewForm.jsx - Admin → Product Management: manages products
src/pages/Admin.jsx - Admin → Category Management: manages categories
src/pages/Admin.jsx - Home → Category Management: reads categories
src/pages/Home.jsx - Catalog → Category Management: reads categories
src/pages/Catalog.jsx - Product Card → Category Management: gets category name
src/components/ProductCard.jsx - Catalog → Category Icon: renders
src/pages/Catalog.jsx - Login → Authentication State: authenticates
src/pages/Login.jsx - Profile → Authentication State: reads account
src/pages/Profile.jsx - Authentication State → Firebase Auth: uses provider
src/context/AuthContext.jsx - Product Card → Reviews: gets ratings
src/components/ProductCard.jsx - Admin → Reviews: manages reviews
src/pages/Admin.jsx - Product Detail → Category Management: gets category data
src/pages/Product.jsx - App Router → Language & Text: provides context
src/App.jsx - App Router → Theme State: provides context
src/App.jsx - Language & Text → Translations: loads translations
src/context/LanguageContext.jsx - Product Management → Browser Storage: persists products
src/context/ProductsContext.jsx - Cart & Favorites State → Browser Storage: persists cart
src/context/CartContext.jsx - Orders → Browser Storage: persists orders
src/context/OrdersContext.jsx - Reviews → Browser Storage: persists reviews
src/context/ReviewsContext.jsx