# zhelukevich/plum architecture

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

- Interactive diagram: https://gitdiagram.com/zhelukevich/plum
- Repository: https://github.com/zhelukevich/plum

## Overview

PLUM is a localized apparel storefront. The principal customer flow is browsing the catalog, opening a product, adding a selected variant to the cart, and proceeding through checkout and payment. Additional routes cover orders, gift cards, a secret store, and informational pages. The graph reflects sampled source and SOURCE INDEX references; several routes and integrations are listed in the tree but were not sampled, so their internal behavior is not inferred.

Main entry points: [`src/pages/[locale]/products/[handle].tsx`](https://github.com/zhelukevich/plum/blob/main/src/pages/%5Blocale%5D/products/%5Bhandle%5D.tsx) (Product detail), [`src/pages/[locale]/index.tsx`](https://github.com/zhelukevich/plum/blob/main/src/pages/%5Blocale%5D/index.tsx) (Product catalog), [`src/pages/[locale]/checkout.tsx`](https://github.com/zhelukevich/plum/blob/main/src/pages/%5Blocale%5D/checkout.tsx) (Checkout), [`src/context/cart-provider.tsx`](https://github.com/zhelukevich/plum/blob/main/src/context/cart-provider.tsx) (Cart state and API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shopping["Shopping and checkout"]
  node_catalog["Product catalog<br/>[index.tsx]"]
  node_product["Product detail<br/>[&#91;handle&#93;.tsx]"]
  node_checkout["Checkout<br/>[checkout.tsx]"]
  node_orders["Order history<br/>[index.tsx]"]
  node_giftcard["Gift cards<br/>[gift-card.tsx]"]
  node_secret["Secret store<br/>[secret-store.tsx]"]
  node_info["About and policies<br/>[about.tsx]"]
  node_commerce_api{{"Commerce API"}}
  node_payment{{"Payment service"}}
end

subgraph group_state["Cart and locale state"]
  node_cart["Cart state and API<br/>[cart-provider.tsx]"]
  node_locale["Locale state"]
end

subgraph group_experience["Storefront experience"]
  node_navbar["Navigation and cart<br/>[Navbar.tsx]"]
  node_gallery["Photo gallery<br/>[PhotoGallery.tsx]"]
  node_recommendations["Recommendations"]
  node_subscribe["Subscribe form<br/>[SubscribeForm.tsx]"]
  node_footer["Footer<br/>[Footer.tsx]"]
  node_icons["Icon set<br/>[Icons.tsx]"]
end

subgraph group_localization["Localization"]
  node_locale_link["Localized links<br/>[Link.tsx]"]
  node_language_switch["Language switch"]
  node_language_detector["Language detection"]
  node_redirect["Locale redirect<br/>[redirect.js]"]
  node_static_i18n["Static translations<br/>[getStatic.js]"]
  node_i18n_config["i18n configuration"]
end

node_visitor(("Shopper"))

node_visitor -->|"browses"| node_catalog
node_catalog -->|"fetches products"| node_commerce_api
node_visitor -->|"opens product"| node_product
node_product -->|"fetches product"| node_commerce_api
node_product -->|"adds variant"| node_cart
node_product -->|"renders gallery"| node_gallery
node_product -->|"renders recommendations"| node_recommendations
node_visitor -->|"checks out"| node_checkout
node_checkout -->|"reads and updates"| node_cart
node_cart -->|"requests cart data"| node_commerce_api
node_checkout -->|"starts payment"| node_payment
node_checkout -->|"reads language"| node_locale
node_catalog -->|"renders form"| node_subscribe
node_catalog -->|"renders navigation"| node_navbar
node_catalog -->|"renders footer"| node_footer
node_navbar -->|"reads cart count"| node_cart
node_navbar -->|"renders switch"| node_language_switch
node_language_switch -->|"detects language"| node_language_detector
node_language_switch -->|"reads locale"| node_locale
node_locale -->|"detects language"| node_language_detector
node_redirect -->|"detects and caches"| node_language_detector
node_static_i18n -->|"uses locales"| node_i18n_config
node_product -->|"loads translations"| node_static_i18n
node_checkout -->|"loads translations"| node_static_i18n
node_orders -->|"uses cart state"| node_cart
node_info -->|"renders navigation"| node_navbar
node_info -->|"renders footer"| node_footer

click node_catalog "https://github.com/zhelukevich/plum/blob/main/src/pages/%5Blocale%5D/index.tsx"
click node_product "https://github.com/zhelukevich/plum/blob/main/src/pages/%5Blocale%5D/products/%5Bhandle%5D.tsx"
click node_checkout "https://github.com/zhelukevich/plum/blob/main/src/pages/%5Blocale%5D/checkout.tsx"
click node_orders "https://github.com/zhelukevich/plum/blob/main/src/pages/%5Blocale%5D/orders/index.tsx"
click node_giftcard "https://github.com/zhelukevich/plum/blob/main/src/pages/%5Blocale%5D/gift-card.tsx"
click node_secret "https://github.com/zhelukevich/plum/blob/main/src/pages/%5Blocale%5D/secret-store.tsx"
click node_info "https://github.com/zhelukevich/plum/blob/main/src/pages/%5Blocale%5D/about.tsx"
click node_cart "https://github.com/zhelukevich/plum/blob/main/src/context/cart-provider.tsx"
click node_locale "https://github.com/zhelukevich/plum/blob/main/src/context/locale-provider.tsx"
click node_navbar "https://github.com/zhelukevich/plum/blob/main/src/components/Navbar.tsx"
click node_gallery "https://github.com/zhelukevich/plum/blob/main/src/components/PhotoGallery.tsx"
click node_recommendations "https://github.com/zhelukevich/plum/blob/main/src/components/ProductRecommendations.tsx"
click node_subscribe "https://github.com/zhelukevich/plum/blob/main/src/components/SubscribeForm.tsx"
click node_footer "https://github.com/zhelukevich/plum/blob/main/src/components/Footer.tsx"
click node_icons "https://github.com/zhelukevich/plum/blob/main/src/components/Icons.tsx"
click node_locale_link "https://github.com/zhelukevich/plum/blob/main/src/components/Link.tsx"
click node_language_switch "https://github.com/zhelukevich/plum/blob/main/src/components/LanguageSwitchButton.tsx"
click node_language_detector "https://github.com/zhelukevich/plum/blob/main/src/lib/languageDetector.js"
click node_redirect "https://github.com/zhelukevich/plum/blob/main/src/lib/redirect.js"
click node_static_i18n "https://github.com/zhelukevich/plum/blob/main/src/lib/getStatic.js"
click node_i18n_config "https://github.com/zhelukevich/plum/blob/main/next-i18next.config.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,node_product,node_checkout,node_orders,node_giftcard,node_secret,node_info,node_commerce_api,node_payment toneBlue
class node_cart,node_locale toneAmber
class node_navbar,node_gallery,node_recommendations,node_subscribe,node_footer,node_icons toneMint
class node_locale_link,node_language_switch,node_language_detector,node_redirect,node_static_i18n,node_i18n_config toneRose
class node_visitor toneIndigo
```

## Components

### Shopping and checkout

- [Product catalog](https://github.com/zhelukevich/plum/blob/main/src/pages/%5Blocale%5D/index.tsx): `src/pages/[locale]/index.tsx`
- [Product detail](https://github.com/zhelukevich/plum/blob/main/src/pages/%5Blocale%5D/products/%5Bhandle%5D.tsx): `src/pages/[locale]/products/[handle].tsx`
- [Checkout](https://github.com/zhelukevich/plum/blob/main/src/pages/%5Blocale%5D/checkout.tsx): `src/pages/[locale]/checkout.tsx`
- [Order history](https://github.com/zhelukevich/plum/blob/main/src/pages/%5Blocale%5D/orders/index.tsx): `src/pages/[locale]/orders/index.tsx`
- [Gift cards](https://github.com/zhelukevich/plum/blob/main/src/pages/%5Blocale%5D/gift-card.tsx): `src/pages/[locale]/gift-card.tsx`
- [Secret store](https://github.com/zhelukevich/plum/blob/main/src/pages/%5Blocale%5D/secret-store.tsx): `src/pages/[locale]/secret-store.tsx`
- [About and policies](https://github.com/zhelukevich/plum/blob/main/src/pages/%5Blocale%5D/about.tsx): `src/pages/[locale]/about.tsx`
- **Commerce API**
- **Payment service**

### Cart and locale state

- [Cart state and API](https://github.com/zhelukevich/plum/blob/main/src/context/cart-provider.tsx): `src/context/cart-provider.tsx`
- [Locale state](https://github.com/zhelukevich/plum/blob/main/src/context/locale-provider.tsx): `src/context/locale-provider.tsx`

### Storefront experience

- [Navigation and cart](https://github.com/zhelukevich/plum/blob/main/src/components/Navbar.tsx): `src/components/Navbar.tsx`
- [Photo gallery](https://github.com/zhelukevich/plum/blob/main/src/components/PhotoGallery.tsx): `src/components/PhotoGallery.tsx`
- [Recommendations](https://github.com/zhelukevich/plum/blob/main/src/components/ProductRecommendations.tsx): `src/components/ProductRecommendations.tsx`
- [Subscribe form](https://github.com/zhelukevich/plum/blob/main/src/components/SubscribeForm.tsx): `src/components/SubscribeForm.tsx`
- [Footer](https://github.com/zhelukevich/plum/blob/main/src/components/Footer.tsx): `src/components/Footer.tsx`
- [Icon set](https://github.com/zhelukevich/plum/blob/main/src/components/Icons.tsx): `src/components/Icons.tsx`

### Localization

- [Localized links](https://github.com/zhelukevich/plum/blob/main/src/components/Link.tsx): `src/components/Link.tsx`
- [Language switch](https://github.com/zhelukevich/plum/blob/main/src/components/LanguageSwitchButton.tsx): `src/components/LanguageSwitchButton.tsx`
- [Language detection](https://github.com/zhelukevich/plum/blob/main/src/lib/languageDetector.js): `src/lib/languageDetector.js`
- [Locale redirect](https://github.com/zhelukevich/plum/blob/main/src/lib/redirect.js): `src/lib/redirect.js`
- [Static translations](https://github.com/zhelukevich/plum/blob/main/src/lib/getStatic.js): `src/lib/getStatic.js`
- [i18n configuration](https://github.com/zhelukevich/plum/blob/main/next-i18next.config.js): `next-i18next.config.js`

### Other components

- **Shopper**

## Connections

- Shopper → Product catalog: browses (evidence: `src/pages/[locale]/index.tsx`)
- Product catalog → Commerce API: fetches products (evidence: `src/pages/[locale]/index.tsx`)
- Shopper → Product detail: opens product (evidence: `src/pages/[locale]/products/[handle].tsx`)
- Product detail → Commerce API: fetches product (evidence: `src/pages/[locale]/products/[handle].tsx`)
- Product detail → Cart state and API: adds variant (evidence: `src/pages/[locale]/products/[handle].tsx`)
- Product detail → Photo gallery: renders gallery (evidence: `src/pages/[locale]/products/[handle].tsx`)
- Product detail → Recommendations: renders recommendations (evidence: `src/pages/[locale]/products/[handle].tsx`)
- Shopper → Checkout: checks out (evidence: `src/pages/[locale]/checkout.tsx`)
- Checkout → Cart state and API: reads and updates (evidence: `src/pages/[locale]/checkout.tsx`)
- Cart state and API → Commerce API: requests cart data (evidence: `src/context/cart-provider.tsx`)
- Checkout → Payment service: starts payment (evidence: `src/pages/[locale]/checkout.tsx`)
- Checkout → Locale state: reads language (evidence: `src/pages/[locale]/checkout.tsx`)
- Product catalog → Subscribe form: renders form (evidence: `src/pages/[locale]/index.tsx`)
- Product catalog → Navigation and cart: renders navigation (evidence: `src/pages/[locale]/index.tsx`)
- Product catalog → Footer: renders footer (evidence: `src/pages/[locale]/index.tsx`)
- Navigation and cart → Cart state and API: reads cart count (evidence: `src/components/Navbar.tsx`)
- Navigation and cart → Language switch: renders switch (evidence: `src/components/Navbar.tsx`)
- Language switch → Language detection: detects language (evidence: `src/components/LanguageSwitchButton.tsx`)
- Language switch → Locale state: reads locale (evidence: `src/components/LanguageSwitchButton.tsx`)
- Locale state → Language detection: detects language (evidence: `src/context/locale-provider.tsx`)
- Locale redirect → Language detection: detects and caches (evidence: `src/lib/redirect.js`)
- Static translations → i18n configuration: uses locales (evidence: `src/lib/getStatic.js`)
- Product detail → Static translations: loads translations (evidence: `src/pages/[locale]/products/[handle].tsx`)
- Checkout → Static translations: loads translations (evidence: `src/pages/[locale]/checkout.tsx`)
- Order history → Cart state and API: uses cart state (evidence: `src/pages/[locale]/orders/index.tsx`)
- About and policies → Navigation and cart: renders navigation (evidence: `src/pages/[locale]/about.tsx`)
- About and policies → Footer: renders footer (evidence: `src/pages/[locale]/about.tsx`)
