How sreelekshmi19/e-commerce-product-listing-app works
Project Type and Purpose
• This is a front-end single-page application (SPA) for product listing, built entirely with static assets (HTML, CSS, JavaScript) and fetching real product data from the external Fake Store REST API. There is no custom backend or database in your repo—only client-side logic and a third-party service.
Main Components
a. Client Browser (SPA)
• index.html (HTML shell)
• styles.css (styling)
• script.js (fetching data, rendering products, search/filter logic, cart management)
• toggle.js (mobile menu toggle)
b. External Fake Store API Service
• REST endpoints for products and categories
c. User Interface Modules (logical subcomponents inside the SPA)
• Product Fetch & Render Module
• Search & Filter Module
• Cart Module (in-memory or localStorage)
• Hamburger Menu / Responsive Controls Module
Relationships and Data Flow
• On page load, the SPA (script.js) sends an HTTP GET to the Fake Store API → API responds with JSON product data → SPA parses and renders product cards in the browser.
• User types in the search field or picks a category → SPA filters the rendered products in-memory.
• User clicks “Add to Cart” → SPA adds item to Cart Module’s data structure and updates item count in the UI.
Architectural Patterns and Design Principles
• Separation of concerns:
• Static asset layer (HTML/CSS) vs. behavior layer (JavaScript modules).
• UI rendering vs. data fetching vs. state management (cart).
• SPA pattern with client-side routing of concerns (no page reloads).
• Third-party API integration (thin client).
• Responsive design principle (mobile vs. desktop layout).
Technologies and Frameworks
• Vanilla JavaScript (Fetch API for REST calls)
• HTML5 / CSS3 (Flexbox or Grid for layout)
• Fake Store REST API (https://fakestoreapi.com)
• Labels for HTML, CSS, JS files or modules.
• Browser boundary vs. external network boundary.
• Responsive/mobile toggle as its own component.