# satisfecho/pos architecture

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

- Interactive diagram: https://gitdiagram.com/satisfecho/pos
- Repository: https://github.com/satisfecho/pos

## Overview

POS2 is a multi-tenant restaurant POS with staff operations and public guest ordering/booking. The principal workflow is guests browse a tenant menu, submit orders, staff manage fulfillment through the POS and kitchen, and reports summarize completed sales. The README documents payments, tables, reservations, inventory, delivery, loyalty, and marketing branches. Source evidence is selective: route excerpts establish some frontend dispatch, while several product branches are documented only by the README; dashed links mark unverified integration details.

Main entry points: [`back/app/main.py`](https://github.com/satisfecho/pos/blob/master/back/app/main.py) (POS API), [`back/app/models.py`](https://github.com/satisfecho/pos/blob/master/back/app/models.py) (Tenant Data), [`front/src/app/reservations/reservations.component.ts`](https://github.com/satisfecho/pos/blob/master/front/src/app/reservations/reservations.component.ts) (Reservations UI), [`front/src/app/orders/orders.component.ts`](https://github.com/satisfecho/pos/blob/master/front/src/app/orders/orders.component.ts) (Staff POS)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Guest and Staff Experience"]
  node_menu_ui["Guest Menu<br/>[menu.component.ts]"]
  node_booking_ui["Reservations UI"]
  node_staff_ui["Staff POS"]
  node_kitchen_ui["Kitchen Display"]
  node_api["POS API<br/>[main.py]"]
end

subgraph group_orders["Ordering and Fulfillment"]
  node_order_service["Order Fulfillment"]
  node_payments["Checkout Payments"]
  node_delivery["Delivery Integrations"]
end

subgraph group_operations["Restaurant Operations"]
  node_tables["Tables and QR"]
  node_reservations["Booking and Waitlist"]
  node_inventory_ui["Inventory Console"]
  node_inventory_api["Inventory Management"]
  node_inventory_service["Inventory Services"]
end

subgraph group_platform["Tenant Platform"]
  node_identity["Identity and Access<br/>[security.py]"]
  node_permissions["Role Permissions<br/>[permissions.py]"]
  node_data[("Tenant Data<br/>[models.py]")]
  node_database[("Database Sessions<br/>[db.py]")]
end

subgraph group_insights["Insights and Outreach"]
  node_reports["Sales Reports<br/>[reports_routes.py]"]
  node_social["Social Publishing<br/>[social_routes.py]"]
end

node_guest(("Guest"))
node_staff(("Restaurant Staff"))

node_guest -->|"browses menu"| node_menu_ui
node_guest -->|"books a table"| node_booking_ui
node_staff -->|"runs operations"| node_staff_ui
node_staff -->|"tracks orders"| node_kitchen_ui
node_menu_ui -.->|"submits orders"| node_api
node_booking_ui -.->|"manages bookings"| node_api
node_staff_ui -.->|"manages orders"| node_api
node_kitchen_ui -.->|"receives updates"| node_api
node_api -.->|"coordinates fulfillment"| node_order_service
node_api -.->|"handles checkout"| node_payments
node_api -->|"ingests marketplace orders"| node_delivery
node_staff_ui -.->|"manages tables"| node_tables
node_booking_ui -->|"routes staff bookings"| node_reservations
node_inventory_ui -.->|"uses inventory API"| node_inventory_api
node_inventory_api -->|"delegates operations"| node_inventory_service
node_inventory_api -->|"reads and writes"| node_data
node_api -.->|"opens sessions"| node_database
node_database -->|"persists records"| node_data
node_api -.->|"authenticates requests"| node_identity
node_identity -->|"looks up users"| node_data
node_permissions -->|"checks authenticated roles"| node_identity
node_reports -->|"aggregates paid orders"| node_data
node_social -->|"stores social posts"| node_data
node_social -.->|"publishes marketing"| node_guest

click node_menu_ui "https://github.com/satisfecho/pos/blob/master/front/src/app/menu/menu.component.ts"
click node_booking_ui "https://github.com/satisfecho/pos/blob/master/front/src/app/reservations/reservations.component.ts"
click node_staff_ui "https://github.com/satisfecho/pos/blob/master/front/src/app/orders/orders.component.ts"
click node_kitchen_ui "https://github.com/satisfecho/pos/blob/master/front/src/app/kitchen-display/kitchen-display.component.ts"
click node_api "https://github.com/satisfecho/pos/blob/master/back/app/main.py"
click node_order_service "https://github.com/satisfecho/pos/blob/master/back/app/delivery_order_service.py"
click node_payments "https://github.com/satisfecho/pos/blob/master/back/app/order_payment_service.py"
click node_delivery "https://github.com/satisfecho/pos/blob/master/back/app/delivery_integration_routes.py"
click node_tables "https://github.com/satisfecho/pos/blob/master/front/src/app/tables/tables.component.ts"
click node_reservations "https://github.com/satisfecho/pos/blob/master/back/app/attendance_routes.py"
click node_inventory_ui "https://github.com/satisfecho/pos/blob/master/front/src/app/inventory/inventory.routes.ts"
click node_inventory_api "https://github.com/satisfecho/pos/blob/master/back/app/inventory_routes.py"
click node_inventory_service "https://github.com/satisfecho/pos/blob/master/back/app/inventory_service.py"
click node_identity "https://github.com/satisfecho/pos/blob/master/back/app/security.py"
click node_permissions "https://github.com/satisfecho/pos/blob/master/back/app/permissions.py"
click node_data "https://github.com/satisfecho/pos/blob/master/back/app/models.py"
click node_database "https://github.com/satisfecho/pos/blob/master/back/app/db.py"
click node_reports "https://github.com/satisfecho/pos/blob/master/back/app/reports_routes.py"
click node_social "https://github.com/satisfecho/pos/blob/master/back/app/social_routes.py"

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_menu_ui,node_booking_ui,node_staff_ui,node_kitchen_ui,node_api toneBlue
class node_order_service,node_payments,node_delivery toneAmber
class node_tables,node_reservations,node_inventory_ui,node_inventory_api,node_inventory_service toneMint
class node_identity,node_permissions,node_data,node_database toneRose
class node_reports,node_social,node_guest,node_staff toneIndigo
```

## Components

### Guest and Staff Experience

- [Guest Menu](https://github.com/satisfecho/pos/blob/master/front/src/app/menu/menu.component.ts): `front/src/app/menu/menu.component.ts`
- [Reservations UI](https://github.com/satisfecho/pos/blob/master/front/src/app/reservations/reservations.component.ts): `front/src/app/reservations/reservations.component.ts`
- [Staff POS](https://github.com/satisfecho/pos/blob/master/front/src/app/orders/orders.component.ts): `front/src/app/orders/orders.component.ts`
- [Kitchen Display](https://github.com/satisfecho/pos/blob/master/front/src/app/kitchen-display/kitchen-display.component.ts): `front/src/app/kitchen-display/kitchen-display.component.ts`
- [POS API](https://github.com/satisfecho/pos/blob/master/back/app/main.py): `back/app/main.py`

### Ordering and Fulfillment

- [Order Fulfillment](https://github.com/satisfecho/pos/blob/master/back/app/delivery_order_service.py): `back/app/delivery_order_service.py`
- [Checkout Payments](https://github.com/satisfecho/pos/blob/master/back/app/order_payment_service.py): `back/app/order_payment_service.py`
- [Delivery Integrations](https://github.com/satisfecho/pos/blob/master/back/app/delivery_integration_routes.py): `back/app/delivery_integration_routes.py`

### Restaurant Operations

- [Tables and QR](https://github.com/satisfecho/pos/blob/master/front/src/app/tables/tables.component.ts): `front/src/app/tables/tables.component.ts`
- [Booking and Waitlist](https://github.com/satisfecho/pos/blob/master/back/app/attendance_routes.py): `back/app/attendance_routes.py`
- [Inventory Console](https://github.com/satisfecho/pos/blob/master/front/src/app/inventory/inventory.routes.ts): `front/src/app/inventory/inventory.routes.ts`
- [Inventory Management](https://github.com/satisfecho/pos/blob/master/back/app/inventory_routes.py): `back/app/inventory_routes.py`
- [Inventory Services](https://github.com/satisfecho/pos/blob/master/back/app/inventory_service.py): `back/app/inventory_service.py`

### Tenant Platform

- [Identity and Access](https://github.com/satisfecho/pos/blob/master/back/app/security.py): `back/app/security.py`
- [Role Permissions](https://github.com/satisfecho/pos/blob/master/back/app/permissions.py): `back/app/permissions.py`
- [Tenant Data](https://github.com/satisfecho/pos/blob/master/back/app/models.py): `back/app/models.py`
- [Database Sessions](https://github.com/satisfecho/pos/blob/master/back/app/db.py): `back/app/db.py`

### Insights and Outreach

- [Sales Reports](https://github.com/satisfecho/pos/blob/master/back/app/reports_routes.py): `back/app/reports_routes.py`
- [Social Publishing](https://github.com/satisfecho/pos/blob/master/back/app/social_routes.py): `back/app/social_routes.py`

### Other components

- **Guest**
- **Restaurant Staff**

## Connections

- Guest → Guest Menu: browses menu
- Guest → Reservations UI: books a table
- Restaurant Staff → Staff POS: runs operations
- Restaurant Staff → Kitchen Display: tracks orders
- Guest Menu → POS API: submits orders
- Reservations UI → POS API: manages bookings
- Staff POS → POS API: manages orders
- Kitchen Display → POS API: receives updates
- POS API → Order Fulfillment: coordinates fulfillment (evidence: `back/app/delivery_order_service.py`)
- POS API → Checkout Payments: handles checkout
- POS API → Delivery Integrations: ingests marketplace orders (evidence: `back/app/delivery_integration_routes.py`)
- Staff POS → Tables and QR: manages tables
- Reservations UI → Booking and Waitlist: routes staff bookings
- Inventory Console → Inventory Management: uses inventory API
- Inventory Management → Inventory Services: delegates operations (evidence: `back/app/inventory_routes.py`)
- Inventory Management → Tenant Data: reads and writes (evidence: `back/app/inventory_routes.py`)
- POS API → Database Sessions: opens sessions
- Database Sessions → Tenant Data: persists records (evidence: `back/app/db.py`)
- POS API → Identity and Access: authenticates requests
- Identity and Access → Tenant Data: looks up users (evidence: `back/app/security.py`)
- Role Permissions → Identity and Access: checks authenticated roles (evidence: `back/app/permissions.py`)
- Sales Reports → Tenant Data: aggregates paid orders (evidence: `back/app/reports_routes.py`)
- Social Publishing → Tenant Data: stores social posts (evidence: `back/app/social_routes.py`)
- Social Publishing → Guest: publishes marketing
