Phlo
SaaS · pharmacy · built by Aziz Khan
The problem
Indian pharmacies key in every purchase bill by hand and juggle GST, expiry and stock in separate tools.
What I built
AI pharmacy billing and management: photograph a purchase bill and the AI enters the stock, plus GST-ready inventory, e-way bills, expiry tracking and accounting on a multi-tenant API.
Engineering decisions
- Every record belongs to an organization and one of its stores. The session carries both ids and every query filters on them.
- Stock is tracked per batch, with per-store pricing and units of measure, so expiry and GST reports come from the same rows as billing.
- Accounting lives in the same schema as purchases, sales and returns: account groups, ledger entries, customer ledgers and payments.
- Scanned purchase bills are saved as test fixtures, so the invoice reader is tested offline without calling a model.
Stack
- Next.js
- Hono
- Bun
- Drizzle
- PostgreSQL
- AI
Written up in detail
- Why AI Agents Fail in Production and How to Fix Them
Eight ways AI agents break once real users and real data arrive, how to recognize each one, and the fix that holds.
Need something like this? See AI Product Rescue & Development and AI Integration Engineering.
More case studies
Have an AI product to ship?
Tell me what needs to be built, fixed, integrated or deployed. You work with me directly, the engineer who reads the code and ships it.