# sammuel-kouassi/cereals-house architecture

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

- Interactive diagram: https://gitdiagram.com/sammuel-kouassi/cereals-house
- Repository: https://github.com/sammuel-kouassi/cereals-house

## Overview

Cereals House is an African cereals storefront with customer accounts, checkout and order management, payment-provider integrations, and administrative tools. The main customer journey is browsing products, assembling a cart, checking out, paying, and following the resulting order; authentication and country/language selection support that journey. The graph also preserves the admin, email/receipt, and payment-webhook branches. Source evidence is partial: several domain modules are named in the SOURCE INDEX but were not excerpted, so their connections are omitted or marked unverified rather than asserted.

Main entry points: [`src/lib/payments`](https://github.com/sammuel-kouassi/cereals-house/tree/main/src/lib/payments) (Payment webhooks), [`src/lib/admin/quotes.functions.ts`](https://github.com/sammuel-kouassi/cereals-house/blob/main/src/lib/admin/quotes.functions.ts) (Quote management), [`src/lib/orders/order-notifications.server.ts`](https://github.com/sammuel-kouassi/cereals-house/blob/main/src/lib/orders/order-notifications.server.ts) (Order notifications), [`src/integrations/neon/db.server.ts`](https://github.com/sammuel-kouassi/cereals-house/blob/main/src/integrations/neon/db.server.ts) (Neon database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_product_ui["Product browsing<br/>[products-page.tsx]"]
  node_product_data["Product catalog"]
  node_search["Product search"]
  node_cart["Cart<br/>[cart-context.tsx]"]
end

subgraph group_identity["Identity &amp; Locale"]
  node_account["Authentication<br/>[auth.functions.ts]"]
  node_auth_page["Sign-in page<br/>[auth-page.tsx]"]
  node_country["Country selection"]
  node_localization["Language routing<br/>[i18n-routing.ts]"]
end

subgraph group_commerce["Orders &amp; Fulfillment"]
  node_checkout["Checkout<br/>[checkout-page.tsx]"]
  node_orders["Order services"]
  node_order_views["Order tracking"]
  node_shipping["Shipping rates"]
  node_stock["Inventory<br/>[stock.functions.ts]"]
  node_database[("Neon database<br/>[db.server.ts]")]
end

subgraph group_payments["Payments"]
  node_payment_choice["Payment methods<br/>[payment-methods.ts]"]
  node_payment_integrations["Payment providers"]
  node_webhook_dispatch["Webhook dispatch<br/>[server.ts]"]
  node_payment_webhooks["Payment webhooks"]
end

subgraph group_operations["Administration &amp; Messaging"]
  node_admin["Admin tools<br/>[admin.orders.tsx]"]
  node_admin_quotes["Quote management"]
  node_notifications["Order notifications"]
  node_email_templates["Email templates<br/>[templates.ts]"]
  node_email_sender["Email delivery<br/>[resend.server.ts]"]
  node_receipts["Receipts &amp; invoices"]
end

node_shopper(("Shopper"))
node_paystack{{"Paystack"}}
node_geniuspay{{"GeniusPay"}}
node_cinetpay{{"CinetPay"}}

node_shopper -.->|"browses"| node_product_ui
node_product_ui -.->|"loads products"| node_product_data
node_search -->|"searches"| node_product_data
node_shopper -.->|"adds items"| node_cart
node_cart -.->|"continues to"| node_checkout
node_checkout -.->|"submits order"| node_orders
node_checkout -.->|"requests rates"| node_shipping
node_orders -.->|"reads/writes"| node_database
node_order_views -.->|"loads order"| node_orders
node_shopper -.->|"signs in"| node_auth_page
node_auth_page -->|"authenticates"| node_account
node_account -->|"queries users"| node_database
node_country -->|"loads country products"| node_product_data
node_country -->|"selects language"| node_localization
node_payment_choice -.->|"selects provider"| node_payment_integrations
node_webhook_dispatch -->|"routes callbacks"| node_payment_webhooks
node_payment_webhooks -->|"verifies transactions"| node_paystack
node_payment_webhooks -->|"verifies transactions"| node_geniuspay
node_payment_webhooks -->|"updates orders"| node_database
node_payment_webhooks -->|"notifies customer"| node_notifications
node_admin -->|"manages quotes"| node_admin_quotes
node_admin_quotes -->|"queries data"| node_database
node_admin_quotes -->|"sends email"| node_email_sender
node_admin_quotes -->|"builds messages"| node_email_templates
node_admin_quotes -->|"generates receipt"| node_receipts
node_notifications -->|"reads orders"| node_database
node_notifications -->|"builds messages"| node_email_templates
node_notifications -->|"sends email"| node_email_sender
node_notifications -->|"generates receipt"| node_receipts
node_webhook_dispatch -->|"routes callbacks"| node_cinetpay

click node_product_ui "https://github.com/sammuel-kouassi/cereals-house/blob/main/src/components/pages/products-page.tsx"
click node_product_data "https://github.com/sammuel-kouassi/cereals-house/blob/main/src/lib/products/products.functions.ts"
click node_search "https://github.com/sammuel-kouassi/cereals-house/blob/main/src/components/spotlight-search.tsx"
click node_cart "https://github.com/sammuel-kouassi/cereals-house/blob/main/src/lib/cart-context.tsx"
click node_checkout "https://github.com/sammuel-kouassi/cereals-house/blob/main/src/components/pages/checkout-page.tsx"
click node_orders "https://github.com/sammuel-kouassi/cereals-house/blob/main/src/lib/orders/orders.functions.ts"
click node_order_views "https://github.com/sammuel-kouassi/cereals-house/blob/main/src/components/pages/order-detail-page.tsx"
click node_shipping "https://github.com/sammuel-kouassi/cereals-house/blob/main/src/lib/shipping/shipping.functions.ts"
click node_stock "https://github.com/sammuel-kouassi/cereals-house/blob/main/src/lib/products/stock.functions.ts"
click node_account "https://github.com/sammuel-kouassi/cereals-house/blob/main/src/lib/auth/auth.functions.ts"
click node_auth_page "https://github.com/sammuel-kouassi/cereals-house/blob/main/src/components/pages/auth-page.tsx"
click node_country "https://github.com/sammuel-kouassi/cereals-house/blob/main/src/lib/country-context.tsx"
click node_localization "https://github.com/sammuel-kouassi/cereals-house/blob/main/src/lib/i18n-routing.ts"
click node_database "https://github.com/sammuel-kouassi/cereals-house/blob/main/src/integrations/neon/db.server.ts"
click node_payment_choice "https://github.com/sammuel-kouassi/cereals-house/blob/main/src/lib/payments/payment-methods.ts"
click node_payment_integrations "https://github.com/sammuel-kouassi/cereals-house/tree/main/src/lib/payments"
click node_webhook_dispatch "https://github.com/sammuel-kouassi/cereals-house/blob/main/src/server.ts"
click node_payment_webhooks "https://github.com/sammuel-kouassi/cereals-house/tree/main/src/lib/payments"
click node_admin "https://github.com/sammuel-kouassi/cereals-house/blob/main/src/routes/admin.orders.tsx"
click node_admin_quotes "https://github.com/sammuel-kouassi/cereals-house/blob/main/src/lib/admin/quotes.functions.ts"
click node_notifications "https://github.com/sammuel-kouassi/cereals-house/blob/main/src/lib/orders/order-notifications.server.ts"
click node_email_templates "https://github.com/sammuel-kouassi/cereals-house/blob/main/src/lib/email/templates.ts"
click node_email_sender "https://github.com/sammuel-kouassi/cereals-house/blob/main/src/lib/email/resend.server.ts"
click node_receipts "https://github.com/sammuel-kouassi/cereals-house/blob/main/src/lib/receipt/generate-receipt.server.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_product_ui,node_product_data,node_search,node_cart toneBlue
class node_account,node_auth_page,node_country,node_localization toneAmber
class node_checkout,node_orders,node_order_views,node_shipping,node_stock,node_database toneMint
class node_payment_choice,node_payment_integrations,node_webhook_dispatch,node_payment_webhooks toneRose
class node_admin,node_admin_quotes,node_notifications,node_email_templates,node_email_sender,node_receipts,node_shopper,node_paystack,node_geniuspay,node_cinetpay toneIndigo
```

## Components

### Storefront

- [Product browsing](https://github.com/sammuel-kouassi/cereals-house/blob/main/src/components/pages/products-page.tsx): `src/components/pages/products-page.tsx`
- [Product catalog](https://github.com/sammuel-kouassi/cereals-house/blob/main/src/lib/products/products.functions.ts): `src/lib/products/products.functions.ts`
- [Product search](https://github.com/sammuel-kouassi/cereals-house/blob/main/src/components/spotlight-search.tsx): `src/components/spotlight-search.tsx`
- [Cart](https://github.com/sammuel-kouassi/cereals-house/blob/main/src/lib/cart-context.tsx): `src/lib/cart-context.tsx`

### Identity & Locale

- [Authentication](https://github.com/sammuel-kouassi/cereals-house/blob/main/src/lib/auth/auth.functions.ts): `src/lib/auth/auth.functions.ts`
- [Sign-in page](https://github.com/sammuel-kouassi/cereals-house/blob/main/src/components/pages/auth-page.tsx): `src/components/pages/auth-page.tsx`
- [Country selection](https://github.com/sammuel-kouassi/cereals-house/blob/main/src/lib/country-context.tsx): `src/lib/country-context.tsx`
- [Language routing](https://github.com/sammuel-kouassi/cereals-house/blob/main/src/lib/i18n-routing.ts): `src/lib/i18n-routing.ts`

### Orders & Fulfillment

- [Checkout](https://github.com/sammuel-kouassi/cereals-house/blob/main/src/components/pages/checkout-page.tsx): `src/components/pages/checkout-page.tsx`
- [Order services](https://github.com/sammuel-kouassi/cereals-house/blob/main/src/lib/orders/orders.functions.ts): `src/lib/orders/orders.functions.ts`
- [Order tracking](https://github.com/sammuel-kouassi/cereals-house/blob/main/src/components/pages/order-detail-page.tsx): `src/components/pages/order-detail-page.tsx`
- [Shipping rates](https://github.com/sammuel-kouassi/cereals-house/blob/main/src/lib/shipping/shipping.functions.ts): `src/lib/shipping/shipping.functions.ts`
- [Inventory](https://github.com/sammuel-kouassi/cereals-house/blob/main/src/lib/products/stock.functions.ts): `src/lib/products/stock.functions.ts`
- [Neon database](https://github.com/sammuel-kouassi/cereals-house/blob/main/src/integrations/neon/db.server.ts): `src/integrations/neon/db.server.ts`

### Payments

- [Payment methods](https://github.com/sammuel-kouassi/cereals-house/blob/main/src/lib/payments/payment-methods.ts): `src/lib/payments/payment-methods.ts`
- [Payment providers](https://github.com/sammuel-kouassi/cereals-house/tree/main/src/lib/payments): `src/lib/payments`
- [Webhook dispatch](https://github.com/sammuel-kouassi/cereals-house/blob/main/src/server.ts): `src/server.ts`
- [Payment webhooks](https://github.com/sammuel-kouassi/cereals-house/tree/main/src/lib/payments): `src/lib/payments`

### Administration & Messaging

- [Admin tools](https://github.com/sammuel-kouassi/cereals-house/blob/main/src/routes/admin.orders.tsx): `src/routes/admin.orders.tsx`
- [Quote management](https://github.com/sammuel-kouassi/cereals-house/blob/main/src/lib/admin/quotes.functions.ts): `src/lib/admin/quotes.functions.ts`
- [Order notifications](https://github.com/sammuel-kouassi/cereals-house/blob/main/src/lib/orders/order-notifications.server.ts): `src/lib/orders/order-notifications.server.ts`
- [Email templates](https://github.com/sammuel-kouassi/cereals-house/blob/main/src/lib/email/templates.ts): `src/lib/email/templates.ts`
- [Email delivery](https://github.com/sammuel-kouassi/cereals-house/blob/main/src/lib/email/resend.server.ts): `src/lib/email/resend.server.ts`
- [Receipts & invoices](https://github.com/sammuel-kouassi/cereals-house/blob/main/src/lib/receipt/generate-receipt.server.ts): `src/lib/receipt/generate-receipt.server.ts`

### Other components

- **Shopper**
- **Paystack**
- **GeniusPay**
- **CinetPay**

## Connections

- Shopper → Product browsing: browses
- Product browsing → Product catalog: loads products
- Product search → Product catalog: searches (evidence: `src/components/spotlight-search.tsx`)
- Shopper → Cart: adds items
- Cart → Checkout: continues to
- Checkout → Order services: submits order
- Checkout → Shipping rates: requests rates
- Order services → Neon database: reads/writes
- Order tracking → Order services: loads order
- Shopper → Sign-in page: signs in
- Sign-in page → Authentication: authenticates (evidence: `src/components/pages/auth-page.tsx`)
- Authentication → Neon database: queries users
- Country selection → Product catalog: loads country products (evidence: `src/lib/country-context.tsx`)
- Country selection → Language routing: selects language (evidence: `src/lib/i18n-routing.ts`)
- Payment methods → Payment providers: selects provider
- Webhook dispatch → Payment webhooks: routes callbacks (evidence: `src/server.ts`)
- Payment webhooks → Paystack: verifies transactions (evidence: `src/lib/payments/paystack.webhook.server.ts`)
- Payment webhooks → GeniusPay: verifies transactions (evidence: `src/lib/payments/geniuspay.webhook.server.ts`)
- Payment webhooks → Neon database: updates orders (evidence: `src/lib/payments/geniuspay.webhook.server.ts`)
- Payment webhooks → Order notifications: notifies customer (evidence: `src/lib/payments/paystack.webhook.server.ts`)
- Admin tools → Quote management: manages quotes
- Quote management → Neon database: queries data (evidence: `src/lib/admin/quotes.functions.ts`)
- Quote management → Email delivery: sends email (evidence: `src/lib/admin/quotes.functions.ts`)
- Quote management → Email templates: builds messages (evidence: `src/lib/admin/quotes.functions.ts`)
- Quote management → Receipts & invoices: generates receipt (evidence: `src/lib/admin/quotes.functions.ts`)
- Order notifications → Neon database: reads orders (evidence: `src/lib/orders/order-notifications.server.ts`)
- Order notifications → Email templates: builds messages (evidence: `src/lib/orders/order-notifications.server.ts`)
- Order notifications → Email delivery: sends email (evidence: `src/lib/orders/order-notifications.server.ts`)
- Order notifications → Receipts & invoices: generates receipt (evidence: `src/lib/orders/order-notifications.server.ts`)
- Webhook dispatch → CinetPay: routes callbacks (evidence: `src/server.ts`)
