# sampathbudugula/comfy_store architecture

> Architecture diagram of the GitHub repository sampathbudugula/comfy_store, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sampathbudugula/comfy_store
- Repository: https://github.com/sampathbudugula/comfy_store

## Overview

Comfy Store is a React furniture-commerce storefront. Shoppers browse featured or filtered products, open a product detail, and add items to a cart; cart state and the product catalogue are persisted in browser storage. The graph follows the documented routes and the sampled calls. Some UI wiring is known only from the SOURCE INDEX, so unsampled details and unsupported links are omitted.

Main entry points: [`src/App.jsx`](https://github.com/sampathbudugula/comfy_store/blob/main/src/App.jsx) (Route application), [`src/context/CartContext.jsx`](https://github.com/sampathbudugula/comfy_store/blob/main/src/context/CartContext.jsx) (Cart state), [`src/components/Layout.jsx`](https://github.com/sampathbudugula/comfy_store/blob/main/src/components/Layout.jsx) (Site layout), [`src/pages/Products.jsx`](https://github.com/sampathbudugula/comfy_store/blob/main/src/pages/Products.jsx) (Product browsing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_app["Route application<br/>[App.jsx]"]
  node_layout["Site layout<br/>[Layout.jsx]"]
  node_home["Home page<br/>[Home.jsx]"]
  node_about["About page<br/>[About.jsx]"]
  node_notfound["Not-found page<br/>[NotFound.jsx]"]
  node_navbar["Navigation<br/>[Navbar.jsx]"]
  node_sidebar["Sidebar<br/>[Sidebar.jsx]"]
  node_footer["Footer<br/>[Footer.jsx]"]
end

subgraph group_catalog["Product catalogue"]
  node_products["Product browsing<br/>[Products.jsx]"]
  node_filters["Product filters"]
  node_productlist["Product list<br/>[ProductList.jsx]"]
  node_productcard["Product card<br/>[ProductCard.jsx]"]
  node_detail["Product detail<br/>[SingleProduct.jsx]"]
end

subgraph group_cart["Shopping cart"]
  node_cartpanel["Cart panel<br/>[CartSidebar.jsx]"]
  node_cartlist["Cart list<br/>[CartList.jsx]"]
  node_cartitem["Cart item<br/>[CartItem.jsx]"]
  node_carttotal["Cart total<br/>[CartTotal.jsx]"]
end

subgraph group_data["Data and state"]
  node_cartstate["Cart state<br/>[CartContext.jsx]"]
  node_producthook["Product data hook<br/>[useProducts.js]"]
  node_productapi["Product API<br/>[productApi.js]"]
  node_browserstorage[("Browser storage")]
end

node_shopper(("Shopper"))
node_productservice["Product service"]

node_shopper -->|"opens storefront"| node_app
node_app -->|"routes through"| node_layout
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_products
node_app -->|"routes to"| node_detail
node_app -->|"routes to"| node_about
node_app -->|"routes to"| node_notfound
node_app -->|"provides cart"| node_cartstate
node_layout -->|"renders"| node_navbar
node_layout -->|"renders"| node_sidebar
node_layout -->|"renders"| node_cartpanel
node_layout -->|"renders"| node_footer
node_home -->|"loads products"| node_producthook
node_home -->|"renders"| node_productcard
node_products -->|"loads products"| node_producthook
node_products -->|"uses filters"| node_filters
node_products -->|"renders results"| node_productlist
node_productlist -->|"renders"| node_productcard
node_productcard -->|"adds product"| node_cartstate
node_detail -->|"fetches item"| node_productapi
node_detail -->|"adds product"| node_cartstate
node_producthook -->|"loads catalogue"| node_productapi
node_producthook -->|"caches products"| node_browserstorage
node_productapi -->|"fetches products"| node_productservice
node_cartstate -->|"persists cart"| node_browserstorage
node_cartpanel -->|"reads cart state"| node_cartstate
node_cartpanel -->|"renders"| node_cartlist
node_cartpanel -->|"renders"| node_carttotal
node_cartlist -->|"renders"| node_cartitem
node_cartitem -->|"updates quantities"| node_cartstate
node_carttotal -->|"reads totals"| node_cartstate

click node_app "https://github.com/sampathbudugula/comfy_store/blob/main/src/App.jsx"
click node_layout "https://github.com/sampathbudugula/comfy_store/blob/main/src/components/Layout.jsx"
click node_home "https://github.com/sampathbudugula/comfy_store/blob/main/src/pages/Home.jsx"
click node_about "https://github.com/sampathbudugula/comfy_store/blob/main/src/pages/About.jsx"
click node_notfound "https://github.com/sampathbudugula/comfy_store/blob/main/src/pages/NotFound.jsx"
click node_navbar "https://github.com/sampathbudugula/comfy_store/blob/main/src/components/Navbar.jsx"
click node_sidebar "https://github.com/sampathbudugula/comfy_store/blob/main/src/components/Sidebar.jsx"
click node_footer "https://github.com/sampathbudugula/comfy_store/blob/main/src/components/Footer.jsx"
click node_products "https://github.com/sampathbudugula/comfy_store/blob/main/src/pages/Products.jsx"
click node_filters "https://github.com/sampathbudugula/comfy_store/tree/main/src/features/products"
click node_productlist "https://github.com/sampathbudugula/comfy_store/blob/main/src/features/products/ProductList.jsx"
click node_productcard "https://github.com/sampathbudugula/comfy_store/blob/main/src/components/ProductCard.jsx"
click node_detail "https://github.com/sampathbudugula/comfy_store/blob/main/src/pages/SingleProduct.jsx"
click node_cartpanel "https://github.com/sampathbudugula/comfy_store/blob/main/src/components/CartSidebar.jsx"
click node_cartlist "https://github.com/sampathbudugula/comfy_store/blob/main/src/features/cart/CartList.jsx"
click node_cartitem "https://github.com/sampathbudugula/comfy_store/blob/main/src/features/cart/CartItem.jsx"
click node_carttotal "https://github.com/sampathbudugula/comfy_store/blob/main/src/features/cart/CartTotal.jsx"
click node_cartstate "https://github.com/sampathbudugula/comfy_store/blob/main/src/context/CartContext.jsx"
click node_producthook "https://github.com/sampathbudugula/comfy_store/blob/main/src/hooks/useProducts.js"
click node_productapi "https://github.com/sampathbudugula/comfy_store/blob/main/src/services/productApi.js"

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_layout,node_home,node_about,node_notfound,node_navbar,node_sidebar,node_footer toneBlue
class node_products,node_filters,node_productlist,node_productcard,node_detail toneAmber
class node_cartpanel,node_cartlist,node_cartitem,node_carttotal toneMint
class node_cartstate,node_producthook,node_productapi,node_browserstorage toneRose
class node_shopper,node_productservice toneIndigo
```

## Components

### Storefront

- [Route application](https://github.com/sampathbudugula/comfy_store/blob/main/src/App.jsx): `src/App.jsx`
- [Site layout](https://github.com/sampathbudugula/comfy_store/blob/main/src/components/Layout.jsx): `src/components/Layout.jsx`
- [Home page](https://github.com/sampathbudugula/comfy_store/blob/main/src/pages/Home.jsx): `src/pages/Home.jsx`
- [About page](https://github.com/sampathbudugula/comfy_store/blob/main/src/pages/About.jsx): `src/pages/About.jsx`
- [Not-found page](https://github.com/sampathbudugula/comfy_store/blob/main/src/pages/NotFound.jsx): `src/pages/NotFound.jsx`
- [Navigation](https://github.com/sampathbudugula/comfy_store/blob/main/src/components/Navbar.jsx): `src/components/Navbar.jsx`
- [Sidebar](https://github.com/sampathbudugula/comfy_store/blob/main/src/components/Sidebar.jsx): `src/components/Sidebar.jsx`
- [Footer](https://github.com/sampathbudugula/comfy_store/blob/main/src/components/Footer.jsx): `src/components/Footer.jsx`

### Product catalogue

- [Product browsing](https://github.com/sampathbudugula/comfy_store/blob/main/src/pages/Products.jsx): `src/pages/Products.jsx`
- [Product filters](https://github.com/sampathbudugula/comfy_store/tree/main/src/features/products): `src/features/products`
- [Product list](https://github.com/sampathbudugula/comfy_store/blob/main/src/features/products/ProductList.jsx): `src/features/products/ProductList.jsx`
- [Product card](https://github.com/sampathbudugula/comfy_store/blob/main/src/components/ProductCard.jsx): `src/components/ProductCard.jsx`
- [Product detail](https://github.com/sampathbudugula/comfy_store/blob/main/src/pages/SingleProduct.jsx): `src/pages/SingleProduct.jsx`

### Shopping cart

- [Cart panel](https://github.com/sampathbudugula/comfy_store/blob/main/src/components/CartSidebar.jsx): `src/components/CartSidebar.jsx`
- [Cart list](https://github.com/sampathbudugula/comfy_store/blob/main/src/features/cart/CartList.jsx): `src/features/cart/CartList.jsx`
- [Cart item](https://github.com/sampathbudugula/comfy_store/blob/main/src/features/cart/CartItem.jsx): `src/features/cart/CartItem.jsx`
- [Cart total](https://github.com/sampathbudugula/comfy_store/blob/main/src/features/cart/CartTotal.jsx): `src/features/cart/CartTotal.jsx`

### Data and state

- [Cart state](https://github.com/sampathbudugula/comfy_store/blob/main/src/context/CartContext.jsx): `src/context/CartContext.jsx`
- [Product data hook](https://github.com/sampathbudugula/comfy_store/blob/main/src/hooks/useProducts.js): `src/hooks/useProducts.js`
- [Product API](https://github.com/sampathbudugula/comfy_store/blob/main/src/services/productApi.js): `src/services/productApi.js`
- **Browser storage**

### Other components

- **Shopper**
- **Product service**

## Connections

- Shopper → Route application: opens storefront (evidence: `src/App.jsx`)
- Route application → Site layout: routes through (evidence: `src/App.jsx`)
- Route application → Home page: routes to (evidence: `src/App.jsx`)
- Route application → Product browsing: routes to (evidence: `src/App.jsx`)
- Route application → Product detail: routes to (evidence: `src/App.jsx`)
- Route application → About page: routes to (evidence: `src/App.jsx`)
- Route application → Not-found page: routes to (evidence: `src/App.jsx`)
- Route application → Cart state: provides cart (evidence: `src/App.jsx`)
- Site layout → Navigation: renders (evidence: `src/components/Layout.jsx`)
- Site layout → Sidebar: renders (evidence: `src/components/Layout.jsx`)
- Site layout → Cart panel: renders (evidence: `src/components/Layout.jsx`)
- Site layout → Footer: renders (evidence: `src/components/Layout.jsx`)
- Home page → Product data hook: loads products (evidence: `src/pages/Home.jsx`)
- Home page → Product card: renders (evidence: `src/pages/Home.jsx`)
- Product browsing → Product data hook: loads products (evidence: `src/pages/Products.jsx`)
- Product browsing → Product filters: uses filters (evidence: `src/pages/Products.jsx`)
- Product browsing → Product list: renders results (evidence: `src/pages/Products.jsx`)
- Product list → Product card: renders (evidence: `src/features/products/ProductList.jsx`)
- Product card → Cart state: adds product (evidence: `src/components/ProductCard.jsx`)
- Product detail → Product API: fetches item (evidence: `src/pages/SingleProduct.jsx`)
- Product detail → Cart state: adds product (evidence: `src/pages/SingleProduct.jsx`)
- Product data hook → Product API: loads catalogue (evidence: `src/hooks/useProducts.js`)
- Product data hook → Browser storage: caches products (evidence: `src/hooks/useProducts.js`)
- Product API → Product service: fetches products (evidence: `src/services/productApi.js`)
- Cart state → Browser storage: persists cart (evidence: `src/context/CartContext.jsx`)
- Cart panel → Cart state: reads cart state (evidence: `src/components/CartSidebar.jsx`)
- Cart panel → Cart list: renders (evidence: `src/components/CartSidebar.jsx`)
- Cart panel → Cart total: renders (evidence: `src/components/CartSidebar.jsx`)
- Cart list → Cart item: renders (evidence: `src/features/cart/CartList.jsx`)
- Cart item → Cart state: updates quantities (evidence: `src/features/cart/CartItem.jsx`)
- Cart total → Cart state: reads totals (evidence: `src/features/cart/CartTotal.jsx`)
