# codewithcrafter/yatiya architecture

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

- Interactive diagram: https://gitdiagram.com/codewithcrafter/yatiya
- Repository: https://github.com/codewithcrafter/yatiya

## Overview

This is a Next.js storefront for couture fashion, with product discovery, cart and checkout, customer account features, and an administrative area. The main shopping flow runs from the home page or catalog through product browsing, cart, and checkout; cart and customer state are held in browser local storage. The repository also contains account, wishlist, and admin routes. Several route implementations were not sampled, so their internal calls are omitted; their major route areas are still represented.

Main entry points: [`src/app/page.tsx`](https://github.com/codewithcrafter/yatiya/blob/main/src/app/page.tsx) (Home experience), [`src/app/cart/page.tsx`](https://github.com/codewithcrafter/yatiya/blob/main/src/app/cart/page.tsx) (Cart page), [`src/components/shop/ProductCard.tsx`](https://github.com/codewithcrafter/yatiya/blob/main/src/components/shop/ProductCard.tsx) (Product card), [`src/data/mockData.ts`](https://github.com/codewithcrafter/yatiya/blob/main/src/data/mockData.ts) (Catalog data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_home["Home experience<br/>[page.tsx]"]
  node_home_sections["Home sections"]
  node_site_chrome["Site navigation<br/>[Header.tsx]"]
  node_footer["Site footer<br/>[Footer.tsx]"]
end

subgraph group_shopping["Shopping"]
  node_catalog_routes["Catalog routes<br/>[page.tsx]"]
  node_catalog_data["Catalog data<br/>[mockData.ts]"]
  node_product_records["Product records<br/>[products.ts]"]
  node_catalog_controls["Search and filters<br/>[ProductFilters.tsx]"]
  node_product_grid["Product grid<br/>[ProductGrid.tsx]"]
  node_product_card["Product card<br/>[ProductCard.tsx]"]
  node_product_detail["Product details<br/>[ProductDetail.tsx]"]
  node_cart_page["Cart page<br/>[page.tsx]"]
  node_cart_state["Cart state<br/>[CartContext.tsx]"]
  node_checkout["Checkout<br/>[page.tsx]"]
end

subgraph group_customer["Customer"]
  node_account_routes["Account routes"]
  node_customer_state["Customer state"]
  node_wishlist_routes["Wishlist routes<br/>[page.tsx]"]
  node_wishlist_state["Wishlist state"]
end

subgraph group_operations["Operations"]
  node_admin_routes["Admin routes"]
end

node_visitor(("Shopper"))

node_visitor -->|"opens"| node_home
node_home -->|"renders"| node_home_sections
node_home -.->|"links to"| node_site_chrome
node_home -.->|"links to"| node_footer
node_home -->|"reads products"| node_product_records
node_catalog_routes -->|"loads catalog"| node_catalog_data
node_catalog_routes -->|"renders"| node_catalog_controls
node_catalog_routes -->|"renders results"| node_product_grid
node_product_grid -->|"renders cards"| node_product_card
node_product_card -->|"reads product"| node_catalog_data
node_product_card -->|"adds item"| node_cart_state
node_product_card -->|"toggles wishlist"| node_wishlist_state
node_cart_page -->|"updates cart"| node_cart_state
node_cart_page -->|"moves item"| node_wishlist_state
node_cart_page -->|"looks up product"| node_catalog_data
node_cart_page -->|"links to"| node_checkout
node_checkout -->|"reads and clears"| node_cart_state
node_checkout -->|"creates order"| node_customer_state
node_account_routes -->|"uses customer state"| node_customer_state
node_account_routes -->|"uses wishlist"| node_wishlist_state
node_wishlist_routes -.->|"uses wishlist"| node_wishlist_state
node_admin_routes -->|"reads catalog"| node_catalog_data

click node_home "https://github.com/codewithcrafter/yatiya/blob/main/src/app/page.tsx"
click node_home_sections "https://github.com/codewithcrafter/yatiya/tree/main/src/components/home"
click node_site_chrome "https://github.com/codewithcrafter/yatiya/blob/main/src/components/header/Header.tsx"
click node_footer "https://github.com/codewithcrafter/yatiya/blob/main/src/components/footer/Footer.tsx"
click node_catalog_routes "https://github.com/codewithcrafter/yatiya/blob/main/src/app/products/page.tsx"
click node_catalog_data "https://github.com/codewithcrafter/yatiya/blob/main/src/data/mockData.ts"
click node_product_records "https://github.com/codewithcrafter/yatiya/blob/main/src/data/products.ts"
click node_catalog_controls "https://github.com/codewithcrafter/yatiya/blob/main/src/components/shop/ProductFilters.tsx"
click node_product_grid "https://github.com/codewithcrafter/yatiya/blob/main/src/components/shop/ProductGrid.tsx"
click node_product_card "https://github.com/codewithcrafter/yatiya/blob/main/src/components/shop/ProductCard.tsx"
click node_product_detail "https://github.com/codewithcrafter/yatiya/blob/main/src/components/shop/ProductDetail.tsx"
click node_cart_page "https://github.com/codewithcrafter/yatiya/blob/main/src/app/cart/page.tsx"
click node_cart_state "https://github.com/codewithcrafter/yatiya/blob/main/src/context/CartContext.tsx"
click node_checkout "https://github.com/codewithcrafter/yatiya/blob/main/src/app/checkout/page.tsx"
click node_account_routes "https://github.com/codewithcrafter/yatiya/tree/main/src/app/account"
click node_customer_state "https://github.com/codewithcrafter/yatiya/blob/main/src/context/CustomerContext.tsx"
click node_wishlist_routes "https://github.com/codewithcrafter/yatiya/blob/main/src/app/wishlist/page.tsx"
click node_wishlist_state "https://github.com/codewithcrafter/yatiya/blob/main/src/context/WishlistContext.tsx"
click node_admin_routes "https://github.com/codewithcrafter/yatiya/tree/main/src/app/admin"

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_home,node_home_sections,node_site_chrome,node_footer toneBlue
class node_catalog_routes,node_catalog_data,node_product_records,node_catalog_controls,node_product_grid,node_product_card,node_product_detail,node_cart_page,node_cart_state,node_checkout toneAmber
class node_account_routes,node_customer_state,node_wishlist_routes,node_wishlist_state toneMint
class node_admin_routes toneRose
class node_visitor toneIndigo
```

## Components

### Storefront

- [Home experience](https://github.com/codewithcrafter/yatiya/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Home sections](https://github.com/codewithcrafter/yatiya/tree/main/src/components/home): `src/components/home`
- [Site navigation](https://github.com/codewithcrafter/yatiya/blob/main/src/components/header/Header.tsx): `src/components/header/Header.tsx`
- [Site footer](https://github.com/codewithcrafter/yatiya/blob/main/src/components/footer/Footer.tsx): `src/components/footer/Footer.tsx`

### Shopping

- [Catalog routes](https://github.com/codewithcrafter/yatiya/blob/main/src/app/products/page.tsx): `src/app/products/page.tsx`
- [Catalog data](https://github.com/codewithcrafter/yatiya/blob/main/src/data/mockData.ts): `src/data/mockData.ts`
- [Product records](https://github.com/codewithcrafter/yatiya/blob/main/src/data/products.ts): `src/data/products.ts`
- [Search and filters](https://github.com/codewithcrafter/yatiya/blob/main/src/components/shop/ProductFilters.tsx): `src/components/shop/ProductFilters.tsx`
- [Product grid](https://github.com/codewithcrafter/yatiya/blob/main/src/components/shop/ProductGrid.tsx): `src/components/shop/ProductGrid.tsx`
- [Product card](https://github.com/codewithcrafter/yatiya/blob/main/src/components/shop/ProductCard.tsx): `src/components/shop/ProductCard.tsx`
- [Product details](https://github.com/codewithcrafter/yatiya/blob/main/src/components/shop/ProductDetail.tsx): `src/components/shop/ProductDetail.tsx`
- [Cart page](https://github.com/codewithcrafter/yatiya/blob/main/src/app/cart/page.tsx): `src/app/cart/page.tsx`
- [Cart state](https://github.com/codewithcrafter/yatiya/blob/main/src/context/CartContext.tsx): `src/context/CartContext.tsx`
- [Checkout](https://github.com/codewithcrafter/yatiya/blob/main/src/app/checkout/page.tsx): `src/app/checkout/page.tsx`

### Customer

- [Account routes](https://github.com/codewithcrafter/yatiya/tree/main/src/app/account): `src/app/account`
- [Customer state](https://github.com/codewithcrafter/yatiya/blob/main/src/context/CustomerContext.tsx): `src/context/CustomerContext.tsx`
- [Wishlist routes](https://github.com/codewithcrafter/yatiya/blob/main/src/app/wishlist/page.tsx): `src/app/wishlist/page.tsx`
- [Wishlist state](https://github.com/codewithcrafter/yatiya/blob/main/src/context/WishlistContext.tsx): `src/context/WishlistContext.tsx`

### Operations

- [Admin routes](https://github.com/codewithcrafter/yatiya/tree/main/src/app/admin): `src/app/admin`

### Other components

- **Shopper**

## Connections

- Shopper → Home experience: opens (evidence: `README.md`)
- Home experience → Home sections: renders (evidence: `src/app/page.tsx`)
- Home experience → Site navigation: links to
- Home experience → Site footer: links to
- Home experience → Product records: reads products (evidence: `src/app/page.tsx`)
- Catalog routes → Catalog data: loads catalog (evidence: `src/app/products/page.tsx`)
- Catalog routes → Search and filters: renders (evidence: `src/app/products/page.tsx`)
- Catalog routes → Product grid: renders results (evidence: `src/app/products/page.tsx`)
- Product grid → Product card: renders cards (evidence: `src/components/shop/ProductGrid.tsx`)
- Product card → Catalog data: reads product (evidence: `src/components/shop/ProductCard.tsx`)
- Product card → Cart state: adds item (evidence: `src/components/shop/ProductCard.tsx`)
- Product card → Wishlist state: toggles wishlist (evidence: `src/components/shop/ProductCard.tsx`)
- Cart page → Cart state: updates cart (evidence: `src/app/cart/page.tsx`)
- Cart page → Wishlist state: moves item (evidence: `src/app/cart/page.tsx`)
- Cart page → Catalog data: looks up product (evidence: `src/app/cart/page.tsx`)
- Cart page → Checkout: links to (evidence: `src/app/cart/page.tsx`)
- Checkout → Cart state: reads and clears (evidence: `src/app/checkout/page.tsx`)
- Checkout → Customer state: creates order (evidence: `src/app/checkout/page.tsx`)
- Account routes → Customer state: uses customer state (evidence: `src/app/account/page.tsx`)
- Account routes → Wishlist state: uses wishlist (evidence: `src/app/account/page.tsx`)
- Wishlist routes → Wishlist state: uses wishlist
- Admin routes → Catalog data: reads catalog (evidence: `src/app/admin/products/page.tsx`)
