CorePOS
Desktop Point of Sale & Inventory Management Software
๐ฏ Project Overview & Objective
A local-first desktop application designed for retail point-of-sale operations, inventory tracking, transaction receipts, feature gating, and data backup safeguards.
โก The Engineering Challenge
Retail stores, bookshops, and stationery businesses in emerging markets face frequent internet disruptions and power fluctuations. Conventional cloud-only POS systems freeze or drop carts during connectivity drops, causing customer queue delays, cash reconciliation errors, and inventory discrepancies. Small retail businesses require a zero-latency, local-first point of sale that operates completely offline while maintaining strict data integrity and hardware printing capabilities.
๐๏ธ Architecture & System Design
Frontend Architecture
React 18 single-page application with TypeScript and modern CSS, delivering sub-15ms user interaction latency and responsive keyboard-first cashier shortcuts.
Backend & Service Layer
Tauri 2 desktop runtime with a native Rust core, bridging frontend commands to the operating system via safe, asynchronous inter-process communication (IPC).
Database & Persistence
Embedded SQLite database running locally on the merchant's machine. All transactions (sales, stock adjustments, credit payments) execute in strict atomic ACID transactions (BEGIN TRANSACTION ... COMMIT) with WAL mode enabled.
Auth, Permissions & Security
Local Argon2 password hashing and role-based access control (Cashier, Manager, Administrator) enforced natively on the Rust side before executing database operations.
Infrastructure & Packaging
Self-contained Windows desktop application leveraging WebView2, eliminating bundled Chromium browser binaries and significantly reducing idle memory overhead compared to multi-process Electron runtimes.
System Architecture Data Flow
+-----------------------------------------------------------------------------+
| CLIENT PRESENTATION LAYER |
| React 18 SPA (TypeScript) / Windows WebView2 Desktop Viewport |
| - Keyboard-First Cashier POS Grid - Instant Barcode / SKU Scanner Engine |
| - Cart Line-Item Computations - Customer Credit & Settlement UI |
+--------------------------------------|--------------------------------------+
| Asynchronous IPC (JSON Commands)
v
+-----------------------------------------------------------------------------+
| RUST DESKTOP RUNTIME |
| Tauri 2 Core Architecture |
| - Argon2 Password & Role RBAC - Cash Drawer Session Reconciler |
| - Multi-Entity Checkout Safeguards - Schema Migrator (PRAGMA user_version)|
+------------------|---------------------------------------|------------------+
| Direct ESC/POS Driver Pipeline | Local SQLite Engine
v v
+------------------------------------+ +------------------------------------+
| HARDWARE LAYER | | LOCAL STORAGE ENGINE |
| Thermal Receipt & Invoice Printer | | Embedded SQLite (WAL Mode, ACID) |
| (Raw Socket / USB ESC/POS) | | Transactions, Ledgers, Customers |
+------------------------------------+ +------------------------------------+ ๐ Implemented Capabilities
Local-First Offline Checkout Engine
Instantaneous barcode scanning, item lookup, and cart calculations that process cash, customer credit, and partial payments with zero internet requirement.
Real-Time Stock Decrementing & Low-Stock Alerts
Automatic inventory deductions upon sale confirmation, multi-unit packaging support, sequential barcode/SKU generation, and configurable low-inventory reorder thresholds.
Customer Credit Ledger & Debt Settlement
Dedicated credit tracking allowing trusted customers to buy on credit with partial payment logging, running balance summaries, and payment history receipts.
Supplier Purchases & Multi-Line Expense Logging
Structured tracking of inbound stock purchase orders, supplier payments, and recurring business operating expenses recorded in transactional ledgers.
Cash Drawer Session Management
Shift opening and closing workflows with starting cash verification, expected vs actual cash counting, discrepancy flagging, and end-of-day reconciliation summaries.
Hardware Thermal Receipt & Invoice Printing
Direct ESC/POS and standard printer support via WebView printing pipelines, generating formatted receipts, customer invoices, and Z-reports.
๐ ๏ธ Engineering Challenges & Solutions
Atomic Multi-Entity Transaction Safeguards
A single checkout operation must decrement stock for multiple items, create line items, record customer credit, log payment method splits, and update register balances without risk of partial writes during sudden power loss.
Enforced strict SQLite transactions across all checkout commands in Rust. If any single constraint fails or an interruption occurs, SQLite rolls back the entire state to preserve ledger integrity.
Idempotent Local Database Migration
Updating desktop applications on client machines must migrate existing local SQLite databases to new schema versions without losing historical transaction records or requiring manual DBA intervention.
Implemented an idempotent schema migration runner at application startup that checks PRAGMA user_version, executes non-destructive incremental DDL scripts, and creates automated pre-migration database backups.
โ๏ธ Technical Decisions & Architectural Trade-offs
Tauri 2 + Rust Core vs Electron
Selected Tauri 2 with a native Rust core to minimize background resource usage compared to Electron and enable direct, low-overhead OS hardware communication with thermal receipt printers.
Required writing custom Rust IPC commands and data serializations instead of using existing Node.js npm packages directly.
Local SQLite with WAL Mode vs Embedded NoSQL
Selected SQLite for strict ACID transactional guarantees, foreign key cascades, and atomic stock rollbacks under sudden power loss.
Required building a custom DDL migration runner instead of using dynamic schema-free document insertion.
Local-First Architecture vs Cloud-Connected API
Prioritized 100% offline autonomy for retail environments where power and internet connectivity fluctuate daily.
Cloud backup and multi-device sync must be handled via scheduled asynchronous export rather than real-time WebSockets.
๐งช Testing Strategy & Verification
Quality Strategy: Local automated SQLite transaction integrity testing and real hardware ESC/POS receipt generation validation.
Verified Test Scenarios
- Simulated process-termination and transaction abort testing validating SQLite rollback integrity during multi-item checkouts.
- Idempotent schema migration validation from v1 schema to v2 without data loss using PRAGMA user_version.
- High-speed continuous barcode scanning buffer stress testing without dropped input events.
- Thermal receipt formatting and cash drawer kick pulse signaling over ESC/POS command sequences.
๐ Results & Technical Learnings
Verified Implemented Outcomes
- Developed and verified a robust local-first desktop POS operating completely offline with immediate, low-latency UI responsiveness.
- Validated sales, customer credit, supplier purchases, expense tracking, and thermal receipt formatting in simulated retail workstation testing.
- Commercial enterprise codebase maintained in private repository with proprietary business logic kept secure.
Planned Next Milestones
- Background cloud backup synchronization and multi-terminal LAN replication while preserving the offline-first guarantee.
- Direct integration with wireless barcode scanners and ESC/POS raw socket printing.
Architectural Takeaways
- Tauri 2 + SQLite is a dramatically superior stack compared to Electron for local-first business software, providing a significantly leaner architecture than Chromium-bundled desktop frameworks.
- ACID compliance at the local database layer is the single most important reliability guarantee for offline retail software.
๐งฐ Complete Technology Stack
Need a Similar System or Application?
I collaborate with businesses and agencies to engineer scalable web backends, interactive client applications, and custom automation workflows.