project
Till.
An offline-first, GST-compliant point-of-sale and back-office platform for Indian multi-store retail, built to keep billing correct even when the internet isn't there.
Role
Sole Engineer — Personal Project
Timeline
2 months
Type
project
The Problem
Keeping GST billing correct for multi-store Indian retail even when a counter has no internet — and making sure that when offline terminals eventually sync, they never double-bill, lose a sale, or collide on invoice numbers.
What I Built
Built one pure, dependency-free (zod-only) TypeScript package that computes GST identically in the browser and on the server, verified by a 2,000-basket property-based test sweep. Paired it with an offline-first PWA counter using an IndexedDB outbox, a Fastify sync backend that reconciles terminals idempotently, and a custom chaos-testing harness that simulates two offline terminals racing, out-of-order delivery, duplicate retries, and full-session replay.
The Outcome
The chaos-testing harness asserts zero duplicate bills, zero lost bills, and zero invoice-number collisions — and it caught real correctness bugs before they could reach a shop: a one-paise tax-rounding drift, and a CGST/SGST split that could print unequal halves on a tax invoice. Negative stock is treated as a legitimate outcome rather than a bug: if two outlets oversell the last unit while offline, the sale stands, the ledger tells the truth, and the owner gets an exception card instead of a silent failure.
Key Decisions & Challenges
One pure, dependency-free (zod-only) TypeScript package computes GST identically in the browser and on the server, verified by a 2,000-basket property-based test sweep.
A custom chaos-testing harness simulates two offline terminals racing, out-of-order delivery, duplicate retries, and a full-session replay — asserting zero duplicate bills, zero lost bills, zero invoice-number collisions.
Found and fixed real correctness bugs before they'd ever reach a shop: a one-paise tax-rounding drift, and a CGST/SGST split that could print unequal halves on a tax invoice.
Negative stock isn't treated as a bug: an append-only ledger tells the truth and the owner gets an exception card instead of a silent failure.
Postgres row-level security with FORCE makes one tenant's data structurally unreachable from another connection, not just filtered by a WHERE clause.
Have a project in mind?
I'm open to freelance work and full-time roles. Let's talk about what we could build together.
Get in touch