All work

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.

TypeScriptReactViteFastifyPostgreSQLPlaywrightpnpm

Role

Sole Engineer — Personal Project

Timeline

2 months

Type

project

01

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.

02

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.

03

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.

04

Key Decisions & Challenges

01

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.

02

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.

03

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.

04

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.

05

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