Skip to main content
ChintoLabChintoLab
The Saram stock and khata app: customer ledger, payment settlement and WhatsApp receipt screens built by ChintoLab
Case Studies

KhataApp: a case study

An offline-first stock and khata app. First deployed for Saram, a plastic granules wholesaler.

ChintoLab TeamSeptember 11, 20263 min readUpdated September 14, 2026
An offline-first stock and khata app. First deployed for Saram, a plastic granules wholesaler.

Saram is a plastic granules wholesale shop whose entire accounting ran on a paper register and Excel. ChintoLab built a mobile-first khata and stock app around how the shop actually works. A flat ledger with a running balance, a per-bag rate typed on every entry because it changes daily, and a settlement engine that matches payments to old sales automatically.

The shop's internet is unreliable, so the app is offline-first: one online login, then seven days of full use without a connection, syncing back the moment it returns.

Receipts and statements go to customers on WhatsApp as shop-branded images, and the whole thing ships as an installable PWA and a signed Android APK.

The problem

Saram's plastic granules wholesale shop kept its entire accounts in a paper register and Excel. Every customer's credit, the per-bag rate that changed daily, stock coming in and going out. All by hand.

The biggest problem was that payments and sales never matched. A customer would pay, but there was no way to tell which old sales that money had cleared or how much was still owed. Advance payments had no record at all. Working out who owed what at the end of the month took hours.

The shop's internet is unreliable, so an online-only app would simply not work there.

What we built

A mobile-first khata and stock app, designed around the shop's real workflow: an Excel-like flat ledger with a running balance, and the per-bag rate typed manually on every entry, because it changes every day.

At the core is a FIFO settlement engine. A payment applies itself to the oldest unpaid sales first, each sale's status updates on its own, and any surplus becomes advance credit that the next sale consumes. A return or a deletion frees the money and reallocates it. All of the money logic lives in pure functions and is unit-tested. The arithmetic cannot silently go wrong.

The app is offline-first. One online login, then seven days of full use without internet, with the connection status and last-synced time always on screen. Receipts and statements render as PNG images in the shop's colours and go out over WhatsApp. Offline too.

It shipped as an installable PWA, then wrapped as a signed Android APK (v1.3.0) and handed over.

A look inside

Saram: Stock & Khata App: home
Saram: Stock & Khata App: dashboard
Saram: Stock & Khata App: ledger
Saram: Stock & Khata App: payment

Results

  • Manual accounting in the register and Excel is gone entirely. Every sale, payment, return and expense is recorded in one place, in one tap.
  • "Who owes what" is no longer an end-of-month job. The Dues report is always live, highest first, overdue highlighted.
  • Payment-to-sale matching and advance credit are handled by the system, not a person. The money logic is unit-tested, so the room for human error is gone.
  • Expenses are tracked by category with all-time and monthly totals. This was not tracked at all before.
  • Profit and loss on one screen: sales value, collected, expenses, net cash, outstanding dues.

Everything it does

  • FIFO payment settlement: a payment applies itself to the oldest unpaid sales first, and each sale's status updates on its own
  • Advance credit: any surplus paid is held as credit, and the next sale consumes it before anything else
  • Excel-like customer ledger with a running balance on every row
  • Manual per-bag pricing: the rate changes daily, so it is typed on every entry
  • Returns and corrections: a return or deletion frees the money and reallocates it across the remaining sales
  • Dues tracking: each customer's outstanding balance, due date and overdue highlight
  • WhatsApp receipt and statement: shop-branded PNG image or text link, with the amount in words
  • Offline-first: Firestore local cache keeps the app working with no connection
  • Seven-day offline session: one online login, then seven idle days without internet
  • Live connection status: online/offline pill, syncing banner and last-synced time

Built with

Next.js 16, React 19, TypeScript, Tailwind CSS v4, Firebase Authentication, Cloud Firestore, Framer Motion, Vitest, PWA (service worker), Bubblewrap / TWA Android APK, Vercel.

Start a project like this

Related service

App Development

We build modern mobile apps for iOS and Android that help businesses serve customers better, manage features smoothly, improve daily operations, and grow faster with a clean user experience and tools.

Explore service

Ready to Build Smarter Systems?

ChintoLab creates modern digital systems that help businesses work smarter, manage better, and grow faster.

Share this article

X LinkedIn

ChintoLab Team

ChintoLab