# abdulhanan42/pos-system architecture

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

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

## Overview

This repository implements a restaurant POS platform: a Vue staff application and customer ordering site use a FastAPI backend for accounts, menu, sales, kitchen, delivery, inventory, purchasing, reporting, and restaurant administration. In the staff flow, an authenticated operator uses POS views and stores to create and track orders through the API; backend order routes apply inventory and event behavior and persist domain records. Edges below are limited to relationships visible in excerpts or the source index; many feature-specific API links are necessarily omitted where their implementation was not sampled.

Main entry points: [`backend/main.py`](https://github.com/abdulhanan42/pos-system/blob/main/backend/main.py) (FastAPI application), [`backend/app/database.py`](https://github.com/abdulhanan42/pos-system/blob/main/backend/app/database.py) (Tenant data access), [`backend/app/routers/auth.py`](https://github.com/abdulhanan42/pos-system/blob/main/backend/app/routers/auth.py) (Authentication routes), [`backend/app/routers/orders.py`](https://github.com/abdulhanan42/pos-system/blob/main/backend/app/routers/orders.py) (Order routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_staff["Staff POS"]
  node_staff_app["Staff application<br/>[App.vue]"]
  node_staff_routes["Permission routing<br/>[index.js]"]
  node_auth_store["Session and access<br/>[auth.js]"]
  node_auth_service["Auth requests<br/>[authService.js]"]
  node_http_client["HTTP client<br/>[api.js]"]
  node_pos_view["Point of sale<br/>[POS.vue]"]
  node_order_store["Order state<br/>[order.js]"]
  node_order_service["Order requests<br/>[orderService.js]"]
  node_inventory_view["Inventory management<br/>[Inventory.vue]"]
  node_modifier_view["Menu modifiers<br/>[Modifiers.vue]"]
  node_staff_view["Staff administration<br/>[Staff.vue]"]
end

subgraph group_customer["Customer Ordering"]
  node_customer_app["Customer storefront<br/>[Home.vue]"]
  node_customer_api["Public API client<br/>[publicApi.js]"]
end

subgraph group_api["Backend API"]
  node_backend["FastAPI application<br/>[main.py]"]
  node_auth_routes["Authentication routes<br/>[auth.py]"]
  node_order_routes["Order routes<br/>[orders.py]"]
  node_inventory_routes["Inventory routes<br/>[inventory.py]"]
  node_delivery_routes["Delivery routes<br/>[delivery.py]"]
  node_catalog_routes["Catalog routes<br/>[products.py]"]
  node_feature_routes["Other feature routes"]
end

subgraph group_domain["Backend Domain"]
  node_auth_logic["Identity and permissions<br/>[auth.py]"]
  node_inventory_logic["Stock operations<br/>[inventory.py]"]
  node_event_hub["Live event hub<br/>[event_hub.py]"]
  node_db_access["Tenant data access<br/>[database.py]"]
  node_models["Domain records<br/>[models.py]"]
end

node_operator(("Staff operator"))
node_database[("Relational database")]
node_email["Email delivery"]
node_customer(("Online customer"))

node_operator -->|"uses"| node_staff_app
node_staff_app -->|"renders routes"| node_staff_routes
node_staff_routes -->|"checks access"| node_auth_store
node_staff_app -->|"watches session"| node_auth_store
node_auth_store -->|"requests identity"| node_auth_service
node_auth_service -->|"sends requests"| node_http_client
node_pos_view -->|"uses orders"| node_order_store
node_order_store -->|"calls"| node_order_service
node_order_service -->|"sends requests"| node_http_client
node_http_client -.->|"calls API"| node_backend
node_backend -->|"registers"| node_auth_routes
node_backend -->|"registers"| node_order_routes
node_backend -->|"registers"| node_inventory_routes
node_backend -->|"registers"| node_delivery_routes
node_backend -->|"registers"| node_catalog_routes
node_backend -->|"registers features"| node_feature_routes
node_auth_routes -->|"uses"| node_auth_logic
node_auth_routes -->|"gets sessions"| node_db_access
node_order_routes -->|"uses stock operations"| node_inventory_logic
node_order_routes -->|"publishes events"| node_event_hub
node_delivery_routes -->|"uses events"| node_event_hub
node_delivery_routes -->|"uses stock operations"| node_inventory_logic
node_inventory_routes -->|"uses stock operations"| node_inventory_logic
node_order_routes -->|"gets sessions"| node_db_access
node_inventory_routes -->|"gets sessions"| node_db_access
node_db_access -->|"filters records"| node_models
node_db_access -.->|"persists records"| node_database
node_auth_routes -.->|"sends email"| node_email
node_customer -.->|"places orders"| node_customer_app
node_customer_app -.->|"requests public data"| node_customer_api
node_customer_api -.->|"calls API"| node_backend
node_inventory_view -.->|"manages stock via API"| node_backend
node_modifier_view -.->|"manages modifiers via API"| node_backend
node_staff_view -.->|"manages staff via API"| node_backend

click node_staff_app "https://github.com/abdulhanan42/pos-system/blob/main/src/App.vue"
click node_staff_routes "https://github.com/abdulhanan42/pos-system/blob/main/src/router/index.js"
click node_auth_store "https://github.com/abdulhanan42/pos-system/blob/main/src/stores/auth.js"
click node_auth_service "https://github.com/abdulhanan42/pos-system/blob/main/src/services/authService.js"
click node_http_client "https://github.com/abdulhanan42/pos-system/blob/main/src/services/api.js"
click node_pos_view "https://github.com/abdulhanan42/pos-system/blob/main/src/views/pos/POS.vue"
click node_order_store "https://github.com/abdulhanan42/pos-system/blob/main/src/stores/order.js"
click node_order_service "https://github.com/abdulhanan42/pos-system/blob/main/src/services/orderService.js"
click node_inventory_view "https://github.com/abdulhanan42/pos-system/blob/main/src/views/inventory/Inventory.vue"
click node_modifier_view "https://github.com/abdulhanan42/pos-system/blob/main/src/views/menu/Modifiers.vue"
click node_staff_view "https://github.com/abdulhanan42/pos-system/blob/main/src/views/staff/Staff.vue"
click node_customer_app "https://github.com/abdulhanan42/pos-system/blob/main/customer_siter/src/views/Home.vue"
click node_customer_api "https://github.com/abdulhanan42/pos-system/blob/main/customer_siter/src/services/publicApi.js"
click node_backend "https://github.com/abdulhanan42/pos-system/blob/main/backend/main.py"
click node_auth_routes "https://github.com/abdulhanan42/pos-system/blob/main/backend/app/routers/auth.py"
click node_order_routes "https://github.com/abdulhanan42/pos-system/blob/main/backend/app/routers/orders.py"
click node_inventory_routes "https://github.com/abdulhanan42/pos-system/blob/main/backend/app/routers/inventory.py"
click node_delivery_routes "https://github.com/abdulhanan42/pos-system/blob/main/backend/app/routers/delivery.py"
click node_catalog_routes "https://github.com/abdulhanan42/pos-system/blob/main/backend/app/routers/products.py"
click node_feature_routes "https://github.com/abdulhanan42/pos-system/tree/main/backend/app/routers"
click node_auth_logic "https://github.com/abdulhanan42/pos-system/blob/main/backend/app/auth.py"
click node_inventory_logic "https://github.com/abdulhanan42/pos-system/blob/main/backend/app/inventory.py"
click node_event_hub "https://github.com/abdulhanan42/pos-system/blob/main/backend/app/event_hub.py"
click node_db_access "https://github.com/abdulhanan42/pos-system/blob/main/backend/app/database.py"
click node_models "https://github.com/abdulhanan42/pos-system/blob/main/backend/app/models.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_staff_app,node_staff_routes,node_auth_store,node_auth_service,node_http_client,node_pos_view,node_order_store,node_order_service,node_inventory_view,node_modifier_view,node_staff_view toneBlue
class node_customer_app,node_customer_api,node_database toneAmber
class node_backend,node_auth_routes,node_order_routes,node_inventory_routes,node_delivery_routes,node_catalog_routes,node_feature_routes toneMint
class node_auth_logic,node_inventory_logic,node_event_hub,node_db_access,node_models toneRose
class node_operator,node_email,node_customer toneIndigo
```

## Components

### Staff POS

- [Staff application](https://github.com/abdulhanan42/pos-system/blob/main/src/App.vue): `src/App.vue`
- [Permission routing](https://github.com/abdulhanan42/pos-system/blob/main/src/router/index.js): `src/router/index.js`
- [Session and access](https://github.com/abdulhanan42/pos-system/blob/main/src/stores/auth.js): `src/stores/auth.js`
- [Auth requests](https://github.com/abdulhanan42/pos-system/blob/main/src/services/authService.js): `src/services/authService.js`
- [HTTP client](https://github.com/abdulhanan42/pos-system/blob/main/src/services/api.js): `src/services/api.js`
- [Point of sale](https://github.com/abdulhanan42/pos-system/blob/main/src/views/pos/POS.vue): `src/views/pos/POS.vue`
- [Order state](https://github.com/abdulhanan42/pos-system/blob/main/src/stores/order.js): `src/stores/order.js`
- [Order requests](https://github.com/abdulhanan42/pos-system/blob/main/src/services/orderService.js): `src/services/orderService.js`
- [Inventory management](https://github.com/abdulhanan42/pos-system/blob/main/src/views/inventory/Inventory.vue): `src/views/inventory/Inventory.vue`
- [Menu modifiers](https://github.com/abdulhanan42/pos-system/blob/main/src/views/menu/Modifiers.vue): `src/views/menu/Modifiers.vue`
- [Staff administration](https://github.com/abdulhanan42/pos-system/blob/main/src/views/staff/Staff.vue): `src/views/staff/Staff.vue`

### Customer Ordering

- [Customer storefront](https://github.com/abdulhanan42/pos-system/blob/main/customer_siter/src/views/Home.vue): `customer_siter/src/views/Home.vue`
- [Public API client](https://github.com/abdulhanan42/pos-system/blob/main/customer_siter/src/services/publicApi.js): `customer_siter/src/services/publicApi.js`

### Backend API

- [FastAPI application](https://github.com/abdulhanan42/pos-system/blob/main/backend/main.py): `backend/main.py`
- [Authentication routes](https://github.com/abdulhanan42/pos-system/blob/main/backend/app/routers/auth.py): `backend/app/routers/auth.py`
- [Order routes](https://github.com/abdulhanan42/pos-system/blob/main/backend/app/routers/orders.py): `backend/app/routers/orders.py`
- [Inventory routes](https://github.com/abdulhanan42/pos-system/blob/main/backend/app/routers/inventory.py): `backend/app/routers/inventory.py`
- [Delivery routes](https://github.com/abdulhanan42/pos-system/blob/main/backend/app/routers/delivery.py): `backend/app/routers/delivery.py`
- [Catalog routes](https://github.com/abdulhanan42/pos-system/blob/main/backend/app/routers/products.py): `backend/app/routers/products.py`
- [Other feature routes](https://github.com/abdulhanan42/pos-system/tree/main/backend/app/routers): `backend/app/routers`

### Backend Domain

- [Identity and permissions](https://github.com/abdulhanan42/pos-system/blob/main/backend/app/auth.py): `backend/app/auth.py`
- [Stock operations](https://github.com/abdulhanan42/pos-system/blob/main/backend/app/inventory.py): `backend/app/inventory.py`
- [Live event hub](https://github.com/abdulhanan42/pos-system/blob/main/backend/app/event_hub.py): `backend/app/event_hub.py`
- [Tenant data access](https://github.com/abdulhanan42/pos-system/blob/main/backend/app/database.py): `backend/app/database.py`
- [Domain records](https://github.com/abdulhanan42/pos-system/blob/main/backend/app/models.py): `backend/app/models.py`

### Other components

- **Staff operator**
- **Relational database**
- **Email delivery**
- **Online customer**

## Connections

- Staff operator → Staff application: uses
- Staff application → Permission routing: renders routes (evidence: `src/App.vue`)
- Permission routing → Session and access: checks access (evidence: `src/router/index.js`)
- Staff application → Session and access: watches session (evidence: `src/App.vue`)
- Session and access → Auth requests: requests identity (evidence: `src/stores/auth.js`)
- Auth requests → HTTP client: sends requests (evidence: `src/services/authService.js`)
- Point of sale → Order state: uses orders (evidence: `src/views/pos/POS.vue`)
- Order state → Order requests: calls (evidence: `src/stores/order.js`)
- Order requests → HTTP client: sends requests (evidence: `src/services/orderService.js`)
- HTTP client → FastAPI application: calls API
- FastAPI application → Authentication routes: registers (evidence: `backend/main.py`)
- FastAPI application → Order routes: registers (evidence: `backend/main.py`)
- FastAPI application → Inventory routes: registers (evidence: `backend/main.py`)
- FastAPI application → Delivery routes: registers (evidence: `backend/main.py`)
- FastAPI application → Catalog routes: registers (evidence: `backend/main.py`)
- FastAPI application → Other feature routes: registers features (evidence: `backend/main.py`)
- Authentication routes → Identity and permissions: uses (evidence: `backend/app/routers/auth.py`)
- Authentication routes → Tenant data access: gets sessions (evidence: `backend/app/routers/auth.py`)
- Order routes → Stock operations: uses stock operations (evidence: `backend/app/routers/orders.py`)
- Order routes → Live event hub: publishes events (evidence: `backend/app/routers/orders.py`)
- Delivery routes → Live event hub: uses events (evidence: `backend/app/routers/delivery.py`)
- Delivery routes → Stock operations: uses stock operations (evidence: `backend/app/routers/delivery.py`)
- Inventory routes → Stock operations: uses stock operations (evidence: `backend/app/routers/inventory.py`)
- Order routes → Tenant data access: gets sessions (evidence: `backend/app/routers/orders.py`)
- Inventory routes → Tenant data access: gets sessions (evidence: `backend/app/routers/inventory.py`)
- Tenant data access → Domain records: filters records (evidence: `backend/app/database.py`)
- Tenant data access → Relational database: persists records
- Authentication routes → Email delivery: sends email
- Online customer → Customer storefront: places orders
- Customer storefront → Public API client: requests public data
- Public API client → FastAPI application: calls API
- Inventory management → FastAPI application: manages stock via API
- Menu modifiers → FastAPI application: manages modifiers via API
- Staff administration → FastAPI application: manages staff via API
