How harrysingh1999/harryshop works
Project type and purpose
• This is a single-page React application scaffolded with Vite.
• Purpose: an e-commerce front-end (products listing, cart, orders, wishlist, product details, search).
• No backend code in this repo—consumes external REST or GraphQL APIs via Redux Toolkit.
File structure
• Top-level files: configuration for ESLint, Tailwind, Vite, and package metadata.
• public/ folder holds static assets and redirect rules.
• src/ contains all source code:
• Components/ – presentational components organized by feature (Cart, Product, Header, Footer, etc.).
• Reduxtoolkit/ – slices and API setup for state and server interaction.
• utils/ – shared constants, images, and custom hooks.
• main.jsx & App.jsx – application entry point and root component.
• index.html & App.css – HTML template and global styles.
• Tailwind and PostCSS configurations drive styling.
README for additional insights
• Confirms Vite + React setup with HMR, ESLint rules, and official plugins for JSX support.
a. Main components to show:
• Browser/Client running React SPA
• React component hierarchy (App → Header, Home, Products, Cart, Orders, Product pages, Footer, etc.)
• Redux Toolkit store with slices: authSlice, cartSlice, wishlistSlice, apiSlice
• External API server(s) (products, cart, orders, auth endpoints)
• Static asset store/CDN (public images, favicon, redirect rules)
b. Relationships and interactions:
• User events in Components dispatch Redux actions → update store or trigger API calls via apiSlice.
• apiSlice middleware invokes HTTP requests → receives responses → dispatches fulfilled actions that update slices.
• Components subscribe to slice state (useSelector) and re-render with new data.
• Custom hooks (useOnlineStatus, useScroll) monitor environment and feed into components.
c. Architectural patterns and design principles:
• Component-driven design for UI (feature folders per component).
• Unidirectional data flow via Redux Toolkit (actions → reducers → state → view).
• Separation of concerns: presentation (Components/) vs. state & side-effects (Reduxtoolkit/) vs. utilities.
• Styling with Tailwind + PostCSS; bundling via Vite.
d. Key technologies and libraries:
• Vite (dev server, HMR, bundling)
• React 18 (function components, hooks)
• Redux Toolkit (createSlice, createApi)
• Tailwind CSS (utility-first styling)
• ESLint (code quality)