All work
KSFintech · LedgerMobile AppsCase study

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.

Source private
Khatapatra — Shop Ledger & Udhaar interface
Industry
Retail / SMB Finance
Role
Architect & Full-Stack Engineer
Type
Mobile App
Year
2026
Status
Delivered
Mobile + Web + Admin
Surfaces
Offline-first
Storage
4
Entry Types

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.

The problem

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.

The 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.

Technical stack

Frontend

  • Flutter
  • Riverpod
  • Next.js 15
  • Tailwind CSS 4

Backend

  • NestJS 11

Data

  • sqflite
  • MySQL 8

Also used

  • Prisma
  • Dio

System architecture

  1. 1

    NestJS 11 API over Prisma and MySQL 8, serving all three surfaces from one contract

  2. 2

    Flutter mobile app with Riverpod state and sqflite for offline-first storage, syncing through Dio

  3. 3

    Next.js 15 web app doubling as the marketing site and the super-admin panel

  4. 4

    Seeded demo book with entries, contacts and reminders for evaluation

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 I solved it

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 I solved it

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.

Core features

  • 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

Results & impact

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.

Screenshots

Khatapatra — Shop Ledger & Udhaar screenshot 1

What I learned

  • 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.

Related work

All projects
Next step

Have a system like this to build?

I take projects from the first conversation through to production, and stay on for the support that follows.