# niti-s/myntra-functional-clone architecture

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

- Interactive diagram: https://gitdiagram.com/niti-s/myntra-functional-clone
- Repository: https://github.com/niti-s/myntra-functional-clone

## Overview

This is a small client-side Myntra-style storefront: users browse a product catalog, add items to a cart, then review or remove items and see a price summary. The excerpts show the catalog and cart logic, product data, and browser-local persistence. The HTML files are present in the tree but were not sampled, so page-to-script wiring is not asserted; the documented add, delete, and price-calculation capabilities are represented through the code paths that implement them.

Main entry points: [`other js/bag.js`](https://github.com/niti-s/myntra-functional-clone/blob/main/other%20js/bag.js) (Cart display and actions), [`index.js`](https://github.com/niti-s/myntra-functional-clone/blob/main/index.js) (Catalog and add-to-bag), [`pages/bag.html`](https://github.com/niti-s/myntra-functional-clone/blob/main/pages/bag.html) (Cart page), [`data/item.js`](https://github.com/niti-s/myntra-functional-clone/blob/main/data/item.js) (Product data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_catalog_page["Catalog page<br/>[index.html]"]
  node_catalog_logic["Catalog and add-to-bag<br/>[index.js]"]
end

subgraph group_cart["Cart"]
  node_cart_page["Cart page<br/>[bag.html]"]
  node_cart_logic["Cart display and actions<br/>[bag.js]"]
end

subgraph group_state["Data and state"]
  node_product_data["Product data<br/>[item.js]"]
  node_bag_storage[("Browser bag storage")]
end

node_shopper(("Shopper"))

node_shopper -->|"browses"| node_catalog_page
node_catalog_logic -->|"renders products"| node_product_data
node_catalog_logic -->|"reads and writes"| node_bag_storage
node_cart_logic -->|"looks up items"| node_product_data
node_cart_logic -->|"reads and writes"| node_bag_storage
node_cart_logic -->|"renders cart"| node_cart_page
node_shopper -.->|"reviews cart"| node_cart_page

click node_catalog_page "https://github.com/niti-s/myntra-functional-clone/blob/main/index.html"
click node_catalog_logic "https://github.com/niti-s/myntra-functional-clone/blob/main/index.js"
click node_product_data "https://github.com/niti-s/myntra-functional-clone/blob/main/data/item.js"
click node_cart_page "https://github.com/niti-s/myntra-functional-clone/blob/main/pages/bag.html"
click node_cart_logic "https://github.com/niti-s/myntra-functional-clone/blob/main/other%20js/bag.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_catalog_page,node_catalog_logic toneBlue
class node_cart_page,node_cart_logic toneAmber
class node_product_data,node_bag_storage toneMint
class node_shopper toneIndigo
```

## Components

### Storefront

- [Catalog page](https://github.com/niti-s/myntra-functional-clone/blob/main/index.html): `index.html`
- [Catalog and add-to-bag](https://github.com/niti-s/myntra-functional-clone/blob/main/index.js): `index.js`

### Cart

- [Cart page](https://github.com/niti-s/myntra-functional-clone/blob/main/pages/bag.html): `pages/bag.html`
- [Cart display and actions](https://github.com/niti-s/myntra-functional-clone/blob/main/other%20js/bag.js): `other js/bag.js`

### Data and state

- [Product data](https://github.com/niti-s/myntra-functional-clone/blob/main/data/item.js): `data/item.js`
- **Browser bag storage**

### Other components

- **Shopper**

## Connections

- Shopper → Catalog page: browses (evidence: `README.md`)
- Catalog and add-to-bag → Product data: renders products (evidence: `index.js`)
- Catalog and add-to-bag → Browser bag storage: reads and writes (evidence: `index.js`)
- Cart display and actions → Product data: looks up items (evidence: `other js/bag.js`)
- Cart display and actions → Browser bag storage: reads and writes (evidence: `other js/bag.js`)
- Cart display and actions → Cart page: renders cart (evidence: `other js/bag.js`)
- Shopper → Cart page: reviews cart (evidence: `README.md`)
