Rahul SarkarFull Stack AI Engineer + Pharmacist

SARK ERP

Founder & Developer2025Live
GoReactSQLite
SARK ERP cover image

Overview

SARK ERP is a desktop pharmacy management system built around the domain rules that actually make Indian pharmacy retail different from generic point-of-sale software: dual-unit pricing (a strip sold whole vs. split into loose tablets), FEFO batch-expiry allocation, Schedule H/H1/X dispensing registers, and line-item GST. It ships as a single node-locked binary with no server to host and no account system, sold directly to pharmacies.

Problem

A pharmacy sells both packs and loose units of the same product, must dispense stock in expiry order (FEFO, not FIFO), and legally cannot complete certain sales without a name on file — none of which a generic invoicing app models correctly.

Context

Built and sold directly to independent Indian pharmacies as a commercial product; the counter machine running it may never have a reliable internet connection.

Approach

Modeled pack-level pricing (MRP/PTR, as printed on the strip) separately from base-unit landing cost (used for margin), enforced FEFO allocation across batches at sale time, and wrapped every sale — invoice, stock deduction, accounting entry, and compliance register — in one database transaction.

Architecture

A single Go binary embeds the entire React frontend and talks to a local SQLite database — no server to host, no account system, and no internet dependency for day-to-day operation. Licensing and activation work entirely offline, independent of any external service.

Technology decisions

  • Go binary + embedded frontend + SQLite, specifically to remove the internet dependency entirely rather than bolt on an offline fallback mode

Challenges

  • A pharmacist reported a strip priced well above what a single tablet was showing at checkout — a goods-receipt bug had let a per-tablet price get stored where a pack-level price belonged, and every downstream screen quietly re-derived from it, so the wrong number still looked plausible
  • Correcting already-posted production data safely, without a reliable way to tell a genuinely corrupted batch from one that had simply never been re-priced

Trade-offs

  • Chose a fully offline architecture over cloud sync, trading remote-access convenience for zero dependency on the pharmacy's internet connection

Decisions

  • Never delete or mutate a posted invoice — cancellation posts reversing entries instead, so GST invoice numbering stays sequential and auditable
  • Traced every consumer of the price column against a real purchase and a real checkout by hand rather than trusting the existing code comments

Outcomes

  • Shipped and sold as a real commercial product (₹4,999 lifetime license), currently at version 4.1.3
  • Tracked down which batches were actually affected by the pricing bug using a signal in the data itself rather than guesswork, then corrected each one through the same transactional, audited update path as any other price change

Lessons learned

  • A comment describing what a value should mean is not evidence of what it actually means at runtime — verifying live, by hand, against the running system is what actually found the bug

Related projects

Live2025

QUIK ERP

A production-grade ERP for veterinary pharmacies, livestock distributors, and companion animal clinics.

ReactTypeScriptNode.jsExpress