# moemenakari/livrelb architecture

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

- Interactive diagram: https://gitdiagram.com/moemenakari/livrelb
- Repository: https://github.com/moemenakari/livrelb

## Overview

LIVRE is a bilingual, mobile-first personalized-jewelry storefront with a Lebanese Lira collection and an admin panel. The main customer journey is browsing products, personalizing a design, adding it to a cart, and checking out; the repository also includes order tracking and account features. The catalog can read from Supabase or fall back to sample data. The graph preserves documented preview, coin, administration, analytics, and push capabilities. Some routes and actions were not sampled, so unverified workflow links are dashed rather than asserted as source-confirmed calls.

Main entry points: [`src/app/[locale]`](https://github.com/moemenakari/livrelb/tree/main/src/app/%5Blocale%5D) (Storefront pages), [`src/lib/catalog`](https://github.com/moemenakari/livrelb/tree/main/src/lib/catalog) (Catalog service), [`src/lib/admin/product-actions.ts`](https://github.com/moemenakari/livrelb/blob/main/src/lib/admin/product-actions.ts) (Product actions), [`src/app/[locale]/product`](https://github.com/moemenakari/livrelb/tree/main/src/app/%5Blocale%5D/product) (Product browsing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_storefront["Storefront pages"]
  node_product["Product browsing"]
  node_namepreview["Name preview<br/>[name-preview.tsx]"]
  node_coin["Lira coin scene<br/>[coin-scene.tsx]"]
end

subgraph group_commerce["Shopping"]
  node_cart["Cart<br/>[cart-contents.tsx]"]
  node_checkout["Checkout<br/>[checkout-form.tsx]"]
  node_checkoutlogic["Checkout actions<br/>[actions.ts]"]
  node_tracking["Order tracking<br/>[tracking.ts]"]
end

subgraph group_operations["Administration"]
  node_admin["Admin panel"]
  node_adminactions["Product actions<br/>[product-actions.ts]"]
  node_media["Media manager<br/>[media-manager.tsx]"]
end

subgraph group_platform["Data and services"]
  node_catalog["Catalog service"]
  node_supabase[("Supabase")]
  node_sample["Sample catalog"]
  node_r2[("Cloudflare R2<br/>[r2.ts]")]
  node_analytics["Analytics"]
  node_push["Push notifications<br/>[notify.ts]"]
  node_whatsapp["WhatsApp routing<br/>[route.ts]"]
  node_locale["Locale routing<br/>[routing.ts]"]
end

node_customer(("Shopper"))

node_customer -->|"browses"| node_storefront
node_storefront -->|"reads catalog"| node_catalog
node_catalog -->|"reads data"| node_supabase
node_catalog -->|"falls back"| node_sample
node_storefront -.->|"opens products"| node_product
node_product -.->|"previews name"| node_namepreview
node_storefront -->|"shows coin"| node_coin
node_customer -.->|"adds items"| node_cart
node_cart -.->|"starts checkout"| node_checkout
node_checkout -.->|"submits order"| node_checkoutlogic
node_checkoutlogic -.->|"persists order"| node_supabase
node_customer -.->|"tracks order"| node_tracking
node_admin -.->|"manages products"| node_adminactions
node_media -->|"requests upload"| node_adminactions
node_adminactions -->|"uses uploads"| node_r2
node_storefront -.->|"reports events"| node_analytics
node_storefront -.->|"uses notifications"| node_push
node_storefront -.->|"resolves contact"| node_whatsapp
node_storefront -.->|"routes locale"| node_locale

click node_storefront "https://github.com/moemenakari/livrelb/tree/main/src/app/%5Blocale%5D"
click node_product "https://github.com/moemenakari/livrelb/tree/main/src/app/%5Blocale%5D/product"
click node_catalog "https://github.com/moemenakari/livrelb/tree/main/src/lib/catalog"
click node_sample "https://github.com/moemenakari/livrelb/tree/main/src/lib/catalog"
click node_namepreview "https://github.com/moemenakari/livrelb/blob/main/src/components/preview/name-preview.tsx"
click node_coin "https://github.com/moemenakari/livrelb/blob/main/src/components/coin/coin-scene.tsx"
click node_cart "https://github.com/moemenakari/livrelb/blob/main/src/components/cart/cart-contents.tsx"
click node_checkout "https://github.com/moemenakari/livrelb/blob/main/src/components/checkout/checkout-form.tsx"
click node_checkoutlogic "https://github.com/moemenakari/livrelb/blob/main/src/lib/checkout/actions.ts"
click node_tracking "https://github.com/moemenakari/livrelb/blob/main/src/lib/checkout/tracking.ts"
click node_admin "https://github.com/moemenakari/livrelb/tree/main/src/app/admin/(panel)"
click node_adminactions "https://github.com/moemenakari/livrelb/blob/main/src/lib/admin/product-actions.ts"
click node_media "https://github.com/moemenakari/livrelb/blob/main/src/components/admin/media-manager.tsx"
click node_r2 "https://github.com/moemenakari/livrelb/blob/main/src/lib/storage/r2.ts"
click node_analytics "https://github.com/moemenakari/livrelb/tree/main/src/lib/analytics"
click node_push "https://github.com/moemenakari/livrelb/blob/main/src/lib/push/notify.ts"
click node_whatsapp "https://github.com/moemenakari/livrelb/blob/main/src/app/api/whatsapp/route.ts"
click node_locale "https://github.com/moemenakari/livrelb/blob/main/src/i18n/routing.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_storefront,node_product,node_namepreview,node_coin toneBlue
class node_cart,node_checkout,node_checkoutlogic,node_tracking toneAmber
class node_admin,node_adminactions,node_media toneMint
class node_catalog,node_supabase,node_sample,node_r2,node_analytics,node_push,node_whatsapp,node_locale toneRose
class node_customer toneIndigo
```

## Components

### Storefront

- [Storefront pages](https://github.com/moemenakari/livrelb/tree/main/src/app/%5Blocale%5D): `src/app/[locale]`
- [Product browsing](https://github.com/moemenakari/livrelb/tree/main/src/app/%5Blocale%5D/product): `src/app/[locale]/product`
- [Name preview](https://github.com/moemenakari/livrelb/blob/main/src/components/preview/name-preview.tsx): `src/components/preview/name-preview.tsx`
- [Lira coin scene](https://github.com/moemenakari/livrelb/blob/main/src/components/coin/coin-scene.tsx): `src/components/coin/coin-scene.tsx`

### Shopping

- [Cart](https://github.com/moemenakari/livrelb/blob/main/src/components/cart/cart-contents.tsx): `src/components/cart/cart-contents.tsx`
- [Checkout](https://github.com/moemenakari/livrelb/blob/main/src/components/checkout/checkout-form.tsx): `src/components/checkout/checkout-form.tsx`
- [Checkout actions](https://github.com/moemenakari/livrelb/blob/main/src/lib/checkout/actions.ts): `src/lib/checkout/actions.ts`
- [Order tracking](https://github.com/moemenakari/livrelb/blob/main/src/lib/checkout/tracking.ts): `src/lib/checkout/tracking.ts`

### Administration

- [Admin panel](https://github.com/moemenakari/livrelb/tree/main/src/app/admin/(panel)): `src/app/admin/(panel)`
- [Product actions](https://github.com/moemenakari/livrelb/blob/main/src/lib/admin/product-actions.ts): `src/lib/admin/product-actions.ts`
- [Media manager](https://github.com/moemenakari/livrelb/blob/main/src/components/admin/media-manager.tsx): `src/components/admin/media-manager.tsx`

### Data and services

- [Catalog service](https://github.com/moemenakari/livrelb/tree/main/src/lib/catalog): `src/lib/catalog`
- **Supabase**
- [Sample catalog](https://github.com/moemenakari/livrelb/tree/main/src/lib/catalog): `src/lib/catalog`
- [Cloudflare R2](https://github.com/moemenakari/livrelb/blob/main/src/lib/storage/r2.ts): `src/lib/storage/r2.ts`
- [Analytics](https://github.com/moemenakari/livrelb/tree/main/src/lib/analytics): `src/lib/analytics`
- [Push notifications](https://github.com/moemenakari/livrelb/blob/main/src/lib/push/notify.ts): `src/lib/push/notify.ts`
- [WhatsApp routing](https://github.com/moemenakari/livrelb/blob/main/src/app/api/whatsapp/route.ts): `src/app/api/whatsapp/route.ts`
- [Locale routing](https://github.com/moemenakari/livrelb/blob/main/src/i18n/routing.ts): `src/i18n/routing.ts`

### Other components

- **Shopper**

## Connections

- Shopper → Storefront pages: browses (evidence: `README.md`)
- Storefront pages → Catalog service: reads catalog (evidence: `README.md`)
- Catalog service → Supabase: reads data (evidence: `README.md`)
- Catalog service → Sample catalog: falls back (evidence: `README.md`)
- Storefront pages → Product browsing: opens products
- Product browsing → Name preview: previews name
- Storefront pages → Lira coin scene: shows coin (evidence: `README.md`)
- Shopper → Cart: adds items
- Cart → Checkout: starts checkout
- Checkout → Checkout actions: submits order
- Checkout actions → Supabase: persists order
- Shopper → Order tracking: tracks order
- Admin panel → Product actions: manages products
- Media manager → Product actions: requests upload (evidence: `src/components/admin/media-manager.tsx`)
- Product actions → Cloudflare R2: uses uploads (evidence: `src/lib/admin/product-actions.ts`)
- Storefront pages → Analytics: reports events
- Storefront pages → Push notifications: uses notifications
- Storefront pages → WhatsApp routing: resolves contact
- Storefront pages → Locale routing: routes locale
