# paoloprandonitechnology/cassa-smart architecture

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

- Interactive diagram: https://gitdiagram.com/paoloprandonitechnology/cassa-smart
- Repository: https://github.com/paoloprandonitechnology/cassa-smart

## Overview

Cassa Smart is an offline, LAN-hosted order-management system for a festival. The main workflow runs from a mixed cashier cart through department-split orders and per-department numbering to KDS status updates, public display, and customer-facing screens. Admin also manages products, departments, users, settings, reporting, and printing; a separate update portal supports maintenance. The README documents the workflow and capabilities; several backend routes and integrations were not sampled, so uncertain implementation links are omitted or marked unverified.

Main entry points: [`server/src/routes/api.ts`](https://github.com/paoloprandonitechnology/cassa-smart/blob/main/server/src/routes/api.ts) (HTTP API), [`server/src/modules/orders/orders.service.ts`](https://github.com/paoloprandonitechnology/cassa-smart/blob/main/server/src/modules/orders/orders.service.ts) (Order lifecycle), [`server/src/realtime/socket.ts`](https://github.com/paoloprandonitechnology/cassa-smart/blob/main/server/src/realtime/socket.ts) (Realtime events), [`server/src/update-ui/routes.ts`](https://github.com/paoloprandonitechnology/cassa-smart/blob/main/server/src/update-ui/routes.ts) (Update routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Service stations"]
  node_cashier["Cashier<br/>[app.js]"]
  node_kds["Department KDS<br/>[app.js]"]
  node_prep["Preparations KDS<br/>[app.js]"]
  node_display["Public display<br/>[app.js]"]
  node_customer["Customer screen<br/>[app.js]"]
  node_home["Login and home<br/>[app.js]"]
end

subgraph group_core["Order operations"]
  node_api["HTTP API<br/>[api.ts]"]
  node_orders["Order lifecycle<br/>[orders.service.ts]"]
  node_products["Products and stock"]
  node_departments["Departments"]
  node_realtime["Realtime events<br/>[socket.ts]"]
end

subgraph group_admin["Administration"]
  node_admin["Admin console<br/>[app.js]"]
  node_configuration["Configuration"]
  node_auth["Authentication and permissions<br/>[auth.service.ts]"]
  node_audit["Audit log<br/>[audit.service.ts]"]
  node_printing["Printing"]
end

subgraph group_platform["Platform services"]
  node_printer["Thermal printers"]
  node_database[("SQLite database<br/>[database.ts]")]
  node_update["Update portal<br/>[app.js]"]
  node_update_service["Update service<br/>[update.service.ts]"]
  node_update_routes["Update routes<br/>[routes.ts]"]
  node_system_time["System time"]
end

node_cashier -->|"submits cart"| node_api
node_api -.->|"routes orders"| node_orders
node_orders -->|"persists orders"| node_database
node_orders -->|"splits by department"| node_departments
node_orders -->|"validates stock"| node_products
node_orders -->|"updates queues"| node_kds
node_kds -->|"changes status"| node_api
node_orders -.->|"publishes updates"| node_realtime
node_realtime -->|"refreshes display"| node_display
node_realtime -->|"updates screen"| node_customer
node_prep -.->|"views preparations"| node_api
node_home -.->|"authenticates user"| node_auth
node_admin -.->|"manages service"| node_api
node_api -.->|"routes configuration"| node_configuration
node_configuration -->|"reads and writes"| node_database
node_api -.->|"routes print jobs"| node_printing
node_printing -->|"sends ESC/POS"| node_printer
node_update -.->|"calls portal API"| node_update_routes
node_update_routes -->|"requests update status"| node_update_service
node_update_routes -->|"records actions"| node_audit
node_system_time -->|"reads and writes settings"| node_database

click node_cashier "https://github.com/paoloprandonitechnology/cassa-smart/blob/main/server/public/cassa/app.js"
click node_kds "https://github.com/paoloprandonitechnology/cassa-smart/blob/main/server/public/kds/app.js"
click node_prep "https://github.com/paoloprandonitechnology/cassa-smart/blob/main/server/public/kds-preparazione/app.js"
click node_display "https://github.com/paoloprandonitechnology/cassa-smart/blob/main/server/public/display/app.js"
click node_customer "https://github.com/paoloprandonitechnology/cassa-smart/blob/main/server/public/schermo-cliente/app.js"
click node_home "https://github.com/paoloprandonitechnology/cassa-smart/blob/main/server/public/home/app.js"
click node_api "https://github.com/paoloprandonitechnology/cassa-smart/blob/main/server/src/routes/api.ts"
click node_orders "https://github.com/paoloprandonitechnology/cassa-smart/blob/main/server/src/modules/orders/orders.service.ts"
click node_products "https://github.com/paoloprandonitechnology/cassa-smart/blob/main/server/src/modules/products/products.repository.ts"
click node_departments "https://github.com/paoloprandonitechnology/cassa-smart/blob/main/server/src/modules/departments/departments.service.ts"
click node_realtime "https://github.com/paoloprandonitechnology/cassa-smart/blob/main/server/src/realtime/socket.ts"
click node_admin "https://github.com/paoloprandonitechnology/cassa-smart/blob/main/server/public/admin/app.js"
click node_configuration "https://github.com/paoloprandonitechnology/cassa-smart/blob/main/server/src/modules/configuration/configuration.service.ts"
click node_auth "https://github.com/paoloprandonitechnology/cassa-smart/blob/main/server/src/modules/auth/auth.service.ts"
click node_audit "https://github.com/paoloprandonitechnology/cassa-smart/blob/main/server/src/modules/audit/audit.service.ts"
click node_printing "https://github.com/paoloprandonitechnology/cassa-smart/blob/main/server/src/modules/printers/print-escpos.service.ts"
click node_database "https://github.com/paoloprandonitechnology/cassa-smart/blob/main/server/src/db/database.ts"
click node_update "https://github.com/paoloprandonitechnology/cassa-smart/blob/main/server/public/update/app.js"
click node_update_service "https://github.com/paoloprandonitechnology/cassa-smart/blob/main/server/src/modules/update/update.service.ts"
click node_update_routes "https://github.com/paoloprandonitechnology/cassa-smart/blob/main/server/src/update-ui/routes.ts"
click node_system_time "https://github.com/paoloprandonitechnology/cassa-smart/blob/main/server/src/modules/time/system-time.service.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_cashier,node_kds,node_prep,node_display,node_customer,node_home toneBlue
class node_api,node_orders,node_products,node_departments,node_realtime toneAmber
class node_admin,node_configuration,node_auth,node_audit,node_printing toneMint
class node_printer,node_database,node_update,node_update_service,node_update_routes,node_system_time toneRose
```

## Components

### Service stations

- [Cashier](https://github.com/paoloprandonitechnology/cassa-smart/blob/main/server/public/cassa/app.js): `server/public/cassa/app.js`
- [Department KDS](https://github.com/paoloprandonitechnology/cassa-smart/blob/main/server/public/kds/app.js): `server/public/kds/app.js`
- [Preparations KDS](https://github.com/paoloprandonitechnology/cassa-smart/blob/main/server/public/kds-preparazione/app.js): `server/public/kds-preparazione/app.js`
- [Public display](https://github.com/paoloprandonitechnology/cassa-smart/blob/main/server/public/display/app.js): `server/public/display/app.js`
- [Customer screen](https://github.com/paoloprandonitechnology/cassa-smart/blob/main/server/public/schermo-cliente/app.js): `server/public/schermo-cliente/app.js`
- [Login and home](https://github.com/paoloprandonitechnology/cassa-smart/blob/main/server/public/home/app.js): `server/public/home/app.js`

### Order operations

- [HTTP API](https://github.com/paoloprandonitechnology/cassa-smart/blob/main/server/src/routes/api.ts): `server/src/routes/api.ts`
- [Order lifecycle](https://github.com/paoloprandonitechnology/cassa-smart/blob/main/server/src/modules/orders/orders.service.ts): `server/src/modules/orders/orders.service.ts`
- [Products and stock](https://github.com/paoloprandonitechnology/cassa-smart/blob/main/server/src/modules/products/products.repository.ts): `server/src/modules/products/products.repository.ts`
- [Departments](https://github.com/paoloprandonitechnology/cassa-smart/blob/main/server/src/modules/departments/departments.service.ts): `server/src/modules/departments/departments.service.ts`
- [Realtime events](https://github.com/paoloprandonitechnology/cassa-smart/blob/main/server/src/realtime/socket.ts): `server/src/realtime/socket.ts`

### Administration

- [Admin console](https://github.com/paoloprandonitechnology/cassa-smart/blob/main/server/public/admin/app.js): `server/public/admin/app.js`
- [Configuration](https://github.com/paoloprandonitechnology/cassa-smart/blob/main/server/src/modules/configuration/configuration.service.ts): `server/src/modules/configuration/configuration.service.ts`
- [Authentication and permissions](https://github.com/paoloprandonitechnology/cassa-smart/blob/main/server/src/modules/auth/auth.service.ts): `server/src/modules/auth/auth.service.ts`
- [Audit log](https://github.com/paoloprandonitechnology/cassa-smart/blob/main/server/src/modules/audit/audit.service.ts): `server/src/modules/audit/audit.service.ts`
- [Printing](https://github.com/paoloprandonitechnology/cassa-smart/blob/main/server/src/modules/printers/print-escpos.service.ts): `server/src/modules/printers/print-escpos.service.ts`

### Platform services

- **Thermal printers**
- [SQLite database](https://github.com/paoloprandonitechnology/cassa-smart/blob/main/server/src/db/database.ts): `server/src/db/database.ts`
- [Update portal](https://github.com/paoloprandonitechnology/cassa-smart/blob/main/server/public/update/app.js): `server/public/update/app.js`
- [Update service](https://github.com/paoloprandonitechnology/cassa-smart/blob/main/server/src/modules/update/update.service.ts): `server/src/modules/update/update.service.ts`
- [Update routes](https://github.com/paoloprandonitechnology/cassa-smart/blob/main/server/src/update-ui/routes.ts): `server/src/update-ui/routes.ts`
- [System time](https://github.com/paoloprandonitechnology/cassa-smart/blob/main/server/src/modules/time/system-time.service.ts): `server/src/modules/time/system-time.service.ts`

## Connections

- Cashier → HTTP API: submits cart
- HTTP API → Order lifecycle: routes orders
- Order lifecycle → SQLite database: persists orders (evidence: `server/src/modules/orders/orders.service.ts`)
- Order lifecycle → Departments: splits by department (evidence: `server/src/modules/orders/orders.service.ts`)
- Order lifecycle → Products and stock: validates stock (evidence: `server/src/modules/orders/orders.service.ts`)
- Order lifecycle → Department KDS: updates queues
- Department KDS → HTTP API: changes status
- Order lifecycle → Realtime events: publishes updates
- Realtime events → Public display: refreshes display
- Realtime events → Customer screen: updates screen
- Preparations KDS → HTTP API: views preparations
- Login and home → Authentication and permissions: authenticates user
- Admin console → HTTP API: manages service
- HTTP API → Configuration: routes configuration
- Configuration → SQLite database: reads and writes (evidence: `server/src/modules/configuration/configuration.service.ts`)
- HTTP API → Printing: routes print jobs
- Printing → Thermal printers: sends ESC/POS
- Update portal → Update routes: calls portal API
- Update routes → Update service: requests update status (evidence: `server/src/update-ui/routes.ts`)
- Update routes → Audit log: records actions (evidence: `server/src/update-ui/routes.ts`)
- System time → SQLite database: reads and writes settings (evidence: `server/src/modules/time/system-time.service.ts`)
