A proof-of-concept demonstrating the two-way synchronization between Admin and POS apps via file exchange (simulating WhatsApp transfer).
┌─────────────────────────────────────────────────────────────────────┐
│ DATA OWNERSHIP │
├─────────────────────────────────────────────────────────────────────┤
│ │
│ ADMIN (Owner's Phone) POS (Shop Device) │
│ ═════════════════════ ═════════════════ │
│ │
│ Controls: Controls: │
│ ✏️ Product names 🛒 Sales transactions │
│ ✏️ Prices (cost & selling) 🛒 Stock levels │
│ ✏️ Active/inactive status 🛒 Receipt numbers │
│ │
│ admin_config.json pos_backup.json │
│ ┌──────────────────────┐ ┌─────────────────────┐ │
│ │ • Product prices │───────►│ Import prices │ │
│ │ • No stock levels! │ │ KEEP local stock! │ │
│ └──────────────────────┘ └─────────────────────┘ │
│ │
│ ┌──────────────────────┐ ┌─────────────────────┐ │
│ │ View sales reports │◄───────│ • Sales data │ │
│ │ See stock levels │ │ • Stock levels │ │
│ └──────────────────────┘ └─────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────┘
When POS imports config from Admin:
- ✅ Prices are updated
- ✅ Product names are updated
- ✅ Stock levels are PRESERVED (not overwritten!)
This allows the Admin to change prices anytime without affecting the shop's inventory counts.
npm install
npm testThe test will:
- Initialize a POS with 5 products
- Make 3 sales (stock decreases)
- Export POS backup →
data/pos_backup.json - Admin imports backup and sees sales
- Admin changes prices (Coca-Cola ↑, Chips ↓)
- Export Admin config →
data/admin_config.json - POS imports config
- Verify: Prices changed, but stock PRESERVED!
schema.sql- Database schematest.js- Complete test scriptdata/pos_backup.json- POS → Admin (sales + stock)data/admin_config.json- Admin → POS (prices only, no stock!)
Build actual mobile apps (Capacitor/React Native) that:
- Use SQLite for local storage
- Export/import via Android Share Intent
- Transfer files via WhatsApp