Skip to content
All work

Beheth Kade: an offline-first pharmacy counter

An offline-first app for small Sri Lankan pharmacies: invoice-photo receiving, price-guarded billing and batch stock. Phase 1 is built and in testing.

Status
Status: In development
Role
Founder, product, design and engineering
When
September 2026 to present
Credit
Raava's own product
Stack
  • React
  • Vite
  • TypeScript
  • Tailwind CSS
  • shadcn/ui
  • Supabase
  • PowerSync
  • Claude
  • Vitest
  • Playwright

Beheth Kade is Raava's own product: a mobile-first, offline-first web app for single-outlet pharmacies in Sri Lanka. It covers receiving stock from a photo of the supplier's invoice, fast billing with a maximum-price guard, batch and expiry tracking, and staff roles with an audit trail, on the phone or counter PC the pharmacy already has.

My role: founder and sole developer. I own the product, the design and the build.

Where it stands

Phase 1 is built. User acceptance testing has not run yet, and the small pilot has not started, so there are no users, no revenue and no outcomes to report.

The problem

Small pharmacies that run on a paper book tend to drop software because keying in every delivery and every sale costs more time than it saves. Stock counts drift within weeks. Owners can't see what is about to expire, and can't reliably stop a sale above the gazetted maximum retail price, which is an offence. Power cuts and patchy internet make cloud-only tools stall at the counter.

So the core idea is narrow: stock should stay accurate with almost no effort. Invoices come in from a photo, billing keeps the counts true, and the counter should never stop for a lost connection.

Illustration of a small neighbourhood pharmacy: a pharmacist at the counter, a three-wheeler passing and two people walking by.
Built for the small neighbourhood pharmacy. Illustration.

Built to keep billing offline

Every Phase 1 flow is designed to work with no connection for 72 hours. The device keeps its own database and queues writes until it can reach the server.

Offline sync

The counter keeps billing while the connection is down.Select a step to see what it does.

Connections: Counter device to Local SQLite; Local SQLite to Upload queue; Upload queue to Supabase Postgres; Supabase Postgres to Second device (syncs down); Supabase Postgres to Owner review (negative stock).

Stock is never a single number that gets overwritten. Each sale, delivery and adjustment is an append-only movement against a batch, and the count is worked out from those movements. That makes concurrent offline billing safe to merge, and it gives the owner a full history of every change: who, on which device, and when.

Illustration of a customer paying by QR code at a pharmacy counter while the pharmacist hands over a bag.
Billing at the counter. Illustration.

From an invoice photo to stock

Receiving

  1. 1Photograph the invoiceStaff take a photo of the supplier's invoice. The app creates an extraction job and moves on.
  2. 2Queued extractionA database trigger hands the job to a server function that uses Claude to read the supplier, invoice details and line items. A sweep every minute picks up any job that stalls.
  3. 3Traffic-light reviewEach line comes back marked by confidence. Amber lines need a tap to confirm, red lines need an edit.
  4. 4Stock movementsConfirmed lines become stock movements per batch, with expiry dates captured.

The extraction never sits on the billing path. A slow or failed AI job can delay a delivery being entered; it can't stop a sale.

Design sketch, placeholder data
Extracted lines appear in the order they are on the paper. Uncertain rows show the crop from the photo. Products and prices are placeholders.

Guards at the counter

  • Maximum price. An item with a gazetted maximum price cannot be sold above it. The app blocks the sale and shows the ceiling. Only the owner can override, with a reason that is logged.
  • Prescription items. Selling one asks whether the prescription was seen. Overriding a "no" needs the responsible pharmacist's PIN, or the pharmacy can choose to block it outright.
  • Every action is attributed. Staff switch users on a shared device with a PIN, and the audit log records the user, the device and the time.

Scroll sideways for every column.

ActionOwnerPharmacistCounter staff
Sell and confirm received stockYesYesYes
Override a prescription "not seen"Only with the pharmacist roleYes, with PINNo
Override the price ceiling, with a reasonYesNoNo
Edit prices, manage staff and devicesYesNoNo
View the audit logYesNoNo
Design sketch, placeholder data
The owner's day opens on stock confidence, not sales. Numbers are illustrative.

The interface ships in English and Sinhala in Phase 1. Tamil appears in the language picker as "coming soon", and every text key was built for all three languages from the start. Product search also accepts Sinhala script and common phonetic spellings.

Where it is on the roadmap

Four phases

  1. 1Counter: built, in testingStarted 15 September 2026; all 35 Phase 1 plans built by 28 September. User acceptance testing and the pilot have not started.
  2. 2Orders: not startedClick-and-collect for each pharmacy's customers, pickup only, plus Tamil.
  3. 3Migrate and retain: not startedImport from existing systems and repeat-prescription reminders.
  4. 4Grow: not startedA simple page and local-search tools for each pharmacy.
Phase 1 plans built
35 of 35
On a phase branch, not yet merged to main
Source: Project plan state, 28 September 2026
must-haves verified
39 of 40
Human checks still pending
Source: Phase 1 verification, 27 September 2026
offline design target
72 h
A requirement; not yet tested in a pharmacy
Source: Product requirements
Open before the pilot

An open fix on the invoice-review tests, real-device checks on an older Android phone, a native Sinhala review of the copy, and receipt printing on a real printer.

What I'd do next

  • Close the open receiving-test fix, run user acceptance testing and merge Phase 1.
  • Time the photo-to-stock and three-item-sale targets on real invoices and real phones before the pilot.
  • Put it in front of a small group of pharmacies and let their use decide what Phase 2 becomes.
  • Status: Design stage

    A design-stage restaurant system for Sri Lankan venues: mobile ordering, a kitchen display and an admin dashboard, built to keep running through outages.

    Evidence: Screen designs for three surfaces and a local-first sync design

    Stack: Flutter · React · Next.js · Supabase

  • Status: ProductionVia Silvatron Pty Ltd

    For an Australian state government client

    Document pipeline

    A 12-node LangGraph pipeline extracts compliance documents row by row and links each value to its source page.

    Evidence: 90% F1 on one named benchmark; larger document sets varied

    Stack: LangGraph · Python · Pydantic · FastAPI