# ahmed-abd-alrahman515/ecomtest architecture

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

- Interactive diagram: https://gitdiagram.com/ahmed-abd-alrahman515/ecomtest
- Repository: https://github.com/ahmed-abd-alrahman515/ecomtest

## Overview

This is a bilingual Saudi-perfume storefront built as a Next.js app, with product and category data held locally rather than a documented commerce backend. The main customer journey is to browse or search the catalog, inspect a product, add it to a locally persisted cart, and review it at checkout. Separate branches cover wishlists, store information, and customer support. The graph reflects documented imports and sampled source; checkout and other unsampled pages are represented by their paths, without inferring payment processing or fulfillment integrations.

Main entry points: [`lib/cart-context.tsx`](https://github.com/ahmed-abd-alrahman515/ecomtest/blob/main/lib/cart-context.tsx) (Cart State), [`data/products.ts`](https://github.com/ahmed-abd-alrahman515/ecomtest/blob/main/data/products.ts) (Product Data), [`components/products/product-detail.tsx`](https://github.com/ahmed-abd-alrahman515/ecomtest/blob/main/components/products/product-detail.tsx) (Product Detail), [`components/layout/header.tsx`](https://github.com/ahmed-abd-alrahman515/ecomtest/blob/main/components/layout/header.tsx) (Store Header)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Store Discovery"]
  node_home["Home Page<br/>[page.tsx]"]
  node_home_sections["Home Sections"]
  node_catalog_pages["Catalog Pages<br/>[page.tsx]"]
  node_category_pages["Category Pages<br/>[page.tsx]"]
  node_search_page["Search Page<br/>[page.tsx]"]
  node_product_page["Product Page<br/>[page.tsx]"]
  node_catalog_ui["Catalog UI"]
  node_product_detail["Product Detail<br/>[product-detail.tsx]"]
  node_product_card["Product Card<br/>[product-card.tsx]"]
end

subgraph group_commerce["Shopping State"]
  node_cart_state["Cart State<br/>[cart-context.tsx]"]
  node_cart_views["Cart Views<br/>[page.tsx]"]
  node_cart_drawer["Cart Drawer<br/>[cart-drawer.tsx]"]
  node_checkout["Checkout Page<br/>[page.tsx]"]
  node_wishlist_page["Wishlist Page<br/>[page.tsx]"]
  node_wishlist_state["Wishlist State"]
end

subgraph group_storefront["Storefront Experience"]
  node_site_layout["Shop Layout<br/>[layout.tsx]"]
  node_header["Store Header<br/>[header.tsx]"]
  node_search_overlay["Search Overlay<br/>[search-overlay.tsx]"]
  node_store_info["Store Information<br/>[page.tsx]"]
  node_support["Support Pages<br/>[page.tsx]"]
  node_contact["Contact Page<br/>[page.tsx]"]
end

subgraph group_foundation["Catalog Foundation"]
  node_product_data["Product Data<br/>[products.ts]"]
  node_category_data["Category Data<br/>[categories.ts]"]
  node_site_config["Store Config<br/>[site.ts]"]
  node_format["Price Formatting<br/>[format.ts]"]
end

node_shopper(("Shopper"))

node_shopper -->|"opens"| node_home
node_shopper -->|"browses"| node_catalog_pages
node_shopper -->|"searches"| node_search_page
node_shopper -->|"opens"| node_product_page
node_shopper -->|"reviews cart"| node_cart_views
node_shopper -->|"continues to"| node_checkout
node_home -->|"renders"| node_home_sections
node_home_sections -->|"reads products"| node_product_data
node_home_sections -->|"reads categories"| node_category_data
node_catalog_pages -->|"renders"| node_catalog_ui
node_catalog_pages -->|"reads products"| node_product_data
node_catalog_pages -->|"reads categories"| node_category_data
node_category_pages -.->|"renders"| node_catalog_ui
node_search_page -.->|"searches"| node_product_data
node_product_page -.->|"renders"| node_product_detail
node_product_detail -->|"reads product"| node_product_data
node_product_detail -->|"adds item"| node_cart_state
node_product_detail -->|"toggles wishlist"| node_wishlist_state
node_product_card -->|"adds item"| node_cart_state
node_product_card -->|"toggles wishlist"| node_wishlist_state
node_product_card -->|"gets discount"| node_product_data
node_product_card -->|"looks up category"| node_category_data
node_cart_views -->|"reads and updates"| node_cart_state
node_cart_views -->|"formats prices"| node_format
node_cart_drawer -->|"reads and updates"| node_cart_state
node_checkout -->|"reads cart"| node_cart_state
node_wishlist_page -->|"reads wishlist"| node_wishlist_state
node_wishlist_page -->|"looks up products"| node_product_data
node_wishlist_page -->|"adds to cart"| node_cart_state
node_site_layout -.->|"renders"| node_header
node_header -->|"opens"| node_search_overlay
node_header -->|"renders"| node_cart_drawer
node_header -->|"reads cart"| node_cart_state
node_header -->|"reads wishlist"| node_wishlist_state
node_search_overlay -->|"searches products"| node_product_data
node_home -.->|"uses branding"| node_site_config
node_store_info -->|"uses branding"| node_site_config
node_contact -->|"uses contact details"| node_site_config
node_product_detail -->|"formats prices"| node_format

click node_home "https://github.com/ahmed-abd-alrahman515/ecomtest/blob/main/app/(shop)/page.tsx"
click node_home_sections "https://github.com/ahmed-abd-alrahman515/ecomtest/tree/main/components/home"
click node_catalog_pages "https://github.com/ahmed-abd-alrahman515/ecomtest/blob/main/app/(shop)/products/page.tsx"
click node_category_pages "https://github.com/ahmed-abd-alrahman515/ecomtest/blob/main/app/(shop)/categories/page.tsx"
click node_search_page "https://github.com/ahmed-abd-alrahman515/ecomtest/blob/main/app/(shop)/search/page.tsx"
click node_product_page "https://github.com/ahmed-abd-alrahman515/ecomtest/blob/main/app/(shop)/product/%5Bslug%5D/page.tsx"
click node_catalog_ui "https://github.com/ahmed-abd-alrahman515/ecomtest/tree/main/components/products"
click node_product_detail "https://github.com/ahmed-abd-alrahman515/ecomtest/blob/main/components/products/product-detail.tsx"
click node_product_card "https://github.com/ahmed-abd-alrahman515/ecomtest/blob/main/components/shared/product-card.tsx"
click node_product_data "https://github.com/ahmed-abd-alrahman515/ecomtest/blob/main/data/products.ts"
click node_category_data "https://github.com/ahmed-abd-alrahman515/ecomtest/blob/main/data/categories.ts"
click node_cart_state "https://github.com/ahmed-abd-alrahman515/ecomtest/blob/main/lib/cart-context.tsx"
click node_cart_views "https://github.com/ahmed-abd-alrahman515/ecomtest/blob/main/app/(shop)/cart/page.tsx"
click node_cart_drawer "https://github.com/ahmed-abd-alrahman515/ecomtest/blob/main/components/layout/cart-drawer.tsx"
click node_checkout "https://github.com/ahmed-abd-alrahman515/ecomtest/blob/main/app/(shop)/checkout/page.tsx"
click node_wishlist_page "https://github.com/ahmed-abd-alrahman515/ecomtest/blob/main/app/(shop)/wishlist/page.tsx"
click node_wishlist_state "https://github.com/ahmed-abd-alrahman515/ecomtest/blob/main/lib/wishlist-context.tsx"
click node_site_layout "https://github.com/ahmed-abd-alrahman515/ecomtest/blob/main/app/(shop)/layout.tsx"
click node_header "https://github.com/ahmed-abd-alrahman515/ecomtest/blob/main/components/layout/header.tsx"
click node_search_overlay "https://github.com/ahmed-abd-alrahman515/ecomtest/blob/main/components/layout/search-overlay.tsx"
click node_store_info "https://github.com/ahmed-abd-alrahman515/ecomtest/blob/main/app/(shop)/about/page.tsx"
click node_support "https://github.com/ahmed-abd-alrahman515/ecomtest/blob/main/app/(shop)/services/page.tsx"
click node_contact "https://github.com/ahmed-abd-alrahman515/ecomtest/blob/main/app/(shop)/contact/page.tsx"
click node_site_config "https://github.com/ahmed-abd-alrahman515/ecomtest/blob/main/config/site.ts"
click node_format "https://github.com/ahmed-abd-alrahman515/ecomtest/blob/main/lib/format.ts"

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_catalog_pages,node_category_pages,node_search_page,node_product_page,node_catalog_ui,node_product_detail,node_product_card toneBlue
class node_cart_state,node_cart_views,node_cart_drawer,node_checkout,node_wishlist_page,node_wishlist_state toneAmber
class node_site_layout,node_header,node_search_overlay,node_store_info,node_support,node_contact toneMint
class node_product_data,node_category_data,node_site_config,node_format toneRose
class node_shopper toneIndigo
```

## Components

### Store Discovery

- [Home Page](https://github.com/ahmed-abd-alrahman515/ecomtest/blob/main/app/(shop)/page.tsx): `app/(shop)/page.tsx`
- [Home Sections](https://github.com/ahmed-abd-alrahman515/ecomtest/tree/main/components/home): `components/home`
- [Catalog Pages](https://github.com/ahmed-abd-alrahman515/ecomtest/blob/main/app/(shop)/products/page.tsx): `app/(shop)/products/page.tsx`
- [Category Pages](https://github.com/ahmed-abd-alrahman515/ecomtest/blob/main/app/(shop)/categories/page.tsx): `app/(shop)/categories/page.tsx`
- [Search Page](https://github.com/ahmed-abd-alrahman515/ecomtest/blob/main/app/(shop)/search/page.tsx): `app/(shop)/search/page.tsx`
- [Product Page](https://github.com/ahmed-abd-alrahman515/ecomtest/blob/main/app/(shop)/product/%5Bslug%5D/page.tsx): `app/(shop)/product/[slug]/page.tsx`
- [Catalog UI](https://github.com/ahmed-abd-alrahman515/ecomtest/tree/main/components/products): `components/products`
- [Product Detail](https://github.com/ahmed-abd-alrahman515/ecomtest/blob/main/components/products/product-detail.tsx): `components/products/product-detail.tsx`
- [Product Card](https://github.com/ahmed-abd-alrahman515/ecomtest/blob/main/components/shared/product-card.tsx): `components/shared/product-card.tsx`

### Shopping State

- [Cart State](https://github.com/ahmed-abd-alrahman515/ecomtest/blob/main/lib/cart-context.tsx): `lib/cart-context.tsx`
- [Cart Views](https://github.com/ahmed-abd-alrahman515/ecomtest/blob/main/app/(shop)/cart/page.tsx): `app/(shop)/cart/page.tsx`
- [Cart Drawer](https://github.com/ahmed-abd-alrahman515/ecomtest/blob/main/components/layout/cart-drawer.tsx): `components/layout/cart-drawer.tsx`
- [Checkout Page](https://github.com/ahmed-abd-alrahman515/ecomtest/blob/main/app/(shop)/checkout/page.tsx): `app/(shop)/checkout/page.tsx`
- [Wishlist Page](https://github.com/ahmed-abd-alrahman515/ecomtest/blob/main/app/(shop)/wishlist/page.tsx): `app/(shop)/wishlist/page.tsx`
- [Wishlist State](https://github.com/ahmed-abd-alrahman515/ecomtest/blob/main/lib/wishlist-context.tsx): `lib/wishlist-context.tsx`

### Storefront Experience

- [Shop Layout](https://github.com/ahmed-abd-alrahman515/ecomtest/blob/main/app/(shop)/layout.tsx): `app/(shop)/layout.tsx`
- [Store Header](https://github.com/ahmed-abd-alrahman515/ecomtest/blob/main/components/layout/header.tsx): `components/layout/header.tsx`
- [Search Overlay](https://github.com/ahmed-abd-alrahman515/ecomtest/blob/main/components/layout/search-overlay.tsx): `components/layout/search-overlay.tsx`
- [Store Information](https://github.com/ahmed-abd-alrahman515/ecomtest/blob/main/app/(shop)/about/page.tsx): `app/(shop)/about/page.tsx`
- [Support Pages](https://github.com/ahmed-abd-alrahman515/ecomtest/blob/main/app/(shop)/services/page.tsx): `app/(shop)/services/page.tsx`
- [Contact Page](https://github.com/ahmed-abd-alrahman515/ecomtest/blob/main/app/(shop)/contact/page.tsx): `app/(shop)/contact/page.tsx`

### Catalog Foundation

- [Product Data](https://github.com/ahmed-abd-alrahman515/ecomtest/blob/main/data/products.ts): `data/products.ts`
- [Category Data](https://github.com/ahmed-abd-alrahman515/ecomtest/blob/main/data/categories.ts): `data/categories.ts`
- [Store Config](https://github.com/ahmed-abd-alrahman515/ecomtest/blob/main/config/site.ts): `config/site.ts`
- [Price Formatting](https://github.com/ahmed-abd-alrahman515/ecomtest/blob/main/lib/format.ts): `lib/format.ts`

### Other components

- **Shopper**

## Connections

- Shopper → Home Page: opens
- Shopper → Catalog Pages: browses
- Shopper → Search Page: searches
- Shopper → Product Page: opens
- Shopper → Cart Views: reviews cart
- Shopper → Checkout Page: continues to
- Home Page → Home Sections: renders (evidence: `app/(shop)/page.tsx`)
- Home Sections → Product Data: reads products (evidence: `components/home/best-sellers-section.tsx`)
- Home Sections → Category Data: reads categories (evidence: `components/home/categories-section.tsx`)
- Catalog Pages → Catalog UI: renders (evidence: `app/(shop)/products/page.tsx`)
- Catalog Pages → Product Data: reads products (evidence: `app/(shop)/products/page.tsx`)
- Catalog Pages → Category Data: reads categories (evidence: `app/(shop)/products/page.tsx`)
- Category Pages → Catalog UI: renders
- Search Page → Product Data: searches
- Product Page → Product Detail: renders
- Product Detail → Product Data: reads product (evidence: `components/products/product-detail.tsx`)
- Product Detail → Cart State: adds item (evidence: `components/products/product-detail.tsx`)
- Product Detail → Wishlist State: toggles wishlist (evidence: `components/products/product-detail.tsx`)
- Product Card → Cart State: adds item (evidence: `components/shared/product-card.tsx`)
- Product Card → Wishlist State: toggles wishlist (evidence: `components/shared/product-card.tsx`)
- Product Card → Product Data: gets discount (evidence: `components/shared/product-card.tsx`)
- Product Card → Category Data: looks up category (evidence: `components/shared/product-card.tsx`)
- Cart Views → Cart State: reads and updates (evidence: `app/(shop)/cart/page.tsx`)
- Cart Views → Price Formatting: formats prices (evidence: `app/(shop)/cart/page.tsx`)
- Cart Drawer → Cart State: reads and updates (evidence: `components/layout/cart-drawer.tsx`)
- Checkout Page → Cart State: reads cart (evidence: `app/(shop)/checkout/page.tsx`)
- Wishlist Page → Wishlist State: reads wishlist (evidence: `app/(shop)/wishlist/page.tsx`)
- Wishlist Page → Product Data: looks up products (evidence: `app/(shop)/wishlist/page.tsx`)
- Wishlist Page → Cart State: adds to cart (evidence: `app/(shop)/wishlist/page.tsx`)
- Shop Layout → Store Header: renders
- Store Header → Search Overlay: opens (evidence: `components/layout/header.tsx`)
- Store Header → Cart Drawer: renders (evidence: `components/layout/header.tsx`)
- Store Header → Cart State: reads cart (evidence: `components/layout/header.tsx`)
- Store Header → Wishlist State: reads wishlist (evidence: `components/layout/header.tsx`)
- Search Overlay → Product Data: searches products (evidence: `components/layout/search-overlay.tsx`)
- Home Page → Store Config: uses branding
- Store Information → Store Config: uses branding (evidence: `app/(shop)/about/page.tsx`)
- Contact Page → Store Config: uses contact details (evidence: `app/(shop)/contact/page.tsx`)
- Product Detail → Price Formatting: formats prices (evidence: `components/products/product-detail.tsx`)
