How mhnipu/smart-shopper-galaxy works
Main Components
• Entry Point & Bootstrapping – Represent index.html and main.tsx as the starting block where the application is loaded and bootstrapped.
• Application Shell – Illustrate App.tsx as the main wrapper that configures routes, layouts, and context providers.
• UI Layout and Navigation – Include layout components (Navbar, Footer, UserMenu, etc.) showing the overall site structure.
• Domain-Specific Modules – Group components by functionalities:
▪ Home: Components like Hero, FeaturedProducts, CategorySection, NewsletterSignup, etc.
▪ Product: Elements such as ProductCard, ProductInfo, ProductOptions, ProductReviews, and others.
▪ Cart/Checkout: Components handling cart functionality and checkout (CartDrawer, PaymentMethodSelector).
▪ Chat & Search: Components for interactive features (ChatBot, ImageSearch, SmartSearch).
• Context Providers – Identify modules under src/context (AuthContext, CartContext, CurrencyContext, ThemeContext, WishlistContext) that manage global state.
• Utility & Hook Layers – Note the existence of custom hooks (e.g., use-mobile, use-toast) and utility functions (in src/lib and src/components/util) that support app logic.
Relationships & Interactions
• Component Hierarchy: Visually differentiate that pages (in src/pages) are composed of the modular UI components (found in src/components). For example, the ProductDetail page composes ProductCard, ProductImageGallery, ProductInfo, etc.
• Data & Event Flow: Mark how actions (like adding an item to the cart) move from UI components through context and hooks to update the global state.
Architectural Patterns & Design Principles
• Component-Based Design: Highlight the separation into reusable UI components (organized into domain-specific folders e.g., home, product, checkout).
• Separation of Concerns: Note the distinct responsibilities (Pages handling routes, Components handling UI, Context managing state, Hooks and Lib for logic/utilities).
• Responsive and Thematic Design: Indicate the role of Tailwind CSS and shadcn‑ui in styling, with ThemeToggle in the UI components.
• Single Page Application (SPA): Emphasize that routing is client‑side (React Router likely in use), with dedicated pages for various routes.
Technologies and Frameworks
• Vite – For rapid development and building the app.
• React & TypeScript – Core framework and language ensuring type safety.
• shadcn‑ui & Tailwind CSS – For UI components and styling.
• Node.js & npm – As part of the build and development environment (evidenced by package.json, package-lock.json, bun.lockb).