DEV Community

Saqib Riaz
Saqib Riaz

Posted on

The Shopkeeper's Ledger, Rebuilt for a Phone: Lessons from Building Ledgware

Walk into a small shop in Pakistan and you will find the real business running in a paper ledger. Who owes what, which stock is finished, what sold today — it is all there, in handwriting, in a book that can be lost, soaked, or simply misread at the end of a long day. The shopkeeper knows his business by memory and by that book. The book works until the day it does not.

Ledgware is the app I built to put that ledger on a phone without taking away what makes the paper version good: it works offline, it belongs to the shopkeeper, and it does not ask him to trust a server he has never seen. It is a shop manager — Khata, invoices, and stock — built for the way small shops actually run.

Start with the khata, not the dashboard

Every shop app I looked at opened on a dashboard full of charts. That is the wrong first screen for a shopkeeper whose first question every morning is "who owes me money, and who do I owe?" So Ledgware's heart is the Digital Khata: customers and suppliers with running balances, credit given and received, partial payments, and reminders for what is overdue. The dashboard exists, but it answers to the khata, not the other way around.

The same thinking shaped the billing. A sale in a small shop is one transaction, start to finish — scan or pick the items, take the money, hand over a bill. Ledgware's POS does exactly that in one flow and produces a proper PDF invoice the customer can keep. Returns work the same way, and here I learned a lesson worth the telling: the first version of returns restocked from re-derived product data, and it got a two-variant edge case wrong. The fix was to store the returned items themselves and validate the total returned quantity against what was actually sold, before writing anything. A shop's numbers must never drift because of a clever shortcut. They are the business.

Stock that tells the truth

Inventory in Ledgware is not a list; it is a set of honest answers. What is in stock, what is low, what has not sold in weeks, what the stock is actually worth. Purchases and expenses are recorded where they happen, not reconstructed at month end. The reports are built from the same real data — sales, stock health, dead stock, branch sales by day — and the export is a real PDF or Excel file, not a screenshot of a chart.

I also built a small on-device business intelligence view, and I want to be plain about what it is: calculations run on the phone from the shop's own data. There is no "AI" label on it, because there is no AI in it. A shopkeeper making decisions about his money deserves to know whether he is reading arithmetic or a guess. My other apps follow the same rule — my sticker app Stickora and my tailoring manager TailorVexa are both labelled honestly, and you can read how they were built here:

Offline first is a promise, not a feature bullet

"Offline-first" gets printed on a lot of app pages. In Ledgware it is a design rule with consequences. The whole shop runs from a local database on the phone — Drift, 37 tables by the end of the build — so a shop with no signal loses nothing: no waiting, no failed saves, no "please check your connection" at the counter. There is an optional cloud sync to a FastAPI backend I wrote alongside the app, but it is exactly that: optional. The app is complete without it, and there is no Ledgware-operated server holding anyone's books. The backend source is deploy-ready for a shop that wants its own server, and the sync handles conflicts and keeps financial records immutable when it runs.

That same caution shaped the multi-branch and staff features. Staff roles come with approvals — a junior cannot quietly write off stock or approve a return — and each branch keeps its own honest numbers. A shop that grows into two counters should not have to buy a second system or lose the thread of the first one.

The honest limits

A build-story article should carry the gaps as well as the wins, so here are Ledgware's, stated plainly:

Payments are test-mode only — real payment processing is not wired up yet, and the plans (Free, Pro at $6, Business at $15) reflect what the app does today, not a promise. The cloud sync's dual-write path is still pending. The interface is English, Urdu, and Arabic in its chrome and navigation, but the deep feature screens — POS, Khata, inventory forms — are still English inside; the translation system is in place and those screens are next. And notifications are deliberately small in scope: one daily summary reminder plus immediate alerts when the app opens and something needs attention — low stock, overdue khata, pending approvals. There is no background worker pretending to watch the shop while the app sleeps.

What is finished is finished properly: 165 automated tests passing, a clean static analysis, PIN and biometric lock, backup and restore, CSV import and export, and a mini digital shop so a shopkeeper can share a simple product catalogue with customers over WhatsApp. The same honest-labelling approach shaped my VPN project QYBERNA, my QR scanner Scanqra, and my YouTube packaging companion RankPilot AI:

What shipping it taught me

The first version went onto a real phone for a real test, and the test found six gaps. Every one of them was fixed in the next version — that is the whole job, really. Software for a shopkeeper is not a demo; it is the record of who owes whom, and it has to be right on a tired evening with a queue at the counter, not just in a test suite.

Ledgware's lesson is the same one my other apps kept teaching me: build the boring truth first. The ledger, the stock count, the invoice that adds up. Everything else — the charts, the catalogue, the plans — is decoration on top of numbers the owner can trust. Get the numbers right, and the rest earns its place.

If you run a small shop, or build software for people who do, I would love to hear what your ledger looks like today — paper, phone, or a mix of both — and which part of it you would never trust to an app.

Written by Saqib Riaz, an independent Android developer at AI Tech Apps (https://aitechappspk.blogspot.com/).

Top comments (1)

Collapse
 
userxnom profile image
Abdullah Naseer •

The 'start with the khata, not the dashboard' decision is the one I'd steal — most shop apps lead with charts, and you're right that the shopkeeper's first question every morning is 'who owes me money.' The returns fix is the detail that tells me you shipped this to real users: storing the returned items instead of re-deriving them is exactly the boring correctness that matters when the numbers are the business. One question: with the dual-write sync still pending, what happens when a shop restores a backup on a second phone — does the local database just win, or is there a merge rule for khata balances?