# santhosh-2906/flipkart-clone architecture

> Architecture diagram of the GitHub repository santhosh-2906/flipkart-clone, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/santhosh-2906/flipkart-clone
- Repository: https://github.com/santhosh-2906/flipkart-clone

## Overview

This React storefront presents a product catalog, lets shoppers add and remove items in a cart, and displays a calculated subtotal at checkout. The main path is catalog browsing → add to cart → checkout review and subtotal. Cart state is held in React context and updated by a reducer. The README also documents responsive presentation, router navigation, and a custom not-found page. Relationships are based on the shown component calls, reducer setup, and README; no backend or payment processing is evidenced.

Main entry points: [`src/StateProvider.jsx`](https://github.com/santhosh-2906/flipkart-clone/blob/main/src/StateProvider.jsx) (Context Provider), [`src/App.jsx`](https://github.com/santhosh-2906/flipkart-clone/blob/main/src/App.jsx) (App Router), [`src/components/Checkout.jsx`](https://github.com/santhosh-2906/flipkart-clone/blob/main/src/components/Checkout.jsx) (Cart Review), [`src/main.jsx`](https://github.com/santhosh-2906/flipkart-clone/blob/main/src/main.jsx) (React Entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["Storefront UI"]
  node_app["App Router<br/>[App.jsx]"]
  node_home["Product Catalog<br/>[Home.jsx]"]
  node_product["Product Card<br/>[Product.jsx]"]
  node_navbar["Navigation Bar<br/>[Navbar.jsx]"]
  node_notfound["Not Found Page<br/>[NotFound.jsx]"]
end

subgraph group_cartflow["Cart and Checkout"]
  node_checkout["Cart Review<br/>[Checkout.jsx]"]
  node_checkoutproduct["Cart Item"]
  node_subtotal["Subtotal<br/>[Subtotal.jsx]"]
end

subgraph group_state["Cart State"]
  node_provider["Context Provider<br/>[StateProvider.jsx]"]
  node_reducer["Cart Reducer<br/>[Reducer.js]"]
  node_entry["React Entry<br/>[main.jsx]"]
end

node_shopper(("Shopper"))

node_shopper -->|"uses storefront"| node_app
node_app -->|"renders"| node_navbar
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_checkout
node_app -->|"routes to"| node_notfound
node_home -->|"renders"| node_product
node_product -->|"reads and dispatches"| node_provider
node_navbar -->|"reads cart count"| node_provider
node_checkout -->|"reads cart"| node_provider
node_checkout -->|"renders"| node_checkoutproduct
node_checkout -->|"renders"| node_subtotal
node_checkoutproduct -->|"dispatches removal"| node_provider
node_subtotal -->|"reads cart total"| node_provider
node_entry -->|"mounts"| node_provider
node_entry -->|"configures"| node_reducer
node_provider -->|"runs"| node_reducer

click node_app "https://github.com/santhosh-2906/flipkart-clone/blob/main/src/App.jsx"
click node_home "https://github.com/santhosh-2906/flipkart-clone/blob/main/src/components/Home.jsx"
click node_product "https://github.com/santhosh-2906/flipkart-clone/blob/main/src/components/Product.jsx"
click node_navbar "https://github.com/santhosh-2906/flipkart-clone/blob/main/src/components/Navbar.jsx"
click node_notfound "https://github.com/santhosh-2906/flipkart-clone/blob/main/src/components/NotFound.jsx"
click node_checkout "https://github.com/santhosh-2906/flipkart-clone/blob/main/src/components/Checkout.jsx"
click node_checkoutproduct "https://github.com/santhosh-2906/flipkart-clone/blob/main/src/components/CheckoutProduct.jsx"
click node_subtotal "https://github.com/santhosh-2906/flipkart-clone/blob/main/src/components/Subtotal.jsx"
click node_provider "https://github.com/santhosh-2906/flipkart-clone/blob/main/src/StateProvider.jsx"
click node_reducer "https://github.com/santhosh-2906/flipkart-clone/blob/main/src/Reducer.js"
click node_entry "https://github.com/santhosh-2906/flipkart-clone/blob/main/src/main.jsx"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_home,node_product,node_navbar,node_notfound toneBlue
class node_checkout,node_checkoutproduct,node_subtotal toneAmber
class node_provider,node_reducer,node_entry toneMint
class node_shopper toneIndigo
```

## Components

### Storefront UI

- [App Router](https://github.com/santhosh-2906/flipkart-clone/blob/main/src/App.jsx): `src/App.jsx`
- [Product Catalog](https://github.com/santhosh-2906/flipkart-clone/blob/main/src/components/Home.jsx): `src/components/Home.jsx`
- [Product Card](https://github.com/santhosh-2906/flipkart-clone/blob/main/src/components/Product.jsx): `src/components/Product.jsx`
- [Navigation Bar](https://github.com/santhosh-2906/flipkart-clone/blob/main/src/components/Navbar.jsx): `src/components/Navbar.jsx`
- [Not Found Page](https://github.com/santhosh-2906/flipkart-clone/blob/main/src/components/NotFound.jsx): `src/components/NotFound.jsx`

### Cart and Checkout

- [Cart Review](https://github.com/santhosh-2906/flipkart-clone/blob/main/src/components/Checkout.jsx): `src/components/Checkout.jsx`
- [Cart Item](https://github.com/santhosh-2906/flipkart-clone/blob/main/src/components/CheckoutProduct.jsx): `src/components/CheckoutProduct.jsx`
- [Subtotal](https://github.com/santhosh-2906/flipkart-clone/blob/main/src/components/Subtotal.jsx): `src/components/Subtotal.jsx`

### Cart State

- [Context Provider](https://github.com/santhosh-2906/flipkart-clone/blob/main/src/StateProvider.jsx): `src/StateProvider.jsx`
- [Cart Reducer](https://github.com/santhosh-2906/flipkart-clone/blob/main/src/Reducer.js): `src/Reducer.js`
- [React Entry](https://github.com/santhosh-2906/flipkart-clone/blob/main/src/main.jsx): `src/main.jsx`

### Other components

- **Shopper**

## Connections

- Shopper → App Router: uses storefront (evidence: `README.md`)
- App Router → Navigation Bar: renders (evidence: `src/App.jsx`)
- App Router → Product Catalog: routes to (evidence: `src/App.jsx`)
- App Router → Cart Review: routes to (evidence: `src/App.jsx`)
- App Router → Not Found Page: routes to (evidence: `src/App.jsx`)
- Product Catalog → Product Card: renders (evidence: `src/components/Home.jsx`)
- Product Card → Context Provider: reads and dispatches (evidence: `src/components/Product.jsx`)
- Navigation Bar → Context Provider: reads cart count (evidence: `src/components/Navbar.jsx`)
- Cart Review → Context Provider: reads cart (evidence: `src/components/Checkout.jsx`)
- Cart Review → Cart Item: renders (evidence: `src/components/Checkout.jsx`)
- Cart Review → Subtotal: renders (evidence: `src/components/Checkout.jsx`)
- Cart Item → Context Provider: dispatches removal (evidence: `src/components/CheckoutProduct.jsx`)
- Subtotal → Context Provider: reads cart total (evidence: `src/components/Subtotal.jsx`)
- React Entry → Context Provider: mounts (evidence: `src/main.jsx`)
- React Entry → Cart Reducer: configures (evidence: `src/main.jsx`)
- Context Provider → Cart Reducer: runs (evidence: `src/StateProvider.jsx`)
