How mokhethinyaps/localops-pos works
LocalOps POS is an offline-first desktop point-of-sale and business-operations application. Its user workflow begins with initial business setup, proceeds through local sign-in and a workspace, and supports catalogue configuration, inventory, sales and refunds, shifts and expenses, reporting, and backup/restore. React invokes Tauri commands; Rust handlers bridge to the Rust domain layer and a local SQLite database. The sampled sales implementation explicitly coordinates payment, recipe, inventory, and audit behavior. Other command-to-domain details are based on the registered command areas and module names; unsampled internal links are omitted.
Main entry points: src/lib.rs SQLite database · src/lib.rs Tauri runtime · session_guard.rs Session authorization · sales_commands.rs Sales commands
Components 26
Desktop interface
- Workspace UI
src/App.tsx
Tauri commands
- Tauri runtime
src-tauri/src/lib.rs - Setup and session
src-tauri/src/commands.rs - Catalogue commands
src-tauri/src/catalogue_commands.rs - Inventory commands
src-tauri/src/inventory_commands.rs - Sales commands
src-tauri/src/sales_commands.rs - Operations commands
src-tauri/src/operations_commands.rs - Report commands
src-tauri/src/report_commands.rs - Safety commands
src-tauri/src/safety_commands.rs - Session authorization
src-tauri/src/session_guard.rs
Business domain
- Business setup
crates/localops-core/src/setup.rs - Local sessions
crates/localops-core/src/session.rs - Catalogue and products
crates/localops-core/src/catalogue.rs - Inventory operations
crates/localops-core/src/inventory_operations.rs - Sales and checkout
crates/localops-core/src/sales.rs - Payments
crates/localops-core/src/payment.rs - Refunds
crates/localops-core/src/refund.rs - Shifts
crates/localops-core/src/shift.rs - Expenses
crates/localops-core/src/expense.rs - Reporting
crates/localops-core/src/report.rs - Backup and restore
crates/localops-core/src/backup.rs - Audit records
crates/localops-core/src/audit.rs - Recipes
crates/localops-core/src/recipe.rs
Local state
- SQLite database
crates/localops-core/src/lib.rs - Database bootstrap
crates/localops-core/src/bootstrap.rs
Other components
- Business operator
Connections 48
- Business operator → Workspace UI: uses
- Workspace UI → Tauri runtime: invokes commands
- Tauri runtime → Setup and session: dispatches
- Tauri runtime → Catalogue commands: dispatches
- Tauri runtime → Inventory commands: dispatches
- Tauri runtime → Sales commands: dispatches
- Tauri runtime → Operations commands: dispatches
- Tauri runtime → Report commands: dispatches
- Tauri runtime → Safety commands: dispatches
- Tauri runtime → SQLite database: manages connection
- Tauri runtime → Database bootstrap: bootstraps
- Setup and session → Session authorization: checks session
- Catalogue commands → Session authorization: checks session
- Inventory commands → Session authorization: checks session
- Sales commands → Session authorization: checks session
- Operations commands → Session authorization: checks session
- Report commands → Session authorization: checks session
- Safety commands → Session authorization: checks session
- Setup and session → Business setup: completes setup
- Setup and session → Local sessions: starts session
- Sales commands → Sales and checkout: records sale
- Sales commands → Payments: loads methods
- Sales commands → Refunds: creates refund
- Sales commands → Shifts: checks open shift
- Sales and checkout → Inventory operations: records stock use
- Sales and checkout → Recipes: reads recipes
- Sales and checkout → Payments: validates payment
- Sales and checkout → Audit records: records audit
- Sales commands → SQLite database: reads and writes
- Catalogue commands → Catalogue and products: manages catalogue
- Inventory commands → Inventory operations: records operations
- Operations commands → Shifts: manages shifts
- Operations commands → Expenses: records expenses
- Report commands → Reporting: builds reports
- Safety commands → Backup and restore: backs up and restores
- Session authorization → Local sessions: resumes session
- Session authorization → SQLite database: reads context
- Database bootstrap → SQLite database: initializes
- Business setup → SQLite database: writes setup data
- Local sessions → SQLite database: reads and writes
- Catalogue and products → SQLite database: reads and writes
- Inventory operations → SQLite database: reads and writes
- Payments → SQLite database: reads and writes
- Refunds → SQLite database: reads and writes
- Shifts → SQLite database: reads and writes
- Expenses → SQLite database: reads and writes
- Reporting → SQLite database: reads data
- Backup and restore → SQLite database: backs up and restores