# prodromos522-bot/s architecture

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

- Interactive diagram: https://gitdiagram.com/prodromos522-bot/s
- Repository: https://github.com/prodromos522-bot/s

## Overview

SERVERA is an online beauty and fragrance shop. Shoppers browse the home, category, search, and product pages, add items to a persistent cart or wishlist, then submit checkout; checkout records orders locally and requests central order persistence. The account page exposes order/payment-related information, and PayPal has a separate integration path. The graph follows shown imports, calls, and documented route registration; unsampled route and integration internals are represented only where the source index supports them.

Main entry points: [`src/lib/products.ts`](https://github.com/prodromos522-bot/s/blob/main/src/lib/products.ts) (Product catalog), [`src/lib/cart.tsx`](https://github.com/prodromos522-bot/s/blob/main/src/lib/cart.tsx) (Cart and wishlist), [`src/routes/checkout.tsx`](https://github.com/prodromos522-bot/s/blob/main/src/routes/checkout.tsx) (Checkout), [`src/components/shop/ProductCard.tsx`](https://github.com/prodromos522-bot/s/blob/main/src/components/shop/ProductCard.tsx) (Product card)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_home["Home page<br/>[index.tsx]"]
  node_category["Category page<br/>[category.$slug.tsx]"]
  node_search["Search page<br/>[search.tsx]"]
  node_product_page["Product page<br/>[product.$id.tsx]"]
  node_account["Account page<br/>[account.tsx]"]
  node_wishlist["Wishlist page<br/>[wishlist.tsx]"]
  node_hero["Hero carousel<br/>[HeroCarousel.tsx]"]
end

subgraph group_catalog["Product discovery"]
  node_product_rail["Product rail<br/>[ProductRail.tsx]"]
  node_product_grid["Product grid<br/>[ProductGrid.tsx]"]
  node_product_data[("Product catalog<br/>[products.ts]")]
  node_product_card["Product card<br/>[ProductCard.tsx]"]
end

subgraph group_commerce["Cart and checkout"]
  node_cart_state["Cart and wishlist<br/>[cart.tsx]"]
  node_cart_sheet["Cart sheet<br/>[CartSheet.tsx]"]
  node_checkout["Checkout<br/>[checkout.tsx]"]
  node_paypal_button["PayPal button<br/>[PaypalButton.tsx]"]
end

subgraph group_services["Commerce services"]
  node_pricing["Pricing rules<br/>[pricing.ts]"]
  node_order_local["Local orders<br/>[orders.ts]"]
  node_order_server["Order persistence"]
  node_payment_methods["Payment methods<br/>[payments.ts]"]
  node_paypal_functions["PayPal functions"]
  node_supabase["Supabase client<br/>[supabase.server.ts]"]
end

subgraph group_shell["Application shell"]
  node_router["Router<br/>[router.tsx]"]
  node_site_shell["Site shell"]
  node_header["Site header<br/>[SiteHeader.tsx]"]
  node_footer["Site footer<br/>[SiteFooter.tsx]"]
end

node_shopper(("Shopper"))

node_router -->|"routes through"| node_site_shell
node_shopper -.->|"opens shop"| node_router
node_site_shell -->|"renders"| node_header
node_site_shell -->|"renders"| node_footer
node_site_shell -->|"renders"| node_cart_sheet
node_home -->|"renders"| node_hero
node_home -->|"renders"| node_product_rail
node_home -->|"reads"| node_product_data
node_category -->|"reads"| node_product_data
node_category -->|"renders"| node_product_grid
node_search -->|"reads"| node_product_data
node_search -->|"renders"| node_product_grid
node_product_page -->|"reads"| node_product_data
node_product_page -->|"renders"| node_product_rail
node_product_page -->|"uses badges"| node_product_card
node_product_rail -->|"reads"| node_product_data
node_product_rail -->|"renders"| node_product_card
node_product_card -->|"reads"| node_product_data
node_product_card -->|"updates"| node_cart_state
node_header -->|"reads"| node_cart_state
node_header -->|"reads"| node_product_data
node_cart_sheet -->|"reads and updates"| node_cart_state
node_cart_state -->|"resolves items"| node_product_data
node_cart_state -->|"computes totals"| node_pricing
node_cart_sheet -->|"formats totals"| node_pricing
node_wishlist -->|"renders"| node_product_card
node_wishlist -->|"reads"| node_cart_state
node_account -->|"reads"| node_order_local
node_account -->|"reads"| node_payment_methods
node_checkout -->|"reads and clears"| node_cart_state
node_checkout -->|"saves order"| node_order_local
node_checkout -->|"persists order"| node_order_server
node_checkout -->|"uses methods"| node_payment_methods
node_checkout -->|"formats totals"| node_pricing
node_checkout -->|"renders"| node_paypal_button
node_paypal_button -->|"invokes"| node_paypal_functions
node_order_server -->|"uses"| node_product_data
node_order_server -->|"uses"| node_pricing
node_order_server -->|"uses client"| node_supabase

click node_router "https://github.com/prodromos522-bot/s/blob/main/src/router.tsx"
click node_home "https://github.com/prodromos522-bot/s/blob/main/src/routes/index.tsx"
click node_category "https://github.com/prodromos522-bot/s/blob/main/src/routes/category.%24slug.tsx"
click node_search "https://github.com/prodromos522-bot/s/blob/main/src/routes/search.tsx"
click node_product_page "https://github.com/prodromos522-bot/s/blob/main/src/routes/product.%24id.tsx"
click node_account "https://github.com/prodromos522-bot/s/blob/main/src/routes/account.tsx"
click node_wishlist "https://github.com/prodromos522-bot/s/blob/main/src/routes/wishlist.tsx"
click node_hero "https://github.com/prodromos522-bot/s/blob/main/src/components/shop/HeroCarousel.tsx"
click node_product_rail "https://github.com/prodromos522-bot/s/blob/main/src/components/shop/ProductRail.tsx"
click node_product_grid "https://github.com/prodromos522-bot/s/blob/main/src/components/shop/ProductGrid.tsx"
click node_product_data "https://github.com/prodromos522-bot/s/blob/main/src/lib/products.ts"
click node_product_card "https://github.com/prodromos522-bot/s/blob/main/src/components/shop/ProductCard.tsx"
click node_cart_state "https://github.com/prodromos522-bot/s/blob/main/src/lib/cart.tsx"
click node_cart_sheet "https://github.com/prodromos522-bot/s/blob/main/src/components/shop/CartSheet.tsx"
click node_checkout "https://github.com/prodromos522-bot/s/blob/main/src/routes/checkout.tsx"
click node_pricing "https://github.com/prodromos522-bot/s/blob/main/src/lib/pricing.ts"
click node_order_local "https://github.com/prodromos522-bot/s/blob/main/src/lib/orders.ts"
click node_order_server "https://github.com/prodromos522-bot/s/blob/main/src/lib/orders.functions.ts"
click node_payment_methods "https://github.com/prodromos522-bot/s/blob/main/src/lib/payments.ts"
click node_paypal_button "https://github.com/prodromos522-bot/s/blob/main/src/components/shop/PaypalButton.tsx"
click node_paypal_functions "https://github.com/prodromos522-bot/s/blob/main/src/lib/paypal.functions.ts"
click node_supabase "https://github.com/prodromos522-bot/s/blob/main/src/lib/supabase.server.ts"
click node_header "https://github.com/prodromos522-bot/s/blob/main/src/components/shop/SiteHeader.tsx"
click node_footer "https://github.com/prodromos522-bot/s/blob/main/src/components/shop/SiteFooter.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_category,node_search,node_product_page,node_account,node_wishlist,node_hero toneBlue
class node_product_rail,node_product_grid,node_product_data,node_product_card toneAmber
class node_cart_state,node_cart_sheet,node_checkout,node_paypal_button toneMint
class node_pricing,node_order_local,node_order_server,node_payment_methods,node_paypal_functions,node_supabase toneRose
class node_router,node_site_shell,node_header,node_footer,node_shopper toneIndigo
```

## Components

### Storefront

- [Home page](https://github.com/prodromos522-bot/s/blob/main/src/routes/index.tsx): `src/routes/index.tsx`
- [Category page](https://github.com/prodromos522-bot/s/blob/main/src/routes/category.%24slug.tsx): `src/routes/category.$slug.tsx`
- [Search page](https://github.com/prodromos522-bot/s/blob/main/src/routes/search.tsx): `src/routes/search.tsx`
- [Product page](https://github.com/prodromos522-bot/s/blob/main/src/routes/product.%24id.tsx): `src/routes/product.$id.tsx`
- [Account page](https://github.com/prodromos522-bot/s/blob/main/src/routes/account.tsx): `src/routes/account.tsx`
- [Wishlist page](https://github.com/prodromos522-bot/s/blob/main/src/routes/wishlist.tsx): `src/routes/wishlist.tsx`
- [Hero carousel](https://github.com/prodromos522-bot/s/blob/main/src/components/shop/HeroCarousel.tsx): `src/components/shop/HeroCarousel.tsx`

### Product discovery

- [Product rail](https://github.com/prodromos522-bot/s/blob/main/src/components/shop/ProductRail.tsx): `src/components/shop/ProductRail.tsx`
- [Product grid](https://github.com/prodromos522-bot/s/blob/main/src/components/shop/ProductGrid.tsx): `src/components/shop/ProductGrid.tsx`
- [Product catalog](https://github.com/prodromos522-bot/s/blob/main/src/lib/products.ts): `src/lib/products.ts`
- [Product card](https://github.com/prodromos522-bot/s/blob/main/src/components/shop/ProductCard.tsx): `src/components/shop/ProductCard.tsx`

### Cart and checkout

- [Cart and wishlist](https://github.com/prodromos522-bot/s/blob/main/src/lib/cart.tsx): `src/lib/cart.tsx`
- [Cart sheet](https://github.com/prodromos522-bot/s/blob/main/src/components/shop/CartSheet.tsx): `src/components/shop/CartSheet.tsx`
- [Checkout](https://github.com/prodromos522-bot/s/blob/main/src/routes/checkout.tsx): `src/routes/checkout.tsx`
- [PayPal button](https://github.com/prodromos522-bot/s/blob/main/src/components/shop/PaypalButton.tsx): `src/components/shop/PaypalButton.tsx`

### Commerce services

- [Pricing rules](https://github.com/prodromos522-bot/s/blob/main/src/lib/pricing.ts): `src/lib/pricing.ts`
- [Local orders](https://github.com/prodromos522-bot/s/blob/main/src/lib/orders.ts): `src/lib/orders.ts`
- [Order persistence](https://github.com/prodromos522-bot/s/blob/main/src/lib/orders.functions.ts): `src/lib/orders.functions.ts`
- [Payment methods](https://github.com/prodromos522-bot/s/blob/main/src/lib/payments.ts): `src/lib/payments.ts`
- [PayPal functions](https://github.com/prodromos522-bot/s/blob/main/src/lib/paypal.functions.ts): `src/lib/paypal.functions.ts`
- [Supabase client](https://github.com/prodromos522-bot/s/blob/main/src/lib/supabase.server.ts): `src/lib/supabase.server.ts`

### Application shell

- [Router](https://github.com/prodromos522-bot/s/blob/main/src/router.tsx): `src/router.tsx`
- **Site shell**
- [Site header](https://github.com/prodromos522-bot/s/blob/main/src/components/shop/SiteHeader.tsx): `src/components/shop/SiteHeader.tsx`
- [Site footer](https://github.com/prodromos522-bot/s/blob/main/src/components/shop/SiteFooter.tsx): `src/components/shop/SiteFooter.tsx`

### Other components

- **Shopper**

## Connections

- Router → Site shell: routes through
- Shopper → Router: opens shop
- Site shell → Site header: renders
- Site shell → Site footer: renders
- Site shell → Cart sheet: renders
- Home page → Hero carousel: renders (evidence: `src/routes/index.tsx`)
- Home page → Product rail: renders (evidence: `src/routes/index.tsx`)
- Home page → Product catalog: reads (evidence: `src/routes/index.tsx`)
- Category page → Product catalog: reads (evidence: `src/routes/category.$slug.tsx`)
- Category page → Product grid: renders (evidence: `src/routes/category.$slug.tsx`)
- Search page → Product catalog: reads (evidence: `src/routes/search.tsx`)
- Search page → Product grid: renders (evidence: `src/routes/search.tsx`)
- Product page → Product catalog: reads (evidence: `src/routes/product.$id.tsx`)
- Product page → Product rail: renders (evidence: `src/routes/product.$id.tsx`)
- Product page → Product card: uses badges (evidence: `src/routes/product.$id.tsx`)
- Product rail → Product catalog: reads (evidence: `src/components/shop/ProductRail.tsx`)
- Product rail → Product card: renders (evidence: `src/components/shop/ProductRail.tsx`)
- Product card → Product catalog: reads (evidence: `src/components/shop/ProductCard.tsx`)
- Product card → Cart and wishlist: updates (evidence: `src/components/shop/ProductCard.tsx`)
- Site header → Cart and wishlist: reads (evidence: `src/components/shop/SiteHeader.tsx`)
- Site header → Product catalog: reads (evidence: `src/components/shop/SiteHeader.tsx`)
- Cart sheet → Cart and wishlist: reads and updates (evidence: `src/components/shop/CartSheet.tsx`)
- Cart and wishlist → Product catalog: resolves items (evidence: `src/lib/cart.tsx`)
- Cart and wishlist → Pricing rules: computes totals (evidence: `src/lib/cart.tsx`)
- Cart sheet → Pricing rules: formats totals (evidence: `src/components/shop/CartSheet.tsx`)
- Wishlist page → Product card: renders (evidence: `src/routes/wishlist.tsx`)
- Wishlist page → Cart and wishlist: reads (evidence: `src/routes/wishlist.tsx`)
- Account page → Local orders: reads (evidence: `src/routes/account.tsx`)
- Account page → Payment methods: reads (evidence: `src/routes/account.tsx`)
- Checkout → Cart and wishlist: reads and clears (evidence: `src/routes/checkout.tsx`)
- Checkout → Local orders: saves order (evidence: `src/routes/checkout.tsx`)
- Checkout → Order persistence: persists order (evidence: `src/routes/checkout.tsx`)
- Checkout → Payment methods: uses methods (evidence: `src/routes/checkout.tsx`)
- Checkout → Pricing rules: formats totals (evidence: `src/routes/checkout.tsx`)
- Checkout → PayPal button: renders (evidence: `src/routes/checkout.tsx`)
- PayPal button → PayPal functions: invokes (evidence: `src/components/shop/PaypalButton.tsx`)
- Order persistence → Product catalog: uses (evidence: `src/lib/orders.functions.ts`)
- Order persistence → Pricing rules: uses (evidence: `src/lib/orders.functions.ts`)
- Order persistence → Supabase client: uses client (evidence: `src/lib/orders.functions.ts`)
