Skip to content
KSCase studyFintech · LedgerDelivered

Khatapatra — Shop Ledger & Udhaar

Replaces a shopkeeper’s paper udhaar book with a running per-customer balance and reminders that settle themselves.

A ledger app for shops and small businesses: daily income and expenses, udhaar with a running balance per contact, and payment reminders that settle themselves into real ledger entries when they come due.

Khatapatra — Shop Ledger & Udhaar interface
Industry
Retail / SMB Finance
Role
Architect & Full-Stack Engineer
Type
Mobile App
Year
2026

01

Overview

Khatapatra is a digital khata for shopkeepers — the paper ledger, kept properly. It tracks daily income and expenses, and handles udhaar (informal lending) with a running balance per contact, so a shopkeeper always knows both the day's position and who still owes them.

The distinguishing detail is that reminders are not notifications. When a payment reminder comes due and is settled, it becomes a real ledger entry rather than a note the user has to re-enter — the reminder and the accounting are the same object, so the balance stays correct without double-entry by hand.

One NestJS API serves three surfaces: a Flutter mobile app for shopkeepers built offline-first on sqflite, a Next.js marketing site, and a super-admin panel.

02

Business challenge

Shopkeepers track income, expenses and udhaar in paper ledgers. Balances drift, who-owes-what is reconstructed from memory, and payment reminders — when they exist at all — are separate from the accounting, so settling one means re-entering it as a transaction.

03

Solution

A ledger app modelled on how a khata is actually kept: entries by type, a running balance per contact for lending, and reminders that resolve into ledger entries when settled so the books stay correct without duplicate data entry.

What it does

Daily income and expense ledger with four entry types
Udhaar tracking with a running balance per contact
Payment reminders that settle into real ledger entries
Offline-first mobile storage with sqflite
Reports over the ledger period
Multi-book support per business
Super-admin panel over the same API
JWT auth with role separation

04

Product screenshots

Screens from the application itself. Select any image to view it full size.

05

Architecture

How it fits together

  1. 01NestJS 11 API over Prisma and MySQL 8, serving all three surfaces from one contract
  2. 02Flutter mobile app with Riverpod state and sqflite for offline-first storage, syncing through Dio
  3. 03Next.js 15 web app doubling as the marketing site and the super-admin panel
  4. 04Seeded demo book with entries, contacts and reminders for evaluation

06

Engineering challenges

Challenge
A reminder and the transaction that settles it are usually separate records, so settling a reminder leaves the ledger untouched until someone re-enters the amount.
How it was solved
Modelled the reminder as a pending ledger entry rather than a notification, so settling it commits the entry directly and the running balance updates without a second manual step.
Challenge
Shop connectivity is unreliable, and a ledger that refuses to record a sale because the network is down is worse than paper.
How it was solved
Built the mobile app offline-first on sqflite — entries are written locally and reconciled with the API when connectivity returns, so the ledger is always writable.

07

Technology stack

Frontend
FlutterRiverpodNext.js 15Tailwind CSS 4
Backend
NestJS 11Prisma
Data
sqfliteMySQL 8
Also used
Dio

08

Business impact

Mobile + Web + Admin
Surfaces
Offline-first
Storage
4
Entry Types

A shopkeeper gets the day's in/out position and a per-contact udhaar balance in one place, with reminders that keep the books correct when they settle — and the app keeps working when the connection does not.

09

Project status

Delivered2026

What I took from it

  • Modelling a reminder as a pending entry rather than a notification removed an entire class of reconciliation bugs.
  • For users whose alternative is paper, offline-first is not a feature — it is the minimum bar for being trusted with the data.

Next step

Need a similar solution for your business?

Tell me what you are trying to build or fix. I will come back with how I would approach it, what it realistically takes and where the risks are.

Related work

All projects