Every neighbourhood has one. A shop the width of a doorway, shelves to the ceiling, and a man behind the counter who knows the price of four hundred things without looking. He knows which brand of tea you buy. He knows your father's name. And when you're short at the end of the month, he waves you off and says "pay me later", then writes something in a notebook.
That notebook is the most important thing in the shop. It's worth more than the fridge.
I spent the first half of November building Karobar ERP, software meant to do that notebook's job for small shops, wholesalers and distributors. To build it I had to understand what the notebook really is, and it turned out to be a lot more than a list of debts.
What's actually in the notebook
In Urdu the notebook is called a khata, and the credit it records is udhaar. A page per customer. A line each time they take something without paying, a line each time they pay something back.
Look at it as a programmer would and it's a small database. But look at it as the shopkeeper does and it's three different things at once.
It's his memory: who took what, and when. It's his bank: a large share of everything he owns isn't in the drawer, it's out in the neighbourhood, in other people's kitchens. And it's his relationships: every line is a small act of trust, and knowing when to extend a little more of it, and when to stop, is most of the skill of running a shop.
So when someone says "just put it on a computer", they're asking him to hand over all three. No wonder most of them haven't.
Three ways a notebook fails
The notebook works beautifully for years. Then it fails in one of three ways, and none of them is the shopkeeper's fault.
It can't add itself up. Ask him "how much does the whole neighbourhood owe you right now?" and the honest answer is "let me sit down on Sunday". He has to turn every page. So he rarely asks, and a business where nobody knows the total owed is a business that can run out of cash while being owed a fortune.
It only knows about money owed, not stock. The notebook says Paradise Bakers took ten cartons of cooking oil. It doesn't say there are now only two cartons left on the shelf, or that the ones at the back expire next month.
It lives in one place. One fire, one flood, one spilled cup of tea, one family argument, and the record of who owes what is gone. So is the trust, because now it's his word against forty customers.

The first screen I built to answer these is called, simply, Who owes me. Every customer, what they owe, and how late it is, added up without anyone turning a page. Beside each name is a button that opens WhatsApp with a polite reminder already written. That one button is the notebook's job done in a way the notebook never could.
A 500-year-old trick for not fooling yourself
Here's the idea that sits underneath all of it, and it's older than you might think.
In 1494 an Italian friar named Luca Pacioli published a maths textbook that included a description of how the merchants of Venice kept their books. Their method is called double-entry bookkeeping, and nearly every business on Earth still uses it. It sounds intimidating. It's actually one sentence:
Money never appears or disappears. It only moves, so write down both ends of the journey.
When a customer pays five hundred rupees, that isn't one fact. It's two. Your cash went up by five hundred, and what that customer owes you went down by five hundred. Write both, every time, and something lovely happens: all the "went up" entries and all the "went down" entries must come to the same total. If they don't, you've made a mistake, and you know it today rather than in March.
That's the whole trick. It's a way of making your own mistakes visible. A notebook with one column can be wrong for a year without anybody noticing. Books with two sides complain the moment they're wrong.
The shopkeeper using Karobar never sees the words "debit" or "credit". He presses Cash on a sale. But behind that button, both ends of the journey are written down, and the software refuses to save anything where the two sides don't match. He gets the protection of a method invented for Venetian spice traders without having to learn it.

The last bag of rice
Imagine a shop with two counters and one bag of basmati left. Two customers ask for it at the same second. Both cashiers glance at the screen, both see "1 left", both say yes.
Now somebody has paid for rice that isn't there. In a tiny shop, you'd sort it out with an apology. In a wholesaler taking orders by phone and WhatsApp all day, it can happen again and again, and each time it costs a customer's trust.
The fix is the same one a good shop already uses for its only key to the storeroom: one person holds it at a time. When a sale is about to take the last bag, the software briefly holds that item so nobody else can touch it. The second sale waits for a blink, sees the true number, which is now zero, and is told the rice is gone before any money changes hands.
I tested this the unkind way: I had the computer fire several sales of the same last item at exactly the same instant, over and over. One wins. The others are told no. It has to work every time, not most of the time, because "most of the time" is exactly how the notebook fails.
Also readRAG Retrieval Strategies on a 50k-Document Dataset: BM25 vs Dense vs Hybrid
The Discount That Knew You Were Hesitating: Rule-Based Personalisation in an Online Pharmacy
Speaking the customer's language, properly
Most business software in Pakistan is in English. Most shopkeepers think, count and argue in Urdu, Sindhi, Punjabi or Pashto. Asking someone to run their livelihood in their third language is asking them to make mistakes.
So Karobar works fully in English, Urdu and Arabic. That turned out to mean far more than translating words. Urdu and Arabic are written from right to left, so the whole screen has to mirror: the menu moves to the right side, lists start from the right, arrows point the other way. The printed bill has to mirror too.

