# zongokenoch95/le_ci architecture

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

- Interactive diagram: https://gitdiagram.com/zongokenoch95/le_ci
- Repository: https://github.com/zongokenoch95/le_ci

## Overview

This is a Burkina Faso pâtisserie storefront with custom cake ordering, checkout, loyalty features, and an administration area. Customers browse products or configure a cake, manage a cart, and proceed through payment; staff manage products, orders, delivery settings, and loyalty operations. The React app routes these experiences, while shared cart state and an API client support them. The server exposes the backend and uses a SQLite-backed data layer. Some client-to-server wiring is inferred from API calls and is marked unverified because server routes were not excerpted.

Main entry points: [`src/app/App.tsx`](https://github.com/zongokenoch95/le_ci/blob/main/src/app/App.tsx) (App Router), [`src/app/services/api.ts`](https://github.com/zongokenoch95/le_ci/blob/main/src/app/services/api.ts) (API Client), [`src/app/context/CartContext.tsx`](https://github.com/zongokenoch95/le_ci/blob/main/src/app/context/CartContext.tsx) (Cart State), [`src/app/pages/Catalogue.tsx`](https://github.com/zongokenoch95/le_ci/blob/main/src/app/pages/Catalogue.tsx) (Catalogue)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_app["App Router<br/>[App.tsx]"]
  node_home["Home<br/>[Home.tsx]"]
  node_catalogue["Catalogue<br/>[Catalogue.tsx]"]
  node_custom["Custom Cake Order<br/>[CustomOrder.tsx]"]
  node_promotions["Promotions<br/>[Promotions.tsx]"]
  node_imagefallback["Image Fallback"]
end

subgraph group_commerce["Cart and Checkout"]
  node_cartstate["Cart State<br/>[CartContext.tsx]"]
  node_cart["Cart Page<br/>[Cart.tsx]"]
  node_cartdrawer["Cart Drawer<br/>[CartDrawer.tsx]"]
  node_payment["Payment<br/>[Payment.tsx]"]
  node_otherpayment["Alternate Payment<br/>[OtherPayment.tsx]"]
  node_deliverymap["Delivery Picker"]
  node_phonevalidation["Phone Validation<br/>[phoneValidation.ts]"]
end

subgraph group_loyalty["Loyalty"]
  node_loyalty["Loyalty Page<br/>[Loyalty.tsx]"]
end

subgraph group_admin["Administration"]
  node_adminlogin["Admin Login<br/>[AdminLogin.tsx]"]
  node_admindashboard["Admin Dashboard<br/>[AdminDashboard.tsx]"]
end

subgraph group_backend["Backend"]
  node_api["API Client<br/>[api.ts]"]
  node_socket["Realtime Client<br/>[socket.ts]"]
  node_server["HTTP Server<br/>[index.js]"]
  node_db[("SQLite Data Layer<br/>[db.js]")]
end

node_customer(("Customer"))

node_customer -->|"opens storefront"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_catalogue
node_app -->|"routes to"| node_custom
node_app -->|"routes to"| node_promotions
node_app -->|"routes to"| node_cart
node_app -->|"routes to"| node_payment
node_app -->|"routes to"| node_otherpayment
node_app -->|"routes to"| node_loyalty
node_app -->|"routes to"| node_adminlogin
node_app -->|"routes to"| node_admindashboard
node_app -->|"provides state"| node_cartstate
node_custom -->|"adds items"| node_cartstate
node_cart -->|"uses cart"| node_cartstate
node_cart -->|"calls API"| node_api
node_cart -->|"validates phone"| node_phonevalidation
node_payment -->|"calls API"| node_api
node_payment -->|"joins order"| node_socket
node_payment -->|"validates phone"| node_phonevalidation
node_otherpayment -->|"calls API"| node_api
node_otherpayment -->|"joins order"| node_socket
node_otherpayment -->|"validates phone"| node_phonevalidation
node_loyalty -->|"calls API"| node_api
node_loyalty -->|"validates phone"| node_phonevalidation
node_admindashboard -->|"calls API"| node_api
node_admindashboard -->|"uses realtime"| node_socket
node_catalogue -->|"loads products"| node_api
node_catalogue -->|"adds items"| node_cartstate
node_home -->|"uses cart"| node_cartstate
node_catalogue -->|"renders images"| node_imagefallback
node_custom -->|"renders images"| node_imagefallback
node_home -->|"renders images"| node_imagefallback
node_cartdrawer -->|"uses cart"| node_cartstate
node_cartdrawer -->|"calls API"| node_api
node_deliverymap -->|"calls API"| node_api
node_api -.->|"HTTP requests"| node_server
node_server -->|"calls data layer"| node_db

click node_app "https://github.com/zongokenoch95/le_ci/blob/main/src/app/App.tsx"
click node_home "https://github.com/zongokenoch95/le_ci/blob/main/src/app/pages/Home.tsx"
click node_catalogue "https://github.com/zongokenoch95/le_ci/blob/main/src/app/pages/Catalogue.tsx"
click node_custom "https://github.com/zongokenoch95/le_ci/blob/main/src/app/pages/CustomOrder.tsx"
click node_promotions "https://github.com/zongokenoch95/le_ci/blob/main/src/app/pages/Promotions.tsx"
click node_imagefallback "https://github.com/zongokenoch95/le_ci/blob/main/src/app/components/figma/ImageWithFallback.tsx"
click node_cartstate "https://github.com/zongokenoch95/le_ci/blob/main/src/app/context/CartContext.tsx"
click node_cart "https://github.com/zongokenoch95/le_ci/blob/main/src/app/pages/Cart.tsx"
click node_cartdrawer "https://github.com/zongokenoch95/le_ci/blob/main/src/app/components/CartDrawer.tsx"
click node_payment "https://github.com/zongokenoch95/le_ci/blob/main/src/app/pages/Payment.tsx"
click node_otherpayment "https://github.com/zongokenoch95/le_ci/blob/main/src/app/pages/OtherPayment.tsx"
click node_deliverymap "https://github.com/zongokenoch95/le_ci/blob/main/src/app/components/DeliveryMapPicker.tsx"
click node_phonevalidation "https://github.com/zongokenoch95/le_ci/blob/main/src/app/utils/phoneValidation.ts"
click node_loyalty "https://github.com/zongokenoch95/le_ci/blob/main/src/app/pages/Loyalty.tsx"
click node_adminlogin "https://github.com/zongokenoch95/le_ci/blob/main/src/app/pages/AdminLogin.tsx"
click node_admindashboard "https://github.com/zongokenoch95/le_ci/blob/main/src/app/pages/AdminDashboard.tsx"
click node_api "https://github.com/zongokenoch95/le_ci/blob/main/src/app/services/api.ts"
click node_socket "https://github.com/zongokenoch95/le_ci/blob/main/src/app/services/socket.ts"
click node_server "https://github.com/zongokenoch95/le_ci/blob/main/server/index.js"
click node_db "https://github.com/zongokenoch95/le_ci/blob/main/server/db.js"

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_app,node_home,node_catalogue,node_custom,node_promotions,node_imagefallback toneBlue
class node_cartstate,node_cart,node_cartdrawer,node_payment,node_otherpayment,node_deliverymap,node_phonevalidation toneAmber
class node_loyalty toneMint
class node_adminlogin,node_admindashboard toneRose
class node_api,node_socket,node_server,node_db,node_customer toneIndigo
```

## Components

### Storefront

- [App Router](https://github.com/zongokenoch95/le_ci/blob/main/src/app/App.tsx): `src/app/App.tsx`
- [Home](https://github.com/zongokenoch95/le_ci/blob/main/src/app/pages/Home.tsx): `src/app/pages/Home.tsx`
- [Catalogue](https://github.com/zongokenoch95/le_ci/blob/main/src/app/pages/Catalogue.tsx): `src/app/pages/Catalogue.tsx`
- [Custom Cake Order](https://github.com/zongokenoch95/le_ci/blob/main/src/app/pages/CustomOrder.tsx): `src/app/pages/CustomOrder.tsx`
- [Promotions](https://github.com/zongokenoch95/le_ci/blob/main/src/app/pages/Promotions.tsx): `src/app/pages/Promotions.tsx`
- [Image Fallback](https://github.com/zongokenoch95/le_ci/blob/main/src/app/components/figma/ImageWithFallback.tsx): `src/app/components/figma/ImageWithFallback.tsx`

### Cart and Checkout

- [Cart State](https://github.com/zongokenoch95/le_ci/blob/main/src/app/context/CartContext.tsx): `src/app/context/CartContext.tsx`
- [Cart Page](https://github.com/zongokenoch95/le_ci/blob/main/src/app/pages/Cart.tsx): `src/app/pages/Cart.tsx`
- [Cart Drawer](https://github.com/zongokenoch95/le_ci/blob/main/src/app/components/CartDrawer.tsx): `src/app/components/CartDrawer.tsx`
- [Payment](https://github.com/zongokenoch95/le_ci/blob/main/src/app/pages/Payment.tsx): `src/app/pages/Payment.tsx`
- [Alternate Payment](https://github.com/zongokenoch95/le_ci/blob/main/src/app/pages/OtherPayment.tsx): `src/app/pages/OtherPayment.tsx`
- [Delivery Picker](https://github.com/zongokenoch95/le_ci/blob/main/src/app/components/DeliveryMapPicker.tsx): `src/app/components/DeliveryMapPicker.tsx`
- [Phone Validation](https://github.com/zongokenoch95/le_ci/blob/main/src/app/utils/phoneValidation.ts): `src/app/utils/phoneValidation.ts`

### Loyalty

- [Loyalty Page](https://github.com/zongokenoch95/le_ci/blob/main/src/app/pages/Loyalty.tsx): `src/app/pages/Loyalty.tsx`

### Administration

- [Admin Login](https://github.com/zongokenoch95/le_ci/blob/main/src/app/pages/AdminLogin.tsx): `src/app/pages/AdminLogin.tsx`
- [Admin Dashboard](https://github.com/zongokenoch95/le_ci/blob/main/src/app/pages/AdminDashboard.tsx): `src/app/pages/AdminDashboard.tsx`

### Backend

- [API Client](https://github.com/zongokenoch95/le_ci/blob/main/src/app/services/api.ts): `src/app/services/api.ts`
- [Realtime Client](https://github.com/zongokenoch95/le_ci/blob/main/src/app/services/socket.ts): `src/app/services/socket.ts`
- [HTTP Server](https://github.com/zongokenoch95/le_ci/blob/main/server/index.js): `server/index.js`
- [SQLite Data Layer](https://github.com/zongokenoch95/le_ci/blob/main/server/db.js): `server/db.js`

### Other components

- **Customer**

## Connections

- Customer → App Router: opens storefront (evidence: `src/app/App.tsx`)
- App Router → Home: routes to (evidence: `src/app/App.tsx`)
- App Router → Catalogue: routes to (evidence: `src/app/App.tsx`)
- App Router → Custom Cake Order: routes to (evidence: `src/app/App.tsx`)
- App Router → Promotions: routes to (evidence: `src/app/App.tsx`)
- App Router → Cart Page: routes to (evidence: `src/app/App.tsx`)
- App Router → Payment: routes to (evidence: `src/app/App.tsx`)
- App Router → Alternate Payment: routes to (evidence: `src/app/App.tsx`)
- App Router → Loyalty Page: routes to (evidence: `src/app/App.tsx`)
- App Router → Admin Login: routes to (evidence: `src/app/App.tsx`)
- App Router → Admin Dashboard: routes to (evidence: `src/app/App.tsx`)
- App Router → Cart State: provides state (evidence: `src/app/App.tsx`)
- Custom Cake Order → Cart State: adds items (evidence: `src/app/pages/CustomOrder.tsx`)
- Cart Page → Cart State: uses cart (evidence: `src/app/pages/Cart.tsx`)
- Cart Page → API Client: calls API (evidence: `src/app/pages/Cart.tsx`)
- Cart Page → Phone Validation: validates phone (evidence: `src/app/pages/Cart.tsx`)
- Payment → API Client: calls API (evidence: `src/app/pages/Payment.tsx`)
- Payment → Realtime Client: joins order (evidence: `src/app/pages/Payment.tsx`)
- Payment → Phone Validation: validates phone (evidence: `src/app/pages/Payment.tsx`)
- Alternate Payment → API Client: calls API (evidence: `src/app/pages/OtherPayment.tsx`)
- Alternate Payment → Realtime Client: joins order (evidence: `src/app/pages/OtherPayment.tsx`)
- Alternate Payment → Phone Validation: validates phone (evidence: `src/app/pages/OtherPayment.tsx`)
- Loyalty Page → API Client: calls API (evidence: `src/app/pages/Loyalty.tsx`)
- Loyalty Page → Phone Validation: validates phone (evidence: `src/app/pages/Loyalty.tsx`)
- Admin Dashboard → API Client: calls API (evidence: `src/app/pages/AdminDashboard.tsx`)
- Admin Dashboard → Realtime Client: uses realtime (evidence: `src/app/pages/AdminDashboard.tsx`)
- Catalogue → API Client: loads products (evidence: `src/app/pages/Catalogue.tsx`)
- Catalogue → Cart State: adds items (evidence: `src/app/pages/Catalogue.tsx`)
- Home → Cart State: uses cart (evidence: `src/app/pages/Home.tsx`)
- Catalogue → Image Fallback: renders images (evidence: `src/app/pages/Catalogue.tsx`)
- Custom Cake Order → Image Fallback: renders images (evidence: `src/app/pages/CustomOrder.tsx`)
- Home → Image Fallback: renders images (evidence: `src/app/pages/Home.tsx`)
- Cart Drawer → Cart State: uses cart (evidence: `src/app/components/CartDrawer.tsx`)
- Cart Drawer → API Client: calls API (evidence: `src/app/components/CartDrawer.tsx`)
- Delivery Picker → API Client: calls API (evidence: `src/app/components/DeliveryMapPicker.tsx`)
- API Client → HTTP Server: HTTP requests
- HTTP Server → SQLite Data Layer: calls data layer (evidence: `server/index.js`)
