Retail POS System — Offline-First Point of Sale
A Django-based, offline-first point-of-sale system built for small retail businesses. It handles sales recording, inventory management, and returns, and uses a phone's camera for barcode scanning for stock taking, and inventory management, and completing sales instead of requiring dedicated scanner hardware.

The problem
Small retail businesses often lose sales during internet outages, since most POS systems are cloud-dependent and stop working the moment connectivity drops.
In addition, manual inventory counts are slow and error-prone, and dedicated barcode scanner hardware adds cost most small shops can't justify.
What I built
Offline-First Architecture
Built on a dual-database setup with SQLite as the default local store, PostgreSQL as the sync target so the system keeps recording sales locally even when the internet is down, then automatically syncs once connectivity returns. A live status widget shows staff their current connection state.
Phone-Camera Stock Taking
Uses the browser's BarcodeDetector API, with a fallback to Html5QrcodeScanner for unsupported devices, so any phone camera becomes a barcode scanner. There's no extra hardware needed for inventory management or sales recording.
Separate manager, staff, and super admin accounts
Separate accounts for managers, staff, and super admins to ensure proper access control and security. Each account type has different levels of access and permissions, and can only perform specific tasks and access different parts of the system.
Customer management
The cashier can add a customer at the time of sale. This way, the cashier can find the customer then next time they visit. Also, all customer purchases and refunds are stored for retrieval later.
Returns & Refunds
Built a dedicated returns module so staff can process refunds without manual database edits or workarounds.
Low Stock Alerts
Automated email notifications fire when inventory drops below a set threshold, so restocking happens before a shelf goes empty.
Management Dashboard
Built on Django Unfold with custom routing and Chart.js visualizations, giving owners date-range filtering and sales insight without needing a separate analytics tool.


How it's built
Why Django, and why offline-first
A point-of-sale system can't stop working when the internet does. The shop keeps trading through outages, and a sale can't wait on a remote server.
So the system is built offline-first: SQLite is the main database on the device, so every sale is recorded locally and instantly. When a connection is available, it syncs both ways with PostgreSQL. Local sales are pushed up, and changes made elsewhere come back down.
Django gave us a mature ORM, built-in authentication, and an admin we could adapt rather than build from scratch, which kept the codebase small and easy to maintain.
Frontend and asset pipeline
The interface is server-rendered Django templates with Alpine.js for small interactions and HTMX for partial page updates, so there is no single-page-app framework to maintain.
Assets are bundled with Vite and wired into Django through django-vite. Python dependencies are managed with uv. Dashboards use Chart.js. Barcode scanning uses the browser's BarcodeDetector API, so cashiers can scan with a phone camera instead of dedicated hardware.
During development the app is tested on a real phone over the local network, since that is how it will be used.
Data and features
The core model covers products, sales, and stock, with low-stock alerts to prompt reordering. Returns and refunds are first-class features rather than manual adjustments, so the records stay accurate.
A sync widget shows staff whether the device is caught up, which makes the offline behaviour visible instead of mysterious. Back-office work happens in the Django Unfold admin, which gives managers a modern interface without a custom admin build.
Payments
The system supports M-Pesa and Airtel Money alongside cash, because that is how customers in Kenya actually pay.
Security and access
A custom user model with manager roles controls who can do what, such as who can issue refunds or change stock. Because every device keeps its own local copy and syncs with PostgreSQL, the shop's records exist in more than one place, so a failure in one doesn't take them all with it.
Results
We love how easy this POS is to use, especially with the phone camera and barcode scanner. Now, all my employees can complete sales wherever they are in the store, and I can see sales and other data wherever I am. The email alerts help me keep track of my stock, and being able to see all transactions on my phone helps with financial management.Njoroge Muhia, Retail Partner, Njuwa Traders
Need a similar website, platform or tool for your business?
Tell me what you're building and I'll reply with next steps.
Start a project