And the words themselves had to be plain in every language. The page an accountant would call "accounts receivable ageing" is called "Who owes me". The page they'd call "profit and loss statement" opens with a question: "Did you make money in this period?" Every screen has a small box at the top that explains, in three numbered steps, what the page is for.
I want to be honest about one limit. I've reviewed the Urdu and Arabic text carefully once, but some phrases still need a native reader's eye, and I've listed those openly rather than pretend they're perfect.
The numbers I wouldn't guess
Shops have staff, and staff have salaries, and salaries come with rules set by the government: income tax, pension contributions, minimum wages. Get them wrong and a real person is paid the wrong amount.
For income tax, I read the law itself and built the official rates in. But for one pension contribution, I found something uncomfortable. Websites and guides all stated the rate confidently. The copy of the law I could find said something else. And I couldn't find the official document that settles it.
It would have been easy to pick the popular number and move on. Instead I made a rule: if I can't point to the official source for a legal number, the software doesn't ship it. The box stays empty and the business fills in what their own accountant tells them.
It makes the product look less finished. I think it makes it more trustworthy, for the same reason you'd trust a shopkeeper who says "I'm not sure, let me check" over one who always has an answer.
Looking at your own shop from above
Here's what the notebook could never give its owner: a view from above.

One page that says: eight products are running low. Ten bills are overdue. You've sold this much this month, and this much of it was profit. Your customers owe you this. You owe your suppliers that. Your shelves are holding this much money in goods.
None of that is new information. All of it was already true, scattered between the shelves, the drawer and the notebook. The software's only job is to put it in one place and keep it right. That turned out to be nearly the whole job.
To check that it really works, I had the computer invent two businesses, a corner store in Hyderabad and a trading company in Dubai, and live through months of buying, selling, returns and paydays. The first time I ran it, both imaginary shops were slowly going broke, and the software showed me exactly why, line by line. I've never been so pleased to see bad news.
What it taught me
Three ideas stayed with me, and they apply far beyond shops.
Old systems survive for good reasons. The notebook isn't a failure of technology. It's cheap, it never crashes, and it holds a relationship as well as a number. Anything that wants to replace it has to respect what it already does well.
Write down both ends of the journey. Whether it's money, stock or your own time, a record that can check itself is worth more than a record that's merely neat.
"I don't know" is a feature. Software that leaves a box empty when it isn't sure is more useful than software that confidently fills it in.
Karobar ERP is open source and free to use. The public demo goes live after one more round of testing, with a pair of invented shops anyone can sign into and poke around. If you run a shop, or keep the books for one, I'd genuinely like to hear what's in your notebook that I haven't thought of.
The full build, with the architecture, the tests and the mistakes I made along the way, is in the Karobar ERP case study.
Up next
Keep reading.
01Karobar ERP: Books That Balance for the Corner Shop
How I built Karobar ERP: an open-source Django and React system that gives a small shop or distributor its stock, sales, accounts and payroll in one place, in English, Urdu and Arabic, with books that always balance and stock that stays right when two cashiers sell the last item.
11 minThe Engineering Logs
02A Library That Fits on a USB Stick
Wikipedia can work with no internet at all. A plain-language story of how offline Wikipedia reaches schools and clinics, why choosing the articles is the hard part, and what building OfflineShelf taught me about lists, change and giving credit.
6 minThe Engineering Logs
03The Day the Money Moves
When you buy a share, you don't own it the moment you click. A plain-language story of trade settlement, T+1 and T+2, why holidays in two countries can push a payment back a day, and what building MarketClock taught me about dates that have a history.
4 minThe Engineering Logs
04The Weekend Is Not a Constant
Why 'is this a working day?' breaks so much software: weekends that differ by country and change over time, holidays that follow the moon, time zones that disagree about today, and the habits that kept my own date logic honest while building HolidayOps.
5 minThe Engineering Logs
05I Invented 14 People to Break My University Website
A plain-language story about testing a university admissions website with fourteen imaginary people, from a careless applicant to a would-be hacker, and the real bugs they found that I never would have.
7 minThe Engineering Logs
06AIT: Building a University Admissions Portal From Scratch
How I turned what I learned in my XCL Technologies internship into Ahmer Institute of Technology: a university website with applicant, student, teacher, staff and admin portals, safe file uploads, Docker, and 58 end-to-end tests that found real bugs.
8 minThe Engineering Logs
