Case study · Offline retail POS and inventory app
MOPX
An offline point of sale and inventory app for small shops, built with React Native and Expo on a SQLite database stored on the phone. It began as my graduation project, MOB, and was rebuilt as MOPX in 2026.
By Arpan Patra · Updated

The problem
Small grocery shops, kiosks and popup stalls need to bill customers and keep track of stock, often where the internet is unreliable. MOPX runs the whole store workflow on a phone (product entry, barcode lookup, billing, receipts and reports) without a server or an account.
From graduation project to MOPX
MOB began in March 2025 as my graduation project and stored products and bills as JSON arrays in AsyncStorage. That worked for a student project but not as a point of sale database.
In 2026 I rebuilt it in phases (stabilise the repository, move business data to SQLite, make billing correct, then redesign the core POS workflow) and renamed the app MOPX.
Data architecture
- SQLite (expo-sqlite) is the primary database, with idempotent migrations and a repository layer for products, categories, inventory, sales and settings.
- Data from earlier installs is imported from AsyncStorage into SQLite during migration; AsyncStorage now holds only lightweight preferences.
- Creating a sale is a single transaction: the sale, its line items, the payment, an audit log entry and the stock movements are written together, so stock and sales cannot drift apart after a failure.
- Business rules such as cart totals, payment validation, receipt formatting, reports and inventory checks live in plain domain modules with their own unit tests, separate from the UI.
Features
- Barcode scanning with the camera, or manual code entry.
- Inventory management, including a reason for every stock adjustment.
- Billing with payment methods and the shop’s business profile on receipts.
- PDF receipts and reports, JSON backup export and product CSV export.
- A redesigned dashboard, billing, receipt, reports and settings flow with light and dark themes.
Honest scope
MOPX deliberately works offline only for now. The repository documents what is not built yet: cloud sync, authentication, a mode for several users, local encryption and a screen for restoring backups.
Testing
Jest unit tests cover the domain logic (cart and scanner flows, barcodes, currency, receipts, backups) as well as the SQLite migrations and repositories, alongside lint and type checking scripts.