# mkasirloo/digishop-nextjs architecture

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

- Interactive diagram: https://gitdiagram.com/mkasirloo/digishop-nextjs
- Repository: https://github.com/mkasirloo/digishop-nextjs

## Overview

DigiShop is a Persian RTL storefront whose main journey is product discovery, product detail, cart, shipping, and payment, with separate login, profile, and admin experiences. The graph preserves README-described capabilities and substantial indexed modules; some route internals were not sampled, so uncertain checkout transitions are dashed and uncited.

Main entry points: [`app/lib/searchProducts.ts`](https://github.com/mkasirloo/digishop-nextjs/blob/main/app/lib/searchProducts.ts) (Product search), [`app/(main)/page.tsx`](https://github.com/mkasirloo/digishop-nextjs/blob/main/app/(main)/page.tsx) (Home discovery), [`app/(main)/products/page.tsx`](https://github.com/mkasirloo/digishop-nextjs/blob/main/app/(main)/products/page.tsx) (Product catalog), [`app/(main)/products/[id]/page.tsx`](https://github.com/mkasirloo/digishop-nextjs/blob/main/app/(main)/products/%5Bid%5D/page.tsx) (Product detail)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_home["Home discovery<br/>[page.tsx]"]
  node_catalog["Product catalog<br/>[page.tsx]"]
  node_filters["Catalog filters<br/>[ProductsFilter.tsx]"]
  node_productgrid["Product grid<br/>[ProductsGrid.tsx]"]
  node_productcard["Product card<br/>[ProductCard.tsx]"]
  node_detail["Product detail<br/>[page.tsx]"]
  node_searchbar["Search bar<br/>[SearchBar.tsx]"]
  node_search["Product search<br/>[searchProducts.ts]"]
  node_products["Product data<br/>[products.ts]"]
  node_categories["Category data<br/>[categories.ts]"]
  node_brands["Brand data<br/>[brands.ts]"]
end

subgraph group_checkout["Checkout"]
  node_cart["Cart<br/>[page.tsx]"]
  node_shipping["Shipping selection<br/>[page.tsx]"]
  node_addresses["Address data<br/>[addresses.ts]"]
  node_payment["Payment<br/>[page.tsx]"]
  node_success["Payment confirmation<br/>[page.tsx]"]
end

subgraph group_accounts["Accounts"]
  node_login["Login<br/>[page.tsx]"]
  node_verification["Verification<br/>[page.tsx]"]
  node_authstate["Auth state<br/>[authStore.ts]"]
  node_profile["Customer profile"]
  node_profileorders["Profile orders<br/>[page.tsx]"]
  node_ordersdata["Order data<br/>[orders.ts]"]
end

subgraph group_operations["Store Operations"]
  node_admincatalog["Admin catalog<br/>[page.tsx]"]
  node_createproduct["Create product<br/>[page.tsx]"]
  node_editform["Product editor<br/>[EditForm.tsx]"]
  node_actions["Product actions<br/>[actions.ts]"]
end

node_shopper(("Shopper"))

node_shopper -->|"browses"| node_home
node_shopper -->|"browses"| node_catalog
node_home -->|"renders categories"| node_categories
node_home -->|"renders brands"| node_brands
node_catalog -->|"renders filters"| node_filters
node_catalog -->|"renders grid"| node_productgrid
node_productgrid -->|"renders cards"| node_productcard
node_searchbar -->|"searches"| node_search
node_search -->|"filters products"| node_products
node_search -->|"matches categories"| node_categories
node_filters -->|"filters products"| node_search
node_shopper -->|"opens product"| node_detail
node_detail -->|"reads product"| node_products
node_detail -->|"reads brand"| node_brands
node_shopper -->|"shops"| node_cart
node_cart -.->|"continues checkout"| node_shipping
node_shipping -->|"reads addresses"| node_addresses
node_shipping -.->|"continues checkout"| node_payment
node_payment -.->|"confirms payment"| node_success
node_shopper -->|"signs in"| node_login
node_login -->|"links to"| node_verification
node_verification -->|"updates auth state"| node_authstate
node_shopper -->|"manages account"| node_profile
node_profile -.->|"views orders"| node_profileorders
node_profileorders -.->|"reads orders"| node_ordersdata
node_admincatalog -->|"searches products"| node_search
node_createproduct -->|"submits action"| node_actions
node_actions -->|"uses product data"| node_products
node_admincatalog -->|"links editor"| node_editform
node_editform -->|"uses categories"| node_categories

click node_home "https://github.com/mkasirloo/digishop-nextjs/blob/main/app/(main)/page.tsx"
click node_catalog "https://github.com/mkasirloo/digishop-nextjs/blob/main/app/(main)/products/page.tsx"
click node_filters "https://github.com/mkasirloo/digishop-nextjs/blob/main/components/ProductsFilter.tsx"
click node_productgrid "https://github.com/mkasirloo/digishop-nextjs/blob/main/components/ProductsGrid.tsx"
click node_productcard "https://github.com/mkasirloo/digishop-nextjs/blob/main/components/ProductCard.tsx"
click node_detail "https://github.com/mkasirloo/digishop-nextjs/blob/main/app/(main)/products/%5Bid%5D/page.tsx"
click node_searchbar "https://github.com/mkasirloo/digishop-nextjs/blob/main/components/UI/Header/SearchBar.tsx"
click node_search "https://github.com/mkasirloo/digishop-nextjs/blob/main/app/lib/searchProducts.ts"
click node_products "https://github.com/mkasirloo/digishop-nextjs/blob/main/app/data/products.ts"
click node_categories "https://github.com/mkasirloo/digishop-nextjs/blob/main/app/data/categories.ts"
click node_brands "https://github.com/mkasirloo/digishop-nextjs/blob/main/app/data/brands.ts"
click node_cart "https://github.com/mkasirloo/digishop-nextjs/blob/main/app/(main)/(checkout)/cart/page.tsx"
click node_shipping "https://github.com/mkasirloo/digishop-nextjs/blob/main/app/(main)/(checkout)/shipping/page.tsx"
click node_addresses "https://github.com/mkasirloo/digishop-nextjs/blob/main/app/data/addresses.ts"
click node_payment "https://github.com/mkasirloo/digishop-nextjs/blob/main/app/(main)/(checkout)/payment/page.tsx"
click node_success "https://github.com/mkasirloo/digishop-nextjs/blob/main/app/(main)/(checkout)/payment-succeed/page.tsx"
click node_login "https://github.com/mkasirloo/digishop-nextjs/blob/main/app/(auth)/login/page.tsx"
click node_verification "https://github.com/mkasirloo/digishop-nextjs/blob/main/app/(auth)/verification/page.tsx"
click node_authstate "https://github.com/mkasirloo/digishop-nextjs/blob/main/app/stores/authStore.ts"
click node_profile "https://github.com/mkasirloo/digishop-nextjs/tree/main/app/(main)/profile"
click node_profileorders "https://github.com/mkasirloo/digishop-nextjs/blob/main/app/(main)/profile/orders/page.tsx"
click node_admincatalog "https://github.com/mkasirloo/digishop-nextjs/blob/main/app/admin/products/page.tsx"
click node_createproduct "https://github.com/mkasirloo/digishop-nextjs/blob/main/app/admin/products/create/page.tsx"
click node_editform "https://github.com/mkasirloo/digishop-nextjs/blob/main/app/admin/products/%5Bid%5D/edit/EditForm.tsx"
click node_actions "https://github.com/mkasirloo/digishop-nextjs/blob/main/app/lib/actions.ts"
click node_ordersdata "https://github.com/mkasirloo/digishop-nextjs/blob/main/app/data/orders.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_catalog,node_filters,node_productgrid,node_productcard,node_detail,node_searchbar,node_search,node_products,node_categories,node_brands toneBlue
class node_cart,node_shipping,node_addresses,node_payment,node_success toneAmber
class node_login,node_verification,node_authstate,node_profile,node_profileorders,node_ordersdata toneMint
class node_admincatalog,node_createproduct,node_editform,node_actions toneRose
class node_shopper toneIndigo
```

## Components

### Storefront

- [Home discovery](https://github.com/mkasirloo/digishop-nextjs/blob/main/app/(main)/page.tsx): `app/(main)/page.tsx`
- [Product catalog](https://github.com/mkasirloo/digishop-nextjs/blob/main/app/(main)/products/page.tsx): `app/(main)/products/page.tsx`
- [Catalog filters](https://github.com/mkasirloo/digishop-nextjs/blob/main/components/ProductsFilter.tsx): `components/ProductsFilter.tsx`
- [Product grid](https://github.com/mkasirloo/digishop-nextjs/blob/main/components/ProductsGrid.tsx): `components/ProductsGrid.tsx`
- [Product card](https://github.com/mkasirloo/digishop-nextjs/blob/main/components/ProductCard.tsx): `components/ProductCard.tsx`
- [Product detail](https://github.com/mkasirloo/digishop-nextjs/blob/main/app/(main)/products/%5Bid%5D/page.tsx): `app/(main)/products/[id]/page.tsx`
- [Search bar](https://github.com/mkasirloo/digishop-nextjs/blob/main/components/UI/Header/SearchBar.tsx): `components/UI/Header/SearchBar.tsx`
- [Product search](https://github.com/mkasirloo/digishop-nextjs/blob/main/app/lib/searchProducts.ts): `app/lib/searchProducts.ts`
- [Product data](https://github.com/mkasirloo/digishop-nextjs/blob/main/app/data/products.ts): `app/data/products.ts`
- [Category data](https://github.com/mkasirloo/digishop-nextjs/blob/main/app/data/categories.ts): `app/data/categories.ts`
- [Brand data](https://github.com/mkasirloo/digishop-nextjs/blob/main/app/data/brands.ts): `app/data/brands.ts`

### Checkout

- [Cart](https://github.com/mkasirloo/digishop-nextjs/blob/main/app/(main)/(checkout)/cart/page.tsx): `app/(main)/(checkout)/cart/page.tsx`
- [Shipping selection](https://github.com/mkasirloo/digishop-nextjs/blob/main/app/(main)/(checkout)/shipping/page.tsx): `app/(main)/(checkout)/shipping/page.tsx`
- [Address data](https://github.com/mkasirloo/digishop-nextjs/blob/main/app/data/addresses.ts): `app/data/addresses.ts`
- [Payment](https://github.com/mkasirloo/digishop-nextjs/blob/main/app/(main)/(checkout)/payment/page.tsx): `app/(main)/(checkout)/payment/page.tsx`
- [Payment confirmation](https://github.com/mkasirloo/digishop-nextjs/blob/main/app/(main)/(checkout)/payment-succeed/page.tsx): `app/(main)/(checkout)/payment-succeed/page.tsx`

### Accounts

- [Login](https://github.com/mkasirloo/digishop-nextjs/blob/main/app/(auth)/login/page.tsx): `app/(auth)/login/page.tsx`
- [Verification](https://github.com/mkasirloo/digishop-nextjs/blob/main/app/(auth)/verification/page.tsx): `app/(auth)/verification/page.tsx`
- [Auth state](https://github.com/mkasirloo/digishop-nextjs/blob/main/app/stores/authStore.ts): `app/stores/authStore.ts`
- [Customer profile](https://github.com/mkasirloo/digishop-nextjs/tree/main/app/(main)/profile): `app/(main)/profile`
- [Profile orders](https://github.com/mkasirloo/digishop-nextjs/blob/main/app/(main)/profile/orders/page.tsx): `app/(main)/profile/orders/page.tsx`
- [Order data](https://github.com/mkasirloo/digishop-nextjs/blob/main/app/data/orders.ts): `app/data/orders.ts`

### Store Operations

- [Admin catalog](https://github.com/mkasirloo/digishop-nextjs/blob/main/app/admin/products/page.tsx): `app/admin/products/page.tsx`
- [Create product](https://github.com/mkasirloo/digishop-nextjs/blob/main/app/admin/products/create/page.tsx): `app/admin/products/create/page.tsx`
- [Product editor](https://github.com/mkasirloo/digishop-nextjs/blob/main/app/admin/products/%5Bid%5D/edit/EditForm.tsx): `app/admin/products/[id]/edit/EditForm.tsx`
- [Product actions](https://github.com/mkasirloo/digishop-nextjs/blob/main/app/lib/actions.ts): `app/lib/actions.ts`

### Other components

- **Shopper**

## Connections

- Shopper → Home discovery: browses (evidence: `README.md`)
- Shopper → Product catalog: browses (evidence: `README.md`)
- Home discovery → Category data: renders categories (evidence: `app/(main)/page.tsx`)
- Home discovery → Brand data: renders brands (evidence: `app/(main)/page.tsx`)
- Product catalog → Catalog filters: renders filters (evidence: `app/(main)/products/page.tsx`)
- Product catalog → Product grid: renders grid (evidence: `app/(main)/products/page.tsx`)
- Product grid → Product card: renders cards (evidence: `components/ProductsGrid.tsx`)
- Search bar → Product search: searches (evidence: `components/UI/Header/SearchBar.tsx`)
- Product search → Product data: filters products (evidence: `app/lib/searchProducts.ts`)
- Product search → Category data: matches categories (evidence: `app/lib/searchProducts.ts`)
- Catalog filters → Product search: filters products (evidence: `components/ProductsFilter.tsx`)
- Shopper → Product detail: opens product (evidence: `README.md`)
- Product detail → Product data: reads product (evidence: `app/(main)/products/[id]/page.tsx`)
- Product detail → Brand data: reads brand (evidence: `app/(main)/products/[id]/page.tsx`)
- Shopper → Cart: shops (evidence: `README.md`)
- Cart → Shipping selection: continues checkout
- Shipping selection → Address data: reads addresses (evidence: `app/(main)/(checkout)/shipping/page.tsx`)
- Shipping selection → Payment: continues checkout
- Payment → Payment confirmation: confirms payment
- Shopper → Login: signs in (evidence: `README.md`)
- Login → Verification: links to (evidence: `app/(auth)/login/page.tsx`)
- Verification → Auth state: updates auth state (evidence: `app/(auth)/verification/page.tsx`)
- Shopper → Customer profile: manages account (evidence: `README.md`)
- Customer profile → Profile orders: views orders
- Profile orders → Order data: reads orders
- Admin catalog → Product search: searches products (evidence: `app/admin/products/page.tsx`)
- Create product → Product actions: submits action (evidence: `app/admin/products/create/page.tsx`)
- Product actions → Product data: uses product data (evidence: `app/lib/actions.ts`)
- Admin catalog → Product editor: links editor
- Product editor → Category data: uses categories (evidence: `app/admin/products/[id]/edit/EditForm.tsx`)
