Pharmulo
An ordering platform for pharma retailers, currently in pilot. A Windows agent reads stock from ProfitMaker and drafts bills through its Sales screen. Staff review and save the bills; the agent has no database write access.
- Role
- Solo engineer
- Year
- 2026
- Stack
- Next.js · Postgres · Tauri/Rust · ERP sync
Overview
- Problem
- Let retailers order from their phones while the wholesaler keeps ProfitMaker for stock and billing, without giving the integration database write access.
- What I built
- A retailer PWA, wholesaler admin tools, and a Windows agent that syncs 26 ERP entities and enters draft bills through the existing interface.
- Result
- The pilot has taken a phone order through to a saved ProfitMaker bill. Staff review the draft before saving, and the saved ERP bill confirms fulfillment.
Background
Each wholesaler gets a branded catalog where retailers can browse stock and order from a phone. ProfitMaker remains the record for stock and billing.
A Node worker syncs ERP data to the Next.js platform. A Rust and Tauri Windows agent enters orders through ProfitMaker’s Sales screen, checking window focus and dialogs as it goes. It stops when those checks fail. Staff review and save the draft; the agent never writes directly to the ERP database.
Since the first saved bill, I’ve added expiry checks, reconciliation across all 26 mirrored entities, background updates, and retailer onboarding. Sync skips unchanged records and limits deletion cleanup so a bad scan cannot clear the mirror.

Systems
Read-only ERP mirror26 entities
An auto-updating Windows agent reads 26 ProfitMaker entities through SELECT-only SQL, then syncs typed contracts into the tenant-scoped Postgres mirror.
Draft bill entry
The agent claims one order, checks for an existing bill, and drives ProfitMaker's Sales screen under focus and dialog guards; a human reviews the draft and ProfitMaker performs the save.
Fulfillment from saved bills
Orders become billed only when the saved bill syncs back. Quantities and mismatches derive from its lines, with a reaper surfacing stranded drafts instead of trusting an agent acknowledgement.
Expiry-aware batch billing
Retailers see only sellable batches, the agent skips expired or unknown-expiry stock during bill entry, and the admin stock view exposes source-data gaps for repair.
Nightly reconciliation
Nightly digests fold money and quantity values identically across SQL Server and Postgres, skip no-op writes, and bound any tombstone cleanup so a bad scan cannot erase a mirror.