# ganeshnil/vivo_store_website architecture

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

- Interactive diagram: https://gitdiagram.com/ganeshnil/vivo_store_website
- Repository: https://github.com/ganeshnil/vivo_store_website

## Overview

Galaxy Mobile Gallery is a storefront and admin-managed product catalog for phones and accessories. Customers browse collections, compare products, and view product details; administrators manage catalog data, offers, stock, prices, settings, and operational records. The shared store context is a central application-state layer, while API routes provide admin authentication and synchronized live state. The README is empty, so the map relies on the supplied source index and excerpts; some page-to-client and subsystem links are supported by index references rather than complete source excerpts.

Main entry points: [`src/lib/store/store-context.tsx`](https://github.com/ganeshnil/vivo_store_website/blob/main/src/lib/store/store-context.tsx) (Shared store state), [`src/components/customer/HomePageClient.tsx`](https://github.com/ganeshnil/vivo_store_website/blob/main/src/components/customer/HomePageClient.tsx) (Home experience), [`src/components/customer/StoreClient.tsx`](https://github.com/ganeshnil/vivo_store_website/blob/main/src/components/customer/StoreClient.tsx) (Store directory), [`src/components/customer/ProductDetailClient.tsx`](https://github.com/ganeshnil/vivo_store_website/blob/main/src/components/customer/ProductDetailClient.tsx) (Product details)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_customer["Customer storefront"]
  node_home["Home experience<br/>[HomePageClient.tsx]"]
  node_collections["Product collections<br/>[MobilesClient.tsx]"]
  node_storefront["Store directory<br/>[StoreClient.tsx]"]
  node_productdetail["Product details"]
  node_compare["Product comparison<br/>[CompareClient.tsx]"]
  node_productcard["Product card<br/>[ProductCard.tsx]"]
  node_search["Quick search"]
end

subgraph group_admin["Store administration"]
  node_admincatalog["Catalog management<br/>[page.tsx]"]
  node_adminoffers["Offer management<br/>[page.tsx]"]
  node_inventory["Inventory management<br/>[page.tsx]"]
  node_pricing["Price management<br/>[page.tsx]"]
  node_adminops["Store operations<br/>[page.tsx]"]
  node_notify["Stock notifications<br/>[page.tsx]"]
end

subgraph group_state["Catalog and state"]
  node_statecontext["Shared store state<br/>[store-context.tsx]"]
  node_seed["Initial catalog data<br/>[seed-data.ts]"]
  node_types["Domain types<br/>[index.ts]"]
  node_schema["Category specifications"]
  node_productdata["Server product data<br/>[products-server.ts]"]
end

subgraph group_services["API and integrations"]
  node_authapi["Admin sign-in API<br/>[route.ts]"]
  node_auth["Admin session checks<br/>[admin.ts]"]
  node_syncapi["Live-state API<br/>[route.ts]"]
  node_seo["SEO metadata<br/>[config.ts]"]
end

node_shopper(("Shopper"))
node_adminuser(("Administrator"))
node_database[("Supabase database")]

node_shopper -->|"opens"| node_home
node_shopper -->|"browses"| node_collections
node_shopper -->|"finds stores"| node_storefront
node_shopper -->|"views"| node_productdetail
node_shopper -.->|"compares"| node_compare
node_home -->|"reads catalog"| node_statecontext
node_home -->|"renders"| node_productcard
node_collections -->|"reads catalog"| node_statecontext
node_collections -->|"renders"| node_productcard
node_storefront -->|"reads state"| node_statecontext
node_productdetail -->|"reads product"| node_statecontext
node_productdetail -->|"renders related"| node_productcard
node_compare -->|"reads products"| node_statecontext
node_search -->|"searches catalog"| node_statecontext
node_adminuser -->|"manages catalog"| node_admincatalog
node_adminuser -->|"manages offers"| node_adminoffers
node_adminuser -->|"manages stock"| node_inventory
node_adminuser -->|"manages prices"| node_pricing
node_adminuser -->|"reviews logs"| node_adminops
node_adminuser -->|"reviews requests"| node_notify
node_admincatalog -->|"updates catalog"| node_statecontext
node_admincatalog -->|"validates categories"| node_schema
node_adminoffers -->|"updates offers"| node_statecontext
node_inventory -->|"updates stock"| node_statecontext
node_pricing -->|"updates prices"| node_statecontext
node_adminops -->|"reads logs"| node_statecontext
node_notify -->|"reads requests"| node_statecontext
node_statecontext -->|"loads defaults"| node_seed
node_statecontext -->|"uses types"| node_types
node_authapi -->|"validates credentials"| node_auth
node_syncapi -->|"checks admin"| node_auth
node_syncapi -->|"reads and writes"| node_database
node_storefront -->|"loads products"| node_productdata
node_productdata -.->|"uses catalog defaults"| node_seed
node_home -->|"uses metadata"| node_seo
node_productdetail -->|"uses metadata"| node_seo
node_storefront -->|"uses metadata"| node_seo

click node_home "https://github.com/ganeshnil/vivo_store_website/blob/main/src/components/customer/HomePageClient.tsx"
click node_collections "https://github.com/ganeshnil/vivo_store_website/blob/main/src/components/customer/MobilesClient.tsx"
click node_storefront "https://github.com/ganeshnil/vivo_store_website/blob/main/src/components/customer/StoreClient.tsx"
click node_productdetail "https://github.com/ganeshnil/vivo_store_website/blob/main/src/components/customer/ProductDetailClient.tsx"
click node_compare "https://github.com/ganeshnil/vivo_store_website/blob/main/src/components/customer/CompareClient.tsx"
click node_productcard "https://github.com/ganeshnil/vivo_store_website/blob/main/src/components/customer/ProductCard.tsx"
click node_search "https://github.com/ganeshnil/vivo_store_website/blob/main/src/components/common/QuickSearchModal.tsx"
click node_admincatalog "https://github.com/ganeshnil/vivo_store_website/blob/main/src/app/admin/products/page.tsx"
click node_adminoffers "https://github.com/ganeshnil/vivo_store_website/blob/main/src/app/admin/offers/page.tsx"
click node_inventory "https://github.com/ganeshnil/vivo_store_website/blob/main/src/app/admin/inventory/page.tsx"
click node_pricing "https://github.com/ganeshnil/vivo_store_website/blob/main/src/app/admin/prices/page.tsx"
click node_adminops "https://github.com/ganeshnil/vivo_store_website/blob/main/src/app/admin/audit-logs/page.tsx"
click node_notify "https://github.com/ganeshnil/vivo_store_website/blob/main/src/app/admin/notify-requests/page.tsx"
click node_statecontext "https://github.com/ganeshnil/vivo_store_website/blob/main/src/lib/store/store-context.tsx"
click node_seed "https://github.com/ganeshnil/vivo_store_website/blob/main/src/lib/data/seed-data.ts"
click node_types "https://github.com/ganeshnil/vivo_store_website/blob/main/src/lib/types/index.ts"
click node_schema "https://github.com/ganeshnil/vivo_store_website/blob/main/src/lib/data/category-specs-schema.ts"
click node_productdata "https://github.com/ganeshnil/vivo_store_website/blob/main/src/lib/data/products-server.ts"
click node_authapi "https://github.com/ganeshnil/vivo_store_website/blob/main/src/app/api/auth/admin/route.ts"
click node_auth "https://github.com/ganeshnil/vivo_store_website/blob/main/src/lib/auth/admin.ts"
click node_syncapi "https://github.com/ganeshnil/vivo_store_website/blob/main/src/app/api/sync/route.ts"
click node_seo "https://github.com/ganeshnil/vivo_store_website/blob/main/src/lib/seo/config.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_collections,node_storefront,node_productdetail,node_compare,node_productcard,node_search toneBlue
class node_admincatalog,node_adminoffers,node_inventory,node_pricing,node_adminops,node_notify,node_database toneAmber
class node_statecontext,node_seed,node_types,node_schema,node_productdata toneMint
class node_authapi,node_auth,node_syncapi,node_seo toneRose
class node_shopper,node_adminuser toneIndigo
```

## Components

### Customer storefront

- [Home experience](https://github.com/ganeshnil/vivo_store_website/blob/main/src/components/customer/HomePageClient.tsx): `src/components/customer/HomePageClient.tsx`
- [Product collections](https://github.com/ganeshnil/vivo_store_website/blob/main/src/components/customer/MobilesClient.tsx): `src/components/customer/MobilesClient.tsx`
- [Store directory](https://github.com/ganeshnil/vivo_store_website/blob/main/src/components/customer/StoreClient.tsx): `src/components/customer/StoreClient.tsx`
- [Product details](https://github.com/ganeshnil/vivo_store_website/blob/main/src/components/customer/ProductDetailClient.tsx): `src/components/customer/ProductDetailClient.tsx`
- [Product comparison](https://github.com/ganeshnil/vivo_store_website/blob/main/src/components/customer/CompareClient.tsx): `src/components/customer/CompareClient.tsx`
- [Product card](https://github.com/ganeshnil/vivo_store_website/blob/main/src/components/customer/ProductCard.tsx): `src/components/customer/ProductCard.tsx`
- [Quick search](https://github.com/ganeshnil/vivo_store_website/blob/main/src/components/common/QuickSearchModal.tsx): `src/components/common/QuickSearchModal.tsx`

### Store administration

- [Catalog management](https://github.com/ganeshnil/vivo_store_website/blob/main/src/app/admin/products/page.tsx): `src/app/admin/products/page.tsx`
- [Offer management](https://github.com/ganeshnil/vivo_store_website/blob/main/src/app/admin/offers/page.tsx): `src/app/admin/offers/page.tsx`
- [Inventory management](https://github.com/ganeshnil/vivo_store_website/blob/main/src/app/admin/inventory/page.tsx): `src/app/admin/inventory/page.tsx`
- [Price management](https://github.com/ganeshnil/vivo_store_website/blob/main/src/app/admin/prices/page.tsx): `src/app/admin/prices/page.tsx`
- [Store operations](https://github.com/ganeshnil/vivo_store_website/blob/main/src/app/admin/audit-logs/page.tsx): `src/app/admin/audit-logs/page.tsx`
- [Stock notifications](https://github.com/ganeshnil/vivo_store_website/blob/main/src/app/admin/notify-requests/page.tsx): `src/app/admin/notify-requests/page.tsx`

### Catalog and state

- [Shared store state](https://github.com/ganeshnil/vivo_store_website/blob/main/src/lib/store/store-context.tsx): `src/lib/store/store-context.tsx`
- [Initial catalog data](https://github.com/ganeshnil/vivo_store_website/blob/main/src/lib/data/seed-data.ts): `src/lib/data/seed-data.ts`
- [Domain types](https://github.com/ganeshnil/vivo_store_website/blob/main/src/lib/types/index.ts): `src/lib/types/index.ts`
- [Category specifications](https://github.com/ganeshnil/vivo_store_website/blob/main/src/lib/data/category-specs-schema.ts): `src/lib/data/category-specs-schema.ts`
- [Server product data](https://github.com/ganeshnil/vivo_store_website/blob/main/src/lib/data/products-server.ts): `src/lib/data/products-server.ts`

### API and integrations

- [Admin sign-in API](https://github.com/ganeshnil/vivo_store_website/blob/main/src/app/api/auth/admin/route.ts): `src/app/api/auth/admin/route.ts`
- [Admin session checks](https://github.com/ganeshnil/vivo_store_website/blob/main/src/lib/auth/admin.ts): `src/lib/auth/admin.ts`
- [Live-state API](https://github.com/ganeshnil/vivo_store_website/blob/main/src/app/api/sync/route.ts): `src/app/api/sync/route.ts`
- [SEO metadata](https://github.com/ganeshnil/vivo_store_website/blob/main/src/lib/seo/config.ts): `src/lib/seo/config.ts`

### Other components

- **Shopper**
- **Administrator**
- **Supabase database**

## Connections

- Shopper → Home experience: opens
- Shopper → Product collections: browses (evidence: `src/components/customer/MobilesClient.tsx`)
- Shopper → Store directory: finds stores
- Shopper → Product details: views
- Shopper → Product comparison: compares
- Home experience → Shared store state: reads catalog (evidence: `src/components/customer/HomePageClient.tsx`)
- Home experience → Product card: renders (evidence: `src/components/customer/HomePageClient.tsx`)
- Product collections → Shared store state: reads catalog (evidence: `src/components/customer/MobilesClient.tsx`)
- Product collections → Product card: renders (evidence: `src/components/customer/MobilesClient.tsx`)
- Store directory → Shared store state: reads state (evidence: `src/components/customer/StoreClient.tsx`)
- Product details → Shared store state: reads product (evidence: `src/components/customer/ProductDetailClient.tsx`)
- Product details → Product card: renders related (evidence: `src/components/customer/ProductDetailClient.tsx`)
- Product comparison → Shared store state: reads products (evidence: `src/components/customer/CompareClient.tsx`)
- Quick search → Shared store state: searches catalog (evidence: `src/components/common/QuickSearchModal.tsx`)
- Administrator → Catalog management: manages catalog (evidence: `src/app/admin/products/page.tsx`)
- Administrator → Offer management: manages offers (evidence: `src/app/admin/offers/page.tsx`)
- Administrator → Inventory management: manages stock (evidence: `src/app/admin/inventory/page.tsx`)
- Administrator → Price management: manages prices (evidence: `src/app/admin/prices/page.tsx`)
- Administrator → Store operations: reviews logs (evidence: `src/app/admin/audit-logs/page.tsx`)
- Administrator → Stock notifications: reviews requests (evidence: `src/app/admin/notify-requests/page.tsx`)
- Catalog management → Shared store state: updates catalog (evidence: `src/app/admin/products/page.tsx`)
- Catalog management → Category specifications: validates categories (evidence: `src/app/admin/products/page.tsx`)
- Offer management → Shared store state: updates offers (evidence: `src/app/admin/offers/page.tsx`)
- Inventory management → Shared store state: updates stock (evidence: `src/app/admin/inventory/page.tsx`)
- Price management → Shared store state: updates prices (evidence: `src/app/admin/prices/page.tsx`)
- Store operations → Shared store state: reads logs (evidence: `src/app/admin/audit-logs/page.tsx`)
- Stock notifications → Shared store state: reads requests (evidence: `src/app/admin/notify-requests/page.tsx`)
- Shared store state → Initial catalog data: loads defaults (evidence: `src/lib/store/store-context.tsx`)
- Shared store state → Domain types: uses types (evidence: `src/lib/store/store-context.tsx`)
- Admin sign-in API → Admin session checks: validates credentials (evidence: `src/app/api/auth/admin/route.ts`)
- Live-state API → Admin session checks: checks admin (evidence: `src/app/api/sync/route.ts`)
- Live-state API → Supabase database: reads and writes (evidence: `src/app/api/sync/route.ts`)
- Store directory → Server product data: loads products (evidence: `src/app/store/page.tsx`)
- Server product data → Initial catalog data: uses catalog defaults
- Home experience → SEO metadata: uses metadata (evidence: `src/app/page.tsx`)
- Product details → SEO metadata: uses metadata (evidence: `src/app/product/[slug]/page.tsx`)
- Store directory → SEO metadata: uses metadata (evidence: `src/app/store/page.tsx`)
