# brandat-egy/frontend architecture

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

- Interactive diagram: https://gitdiagram.com/brandat-egy/frontend
- Repository: https://github.com/brandat-egy/frontend

## Overview

Brandat is an Arabic beauty-products storefront. Shoppers browse the home page, search and filter the catalog or browse categories, view product details, add items to a locally persisted cart or wishlist, then review the cart and confirm delivery details. Checkout confirmation is local only: the shown page explicitly says it does not send or save an order on a server. The graph follows documented imports and calls; unsampled routes and features are included where the source index identifies them, but their internal behavior is not inferred.

Main entry points: [`src/data/product.ts`](https://github.com/brandat-egy/frontend/blob/development/src/data/product.ts) (Product catalog data), [`src/context/CartContext.tsx`](https://github.com/brandat-egy/frontend/blob/development/src/context/CartContext.tsx) (Cart state), [`src/app/page.tsx`](https://github.com/brandat-egy/frontend/blob/development/src/app/page.tsx) (Home page), [`src/components/ui/ProductGrid.tsx`](https://github.com/brandat-egy/frontend/blob/development/src/components/ui/ProductGrid.tsx) (Product grid)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_home["Home page<br/>[page.tsx]"]
  node_announcement["Announcement bar"]
  node_hero["Hero section<br/>[HeroSection.tsx]"]
  node_categories_section["Category section"]
  node_featured["Featured products"]
  node_category_card["Category card<br/>[CategoryCard.tsx]"]
end

subgraph group_catalog["Catalog and products"]
  node_shop_page["Shop route<br/>[page.tsx]"]
  node_catalog_view["Search and filters<br/>[ShopCatalog.tsx]"]
  node_category_page["Category route<br/>[page.tsx]"]
  node_product_page["Product detail<br/>[page.tsx]"]
  node_product_grid["Product grid<br/>[ProductGrid.tsx]"]
  node_product_card["Product card<br/>[ProductCard.tsx]"]
  node_add_button["Add-to-cart button"]
end

subgraph group_shopping["Cart and checkout"]
  node_wishlist["Wishlist route<br/>[page.tsx]"]
  node_cart_page["Cart route<br/>[page.tsx]"]
  node_checkout["Checkout confirmation<br/>[page.tsx]"]
  node_cart_state["Cart state<br/>[CartContext.tsx]"]
end

subgraph group_shared["Shared data and shell"]
  node_product_service["Product queries<br/>[productService.ts]"]
  node_products[("Product catalog data<br/>[product.ts]")]
  node_categories[("Category data<br/>[categories.ts]")]
  node_product_type["Product type<br/>[product.ts]"]
  node_root_layout["Root layout<br/>[layout.tsx]"]
  node_header["Header<br/>[Header.tsx]"]
  node_navigation["Main navigation<br/>[MainNavigation.tsx]"]
end

node_visitor(("Shopper"))
node_local_storage[("Browser local storage")]

node_visitor -->|"opens"| node_home
node_home -->|"renders"| node_announcement
node_home -->|"renders"| node_hero
node_home -->|"renders"| node_categories_section
node_home -->|"renders"| node_featured
node_categories_section -->|"reads"| node_categories
node_categories_section -->|"renders"| node_category_card
node_featured -->|"reads"| node_products
node_featured -->|"renders"| node_product_card
node_shop_page -->|"renders"| node_catalog_view
node_catalog_view -->|"filters"| node_products
node_catalog_view -->|"lists filters"| node_categories
node_catalog_view -->|"renders results"| node_product_grid
node_category_page -->|"queries products"| node_product_service
node_category_page -->|"reads"| node_categories
node_category_page -->|"renders results"| node_product_grid
node_product_page -->|"reads details"| node_products
node_product_page -->|"renders"| node_add_button
node_product_page -->|"renders related"| node_product_grid
node_wishlist -->|"reads"| node_products
node_wishlist -->|"renders items"| node_product_grid
node_cart_page -->|"reads and updates"| node_cart_state
node_checkout -->|"reads and clears"| node_cart_state
node_product_grid -->|"renders"| node_product_card
node_product_card -->|"adds product"| node_cart_state
node_product_card -->|"reads and writes wishlist"| node_local_storage
node_add_button -->|"adds product"| node_cart_state
node_product_service -->|"queries"| node_products
node_product_service -->|"uses type"| node_product_type
node_products -->|"uses type"| node_product_type
node_root_layout -->|"renders"| node_header
node_root_layout -->|"provides cart"| node_cart_state
node_header -->|"reads cart"| node_cart_state
node_navigation -->|"provides links"| node_visitor

click node_home "https://github.com/brandat-egy/frontend/blob/development/src/app/page.tsx"
click node_announcement "https://github.com/brandat-egy/frontend/blob/development/src/components/layout/AnnouncementBar.tsx"
click node_hero "https://github.com/brandat-egy/frontend/blob/development/src/components/layout/HeroSection.tsx"
click node_categories_section "https://github.com/brandat-egy/frontend/blob/development/src/components/layout/CategorySection.tsx"
click node_featured "https://github.com/brandat-egy/frontend/blob/development/src/components/layout/FeaturedProducts.tsx"
click node_shop_page "https://github.com/brandat-egy/frontend/blob/development/src/app/shop/page.tsx"
click node_catalog_view "https://github.com/brandat-egy/frontend/blob/development/src/components/layout/ShopCatalog.tsx"
click node_category_page "https://github.com/brandat-egy/frontend/blob/development/src/app/categories/%5Bslug%5D/page.tsx"
click node_product_page "https://github.com/brandat-egy/frontend/blob/development/src/app/products/%5Bid%5D/page.tsx"
click node_wishlist "https://github.com/brandat-egy/frontend/blob/development/src/app/wishlist/page.tsx"
click node_cart_page "https://github.com/brandat-egy/frontend/blob/development/src/app/cart/page.tsx"
click node_checkout "https://github.com/brandat-egy/frontend/blob/development/src/app/checkout/page.tsx"
click node_product_grid "https://github.com/brandat-egy/frontend/blob/development/src/components/ui/ProductGrid.tsx"
click node_product_card "https://github.com/brandat-egy/frontend/blob/development/src/components/ui/ProductCard.tsx"
click node_category_card "https://github.com/brandat-egy/frontend/blob/development/src/components/ui/CategoryCard.tsx"
click node_add_button "https://github.com/brandat-egy/frontend/blob/development/src/components/ui/AddToCartButton.tsx"
click node_product_service "https://github.com/brandat-egy/frontend/blob/development/src/services/productService.ts"
click node_products "https://github.com/brandat-egy/frontend/blob/development/src/data/product.ts"
click node_categories "https://github.com/brandat-egy/frontend/blob/development/src/data/categories.ts"
click node_product_type "https://github.com/brandat-egy/frontend/blob/development/src/types/product.ts"
click node_root_layout "https://github.com/brandat-egy/frontend/blob/development/src/app/layout.tsx"
click node_header "https://github.com/brandat-egy/frontend/blob/development/src/components/layout/Header.tsx"
click node_navigation "https://github.com/brandat-egy/frontend/blob/development/src/components/layout/MainNavigation.tsx"
click node_cart_state "https://github.com/brandat-egy/frontend/blob/development/src/context/CartContext.tsx"

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_announcement,node_hero,node_categories_section,node_featured,node_category_card toneBlue
class node_shop_page,node_catalog_view,node_category_page,node_product_page,node_product_grid,node_product_card,node_add_button,node_local_storage toneAmber
class node_wishlist,node_cart_page,node_checkout,node_cart_state toneMint
class node_product_service,node_products,node_categories,node_product_type,node_root_layout,node_header,node_navigation toneRose
class node_visitor toneIndigo
```

## Components

### Storefront

- [Home page](https://github.com/brandat-egy/frontend/blob/development/src/app/page.tsx): `src/app/page.tsx`
- [Announcement bar](https://github.com/brandat-egy/frontend/blob/development/src/components/layout/AnnouncementBar.tsx): `src/components/layout/AnnouncementBar.tsx`
- [Hero section](https://github.com/brandat-egy/frontend/blob/development/src/components/layout/HeroSection.tsx): `src/components/layout/HeroSection.tsx`
- [Category section](https://github.com/brandat-egy/frontend/blob/development/src/components/layout/CategorySection.tsx): `src/components/layout/CategorySection.tsx`
- [Featured products](https://github.com/brandat-egy/frontend/blob/development/src/components/layout/FeaturedProducts.tsx): `src/components/layout/FeaturedProducts.tsx`
- [Category card](https://github.com/brandat-egy/frontend/blob/development/src/components/ui/CategoryCard.tsx): `src/components/ui/CategoryCard.tsx`

### Catalog and products

- [Shop route](https://github.com/brandat-egy/frontend/blob/development/src/app/shop/page.tsx): `src/app/shop/page.tsx`
- [Search and filters](https://github.com/brandat-egy/frontend/blob/development/src/components/layout/ShopCatalog.tsx): `src/components/layout/ShopCatalog.tsx`
- [Category route](https://github.com/brandat-egy/frontend/blob/development/src/app/categories/%5Bslug%5D/page.tsx): `src/app/categories/[slug]/page.tsx`
- [Product detail](https://github.com/brandat-egy/frontend/blob/development/src/app/products/%5Bid%5D/page.tsx): `src/app/products/[id]/page.tsx`
- [Product grid](https://github.com/brandat-egy/frontend/blob/development/src/components/ui/ProductGrid.tsx): `src/components/ui/ProductGrid.tsx`
- [Product card](https://github.com/brandat-egy/frontend/blob/development/src/components/ui/ProductCard.tsx): `src/components/ui/ProductCard.tsx`
- [Add-to-cart button](https://github.com/brandat-egy/frontend/blob/development/src/components/ui/AddToCartButton.tsx): `src/components/ui/AddToCartButton.tsx`

### Cart and checkout

- [Wishlist route](https://github.com/brandat-egy/frontend/blob/development/src/app/wishlist/page.tsx): `src/app/wishlist/page.tsx`
- [Cart route](https://github.com/brandat-egy/frontend/blob/development/src/app/cart/page.tsx): `src/app/cart/page.tsx`
- [Checkout confirmation](https://github.com/brandat-egy/frontend/blob/development/src/app/checkout/page.tsx): `src/app/checkout/page.tsx`
- [Cart state](https://github.com/brandat-egy/frontend/blob/development/src/context/CartContext.tsx): `src/context/CartContext.tsx`

### Shared data and shell

- [Product queries](https://github.com/brandat-egy/frontend/blob/development/src/services/productService.ts): `src/services/productService.ts`
- [Product catalog data](https://github.com/brandat-egy/frontend/blob/development/src/data/product.ts): `src/data/product.ts`
- [Category data](https://github.com/brandat-egy/frontend/blob/development/src/data/categories.ts): `src/data/categories.ts`
- [Product type](https://github.com/brandat-egy/frontend/blob/development/src/types/product.ts): `src/types/product.ts`
- [Root layout](https://github.com/brandat-egy/frontend/blob/development/src/app/layout.tsx): `src/app/layout.tsx`
- [Header](https://github.com/brandat-egy/frontend/blob/development/src/components/layout/Header.tsx): `src/components/layout/Header.tsx`
- [Main navigation](https://github.com/brandat-egy/frontend/blob/development/src/components/layout/MainNavigation.tsx): `src/components/layout/MainNavigation.tsx`

### Other components

- **Shopper**
- **Browser local storage**

## Connections

- Shopper → Home page: opens
- Home page → Announcement bar: renders (evidence: `src/app/page.tsx`)
- Home page → Hero section: renders (evidence: `src/app/page.tsx`)
- Home page → Category section: renders (evidence: `src/app/page.tsx`)
- Home page → Featured products: renders (evidence: `src/app/page.tsx`)
- Category section → Category data: reads (evidence: `src/components/layout/CategorySection.tsx`)
- Category section → Category card: renders (evidence: `src/components/layout/CategorySection.tsx`)
- Featured products → Product catalog data: reads (evidence: `src/components/layout/FeaturedProducts.tsx`)
- Featured products → Product card: renders (evidence: `src/components/layout/FeaturedProducts.tsx`)
- Shop route → Search and filters: renders (evidence: `src/app/shop/page.tsx`)
- Search and filters → Product catalog data: filters (evidence: `src/components/layout/ShopCatalog.tsx`)
- Search and filters → Category data: lists filters (evidence: `src/components/layout/ShopCatalog.tsx`)
- Search and filters → Product grid: renders results (evidence: `src/components/layout/ShopCatalog.tsx`)
- Category route → Product queries: queries products (evidence: `src/app/categories/[slug]/page.tsx`)
- Category route → Category data: reads (evidence: `src/app/categories/[slug]/page.tsx`)
- Category route → Product grid: renders results (evidence: `src/app/categories/[slug]/page.tsx`)
- Product detail → Product catalog data: reads details (evidence: `src/app/products/[id]/page.tsx`)
- Product detail → Add-to-cart button: renders (evidence: `src/app/products/[id]/page.tsx`)
- Product detail → Product grid: renders related (evidence: `src/app/products/[id]/page.tsx`)
- Wishlist route → Product catalog data: reads (evidence: `src/app/wishlist/page.tsx`)
- Wishlist route → Product grid: renders items (evidence: `src/app/wishlist/page.tsx`)
- Cart route → Cart state: reads and updates (evidence: `src/app/cart/page.tsx`)
- Checkout confirmation → Cart state: reads and clears (evidence: `src/app/checkout/page.tsx`)
- Product grid → Product card: renders (evidence: `src/components/ui/ProductGrid.tsx`)
- Product card → Cart state: adds product (evidence: `src/components/ui/ProductCard.tsx`)
- Product card → Browser local storage: reads and writes wishlist (evidence: `src/components/ui/ProductCard.tsx`)
- Add-to-cart button → Cart state: adds product (evidence: `src/components/ui/AddToCartButton.tsx`)
- Product queries → Product catalog data: queries (evidence: `src/services/productService.ts`)
- Product queries → Product type: uses type (evidence: `src/services/productService.ts`)
- Product catalog data → Product type: uses type (evidence: `src/data/product.ts`)
- Root layout → Header: renders (evidence: `src/app/layout.tsx`)
- Root layout → Cart state: provides cart (evidence: `src/app/layout.tsx`)
- Header → Cart state: reads cart (evidence: `src/components/layout/Header.tsx`)
- Main navigation → Shopper: provides links (evidence: `src/components/layout/MainNavigation.tsx`)
