# edrian-mp/smartpos-full architecture

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

- Interactive diagram: https://gitdiagram.com/edrian-mp/smartpos-full
- Repository: https://github.com/edrian-mp/smartpos-full

## Overview

SmartPOS is an offline-first desktop point-of-sale system with produce recognition, weighing, inventory administration, receipt printing, and optional cloud synchronization. The main workflow is seller login, product identification and weighing, checkout, local recording, and receipt printing; owners use a separate dashboard for inventory, training, and reporting. The diagram follows the sampled entry-point wiring and documented capabilities. Some subsystem implementations were not sampled, so uncertain connections are omitted rather than inferred.

Main entry points: [`main.py`](https://github.com/edrian-mp/smartpos-full/blob/main/main.py) (App coordinator), [`ui/seller_pos.py`](https://github.com/edrian-mp/smartpos-full/blob/main/ui/seller_pos.py) (Seller POS), [`modules/db_manager.py`](https://github.com/edrian-mp/smartpos-full/blob/main/modules/db_manager.py) (Local database), [`modules/checkout_service.py`](https://github.com/edrian-mp/smartpos-full/blob/main/modules/checkout_service.py) (Checkout service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Desktop application"]
  node_app_entry["App coordinator<br/>[main.py]"]
  node_login["Login screen<br/>[login_window.py]"]
end

subgraph group_sales["Sales workflow"]
  node_seller_pos["Seller POS<br/>[seller_pos.py]"]
  node_customer_display["Customer display"]
  node_checkout["Checkout service"]
  node_database[("Local database<br/>[db_manager.py]")]
end

subgraph group_operations["Inventory and recognition"]
  node_admin["Admin dashboard<br/>[admin_dashboard.py]"]
  node_ai["Product recognition<br/>[ai_engine.py]"]
  node_realtime_products["Live products"]
  node_realtime_adjustments["Live adjustments"]
end

subgraph group_integrations["Devices and sync"]
  node_cloud_stock["Cloud stock<br/>[cloud_stock.py]"]
  node_cloud_sync["Cloud sync worker<br/>[cloud_sync.py]"]
  node_camera["Camera driver<br/>[camera_driver.py]"]
  node_scale["Scale driver<br/>[scale_driver.py]"]
  node_printer["Printer driver<br/>[printer_driver.py]"]
end

node_seller(("Seller"))
node_owner(("Owner"))
node_cloud_service{{"Cloud endpoint"}}

node_seller -->|"signs in"| node_login
node_owner -->|"signs in"| node_login
node_app_entry -->|"opens"| node_login
node_app_entry -->|"routes seller"| node_seller_pos
node_app_entry -->|"routes owner"| node_admin
node_app_entry -->|"controls"| node_customer_display
node_app_entry -->|"initializes"| node_database
node_app_entry -->|"starts"| node_cloud_sync
node_app_entry -->|"initializes"| node_ai
node_app_entry -->|"initializes"| node_scale
node_seller_pos -->|"requests recognition"| node_ai
node_seller_pos -->|"submits sale"| node_checkout
node_checkout -->|"records sale"| node_database
node_checkout -->|"prints receipt"| node_printer
node_seller_pos -->|"captures frames"| node_camera
node_admin -->|"reads history"| node_database
node_cloud_sync -->|"reads queued sales"| node_database
node_cloud_sync -.->|"pushes batches"| node_cloud_service

click node_app_entry "https://github.com/edrian-mp/smartpos-full/blob/main/main.py"
click node_login "https://github.com/edrian-mp/smartpos-full/blob/main/ui/login_window.py"
click node_seller_pos "https://github.com/edrian-mp/smartpos-full/blob/main/ui/seller_pos.py"
click node_customer_display "https://github.com/edrian-mp/smartpos-full/blob/main/ui/customer_display.py"
click node_checkout "https://github.com/edrian-mp/smartpos-full/blob/main/modules/checkout_service.py"
click node_database "https://github.com/edrian-mp/smartpos-full/blob/main/modules/db_manager.py"
click node_admin "https://github.com/edrian-mp/smartpos-full/blob/main/ui/admin_dashboard.py"
click node_ai "https://github.com/edrian-mp/smartpos-full/blob/main/modules/ai_engine.py"
click node_realtime_products "https://github.com/edrian-mp/smartpos-full/blob/main/modules/realtime_products.py"
click node_realtime_adjustments "https://github.com/edrian-mp/smartpos-full/blob/main/modules/realtime_adjustments.py"
click node_cloud_stock "https://github.com/edrian-mp/smartpos-full/blob/main/modules/cloud_stock.py"
click node_cloud_sync "https://github.com/edrian-mp/smartpos-full/blob/main/modules/cloud_sync.py"
click node_camera "https://github.com/edrian-mp/smartpos-full/blob/main/drivers/camera_driver.py"
click node_scale "https://github.com/edrian-mp/smartpos-full/blob/main/drivers/scale_driver.py"
click node_printer "https://github.com/edrian-mp/smartpos-full/blob/main/drivers/printer_driver.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_app_entry,node_login toneBlue
class node_seller_pos,node_customer_display,node_checkout,node_database toneAmber
class node_admin,node_ai,node_realtime_products,node_realtime_adjustments toneMint
class node_cloud_stock,node_cloud_sync,node_camera,node_scale,node_printer toneRose
class node_seller,node_owner,node_cloud_service toneIndigo
```

## Components

### Desktop application

- [App coordinator](https://github.com/edrian-mp/smartpos-full/blob/main/main.py): `main.py`
- [Login screen](https://github.com/edrian-mp/smartpos-full/blob/main/ui/login_window.py): `ui/login_window.py`

### Sales workflow

- [Seller POS](https://github.com/edrian-mp/smartpos-full/blob/main/ui/seller_pos.py): `ui/seller_pos.py`
- [Customer display](https://github.com/edrian-mp/smartpos-full/blob/main/ui/customer_display.py): `ui/customer_display.py`
- [Checkout service](https://github.com/edrian-mp/smartpos-full/blob/main/modules/checkout_service.py): `modules/checkout_service.py`
- [Local database](https://github.com/edrian-mp/smartpos-full/blob/main/modules/db_manager.py): `modules/db_manager.py`

### Inventory and recognition

- [Admin dashboard](https://github.com/edrian-mp/smartpos-full/blob/main/ui/admin_dashboard.py): `ui/admin_dashboard.py`
- [Product recognition](https://github.com/edrian-mp/smartpos-full/blob/main/modules/ai_engine.py): `modules/ai_engine.py`
- [Live products](https://github.com/edrian-mp/smartpos-full/blob/main/modules/realtime_products.py): `modules/realtime_products.py`
- [Live adjustments](https://github.com/edrian-mp/smartpos-full/blob/main/modules/realtime_adjustments.py): `modules/realtime_adjustments.py`

### Devices and sync

- [Cloud stock](https://github.com/edrian-mp/smartpos-full/blob/main/modules/cloud_stock.py): `modules/cloud_stock.py`
- [Cloud sync worker](https://github.com/edrian-mp/smartpos-full/blob/main/modules/cloud_sync.py): `modules/cloud_sync.py`
- [Camera driver](https://github.com/edrian-mp/smartpos-full/blob/main/drivers/camera_driver.py): `drivers/camera_driver.py`
- [Scale driver](https://github.com/edrian-mp/smartpos-full/blob/main/drivers/scale_driver.py): `drivers/scale_driver.py`
- [Printer driver](https://github.com/edrian-mp/smartpos-full/blob/main/drivers/printer_driver.py): `drivers/printer_driver.py`

### Other components

- **Seller**
- **Owner**
- **Cloud endpoint**

## Connections

- Seller → Login screen: signs in
- Owner → Login screen: signs in
- App coordinator → Login screen: opens (evidence: `main.py`)
- App coordinator → Seller POS: routes seller (evidence: `main.py`)
- App coordinator → Admin dashboard: routes owner (evidence: `main.py`)
- App coordinator → Customer display: controls (evidence: `main.py`)
- App coordinator → Local database: initializes (evidence: `main.py`)
- App coordinator → Cloud sync worker: starts (evidence: `main.py`)
- App coordinator → Product recognition: initializes (evidence: `main.py`)
- App coordinator → Scale driver: initializes (evidence: `main.py`)
- Seller POS → Product recognition: requests recognition (evidence: `ui/seller_pos.py`)
- Seller POS → Checkout service: submits sale (evidence: `ui/seller_pos.py`)
- Checkout service → Local database: records sale (evidence: `modules/db_manager.py`)
- Checkout service → Printer driver: prints receipt (evidence: `modules/checkout_service.py`)
- Seller POS → Camera driver: captures frames (evidence: `main.py`)
- Admin dashboard → Local database: reads history (evidence: `ui/admin_dashboard.py`)
- Cloud sync worker → Local database: reads queued sales (evidence: `modules/cloud_sync.py`)
- Cloud sync worker → Cloud endpoint: pushes batches
