Database-first Point-of-Sale, Inventory & Ledger System for Uganda Hardware Businesses (Next.js 15, PostgreSQL/Supabase)
# HardwareDesk — Uganda Hardware Management & Point-of-Sale System
HardwareDesk is a fast, database-backed Point-of-Sale (POS) and inventory management platform designed specifically for hardware retail and wholesale businesses in Uganda.
---
## 🏛 Core Architectural Principle
> **THE DATABASE IS THE SOURCE OF TRUTH.**
>
> The frontend is an interactive view and command dispatcher. Every stock level, sale transaction, debtor balance, revenue metric, and receipt is derived from and enforced by persisted PostgreSQL database records.
---
## 🌟 Key Features
- **Dashboard**: Real-time business pulse displaying Today's Revenue, Sales Count, Low Stock Count, recent sales register, and top fast-moving items.
- **Quick Sales Terminal**: Fast POS checkout with instant barcode/SKU scanning, keyboard hotkeys (`/` to search), mobile drawer cart sheet, customer selection, store credit redemption, and 80mm thermal / A4 invoice printing.
- **Receipt Book**: Chronological sales register with full-text search, date filtering, and instant historical receipt reprints.
- **Inventory & Products**: Normalized catalog with unit tracking (bags, kg, pcs, meters, litres, rolls), location bins, minimum stock thresholds, and an auditable **Movement Ledger** (`inventory_movements`) tracing all stock ins and outs.
- **Purchases & Suppliers**: Inbound PO receiving that automatically restocks products, updates unit costs, records supplier credit obligations, and tracks payments.
- **Blind Stock Take**: Conceals system counts during physical audits to prevent bias, computes variance discrepancies, enforces manager approval for variances $\ge 5$ units, and commits verified adjustments.
- **Debtors & Creditors Ledger**: Tracks customer credit sales, partial debt settlements with instant payment receipts, and customer advance prepayments (Store Credit).
- **Financial Reports & Analytics**: Real-time calculation of Sales Revenue, Cost of Goods Sold (COGS), Gross Profit, Profit Margins, Net Cash Flo …