# dmmagbual/accaza-sartoga architecture

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

- Interactive diagram: https://gitdiagram.com/dmmagbual/accaza-sartoga
- Repository: https://github.com/dmmagbual/accaza-sartoga

## Overview

Accaza Sartoga is a coffee-shop operations platform spanning customer ordering, staff POS and register workflows, inventory and recipe costing, rewards, and accounting. Its main business journey runs from menu browsing and checkout through order handling and operational control, with sales and other financial activity represented in Books. The tree identifies these distinct product areas, but the README gives no workflow detail and most implementation files were not sampled. Accordingly, the graph preserves the major subsystems while limiting edges to relationships shown in excerpts or the source index.

Main entry points: [`functions/lib/offline-sync.js`](https://github.com/dmmagbual/accaza-sartoga/blob/main/functions/lib/offline-sync.js) (Offline POS sync), [`functions/lib/order-service.js`](https://github.com/dmmagbual/accaza-sartoga/blob/main/functions/lib/order-service.js) (Order lifecycle), [`functions/lib/books-bridge.js`](https://github.com/dmmagbual/accaza-sartoga/blob/main/functions/lib/books-bridge.js) (POS-to-Books bridge), [`src/functions/43j-order-service.js`](https://github.com/dmmagbual/accaza-sartoga/blob/main/src/functions/43j-order-service.js) (Order service endpoint)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_customer["Customer experience"]
  node_customer_app["Customer app"]
  node_reservations["Reservations and feedback"]
  node_public_reviews["Public reviews"]
end

subgraph group_store["Store operations"]
  node_pos["Point of sale"]
  node_inventory["Inventory and recipes<br/>[10-inventory.js]"]
  node_sku["SKU management<br/>[11a-sku-manager.js]"]
  node_register["Register operations"]
  node_analytics["Sales analytics"]
end

subgraph group_rewards["Rewards"]
  node_rewards_admin["Rewards management"]
  node_dragon_editor["Dragon Quest editor<br/>[50-dragon-quest.js]"]
end

subgraph group_finance["Finance and Books"]
  node_financial["Financial postings<br/>[financial.js]"]
  node_books_bridge["POS-to-Books bridge<br/>[books-bridge.js]"]
  node_books_app["Books application"]
  node_books_reports["Books reports and exports"]
end

subgraph group_backend["Backend services"]
  node_rewards_service["Rewards service<br/>[26-loyalty.js]"]
  node_api["Cloud function entrypoints<br/>[index.js]"]
  node_order_endpoint["Order service endpoint"]
  node_order_service["Order lifecycle<br/>[order-service.js]"]
  node_offline_sync["Offline POS sync<br/>[offline-sync.js]"]
  node_payment_verification["Payment verification"]
  node_shift_handover["Shift handover<br/>[shift-handover.js]"]
  node_shift_crew["Shift crew<br/>[shift-crew.js]"]
end

node_customer(("Customer"))

node_order_endpoint -->|"invokes"| node_order_service
node_offline_sync -->|"imports"| node_payment_verification
node_offline_sync -->|"imports"| node_shift_handover
node_offline_sync -->|"imports"| node_shift_crew
node_offline_sync -->|"imports"| node_order_service
node_books_bridge -->|"imports"| node_financial

click node_customer_app "https://github.com/dmmagbual/accaza-sartoga/blob/main/src/customer/core/08-cart-checkout.mjs"
click node_reservations "https://github.com/dmmagbual/accaza-sartoga/blob/main/src/customer/core/11-reservations.mjs"
click node_public_reviews "https://github.com/dmmagbual/accaza-sartoga/blob/main/src/customer/core/14-public-reviews.mjs"
click node_pos "https://github.com/dmmagbual/accaza-sartoga/blob/main/src/admin/pos/50e-cart-checkout.js"
click node_inventory "https://github.com/dmmagbual/accaza-sartoga/blob/main/src/admin/pos/10-inventory.js"
click node_sku "https://github.com/dmmagbual/accaza-sartoga/blob/main/src/admin/pos/11a-sku-manager.js"
click node_register "https://github.com/dmmagbual/accaza-sartoga/blob/main/src/admin/register/60-operations-shift-review.js"
click node_analytics "https://github.com/dmmagbual/accaza-sartoga/blob/main/src/admin/analytics/20-sales-analytics.js"
click node_rewards_admin "https://github.com/dmmagbual/accaza-sartoga/blob/main/src/admin/rewards/20-rewards-catalog.js"
click node_dragon_editor "https://github.com/dmmagbual/accaza-sartoga/blob/main/src/admin/rewards/50-dragon-quest.js"
click node_rewards_service "https://github.com/dmmagbual/accaza-sartoga/blob/main/src/functions/26-loyalty.js"
click node_financial "https://github.com/dmmagbual/accaza-sartoga/blob/main/functions/lib/financial.js"
click node_books_bridge "https://github.com/dmmagbual/accaza-sartoga/blob/main/functions/lib/books-bridge.js"
click node_books_app "https://github.com/dmmagbual/accaza-sartoga/blob/main/src/books/app/10-application-shell.js"
click node_books_reports "https://github.com/dmmagbual/accaza-sartoga/blob/main/src/books/business-intelligence.js"
click node_api "https://github.com/dmmagbual/accaza-sartoga/blob/main/functions/index.js"
click node_order_endpoint "https://github.com/dmmagbual/accaza-sartoga/blob/main/src/functions/43j-order-service.js"
click node_order_service "https://github.com/dmmagbual/accaza-sartoga/blob/main/functions/lib/order-service.js"
click node_offline_sync "https://github.com/dmmagbual/accaza-sartoga/blob/main/functions/lib/offline-sync.js"
click node_payment_verification "https://github.com/dmmagbual/accaza-sartoga/blob/main/functions/lib/payment-verification.js"
click node_shift_handover "https://github.com/dmmagbual/accaza-sartoga/blob/main/functions/lib/shift-handover.js"
click node_shift_crew "https://github.com/dmmagbual/accaza-sartoga/blob/main/functions/lib/shift-crew.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_customer_app,node_reservations,node_public_reviews toneBlue
class node_pos,node_inventory,node_sku,node_register,node_analytics toneAmber
class node_rewards_admin,node_dragon_editor toneMint
class node_financial,node_books_bridge,node_books_app,node_books_reports toneRose
class node_rewards_service,node_api,node_order_endpoint,node_order_service,node_offline_sync,node_payment_verification,node_shift_handover,node_shift_crew,node_customer toneIndigo
```

## Components

### Customer experience

- [Customer app](https://github.com/dmmagbual/accaza-sartoga/blob/main/src/customer/core/08-cart-checkout.mjs): `src/customer/core/08-cart-checkout.mjs`
- [Reservations and feedback](https://github.com/dmmagbual/accaza-sartoga/blob/main/src/customer/core/11-reservations.mjs): `src/customer/core/11-reservations.mjs`
- [Public reviews](https://github.com/dmmagbual/accaza-sartoga/blob/main/src/customer/core/14-public-reviews.mjs): `src/customer/core/14-public-reviews.mjs`

### Store operations

- [Point of sale](https://github.com/dmmagbual/accaza-sartoga/blob/main/src/admin/pos/50e-cart-checkout.js): `src/admin/pos/50e-cart-checkout.js`
- [Inventory and recipes](https://github.com/dmmagbual/accaza-sartoga/blob/main/src/admin/pos/10-inventory.js): `src/admin/pos/10-inventory.js`
- [SKU management](https://github.com/dmmagbual/accaza-sartoga/blob/main/src/admin/pos/11a-sku-manager.js): `src/admin/pos/11a-sku-manager.js`
- [Register operations](https://github.com/dmmagbual/accaza-sartoga/blob/main/src/admin/register/60-operations-shift-review.js): `src/admin/register/60-operations-shift-review.js`
- [Sales analytics](https://github.com/dmmagbual/accaza-sartoga/blob/main/src/admin/analytics/20-sales-analytics.js): `src/admin/analytics/20-sales-analytics.js`

### Rewards

- [Rewards management](https://github.com/dmmagbual/accaza-sartoga/blob/main/src/admin/rewards/20-rewards-catalog.js): `src/admin/rewards/20-rewards-catalog.js`
- [Dragon Quest editor](https://github.com/dmmagbual/accaza-sartoga/blob/main/src/admin/rewards/50-dragon-quest.js): `src/admin/rewards/50-dragon-quest.js`

### Finance and Books

- [Financial postings](https://github.com/dmmagbual/accaza-sartoga/blob/main/functions/lib/financial.js): `functions/lib/financial.js`
- [POS-to-Books bridge](https://github.com/dmmagbual/accaza-sartoga/blob/main/functions/lib/books-bridge.js): `functions/lib/books-bridge.js`
- [Books application](https://github.com/dmmagbual/accaza-sartoga/blob/main/src/books/app/10-application-shell.js): `src/books/app/10-application-shell.js`
- [Books reports and exports](https://github.com/dmmagbual/accaza-sartoga/blob/main/src/books/business-intelligence.js): `src/books/business-intelligence.js`

### Backend services

- [Rewards service](https://github.com/dmmagbual/accaza-sartoga/blob/main/src/functions/26-loyalty.js): `src/functions/26-loyalty.js`
- [Cloud function entrypoints](https://github.com/dmmagbual/accaza-sartoga/blob/main/functions/index.js): `functions/index.js`
- [Order service endpoint](https://github.com/dmmagbual/accaza-sartoga/blob/main/src/functions/43j-order-service.js): `src/functions/43j-order-service.js`
- [Order lifecycle](https://github.com/dmmagbual/accaza-sartoga/blob/main/functions/lib/order-service.js): `functions/lib/order-service.js`
- [Offline POS sync](https://github.com/dmmagbual/accaza-sartoga/blob/main/functions/lib/offline-sync.js): `functions/lib/offline-sync.js`
- [Payment verification](https://github.com/dmmagbual/accaza-sartoga/blob/main/functions/lib/payment-verification.js): `functions/lib/payment-verification.js`
- [Shift handover](https://github.com/dmmagbual/accaza-sartoga/blob/main/functions/lib/shift-handover.js): `functions/lib/shift-handover.js`
- [Shift crew](https://github.com/dmmagbual/accaza-sartoga/blob/main/functions/lib/shift-crew.js): `functions/lib/shift-crew.js`

### Other components

- **Customer**

## Connections

- Order service endpoint → Order lifecycle: invokes (evidence: `src/functions/43j-order-service.js`)
- Offline POS sync → Payment verification: imports (evidence: `functions/lib/offline-sync.js`)
- Offline POS sync → Shift handover: imports (evidence: `functions/lib/offline-sync.js`)
- Offline POS sync → Shift crew: imports (evidence: `functions/lib/offline-sync.js`)
- Offline POS sync → Order lifecycle: imports (evidence: `functions/lib/offline-sync.js`)
- POS-to-Books bridge → Financial postings: imports (evidence: `functions/lib/books-bridge.js`)
