Back to all projects
HealthTech · Pharmacy Retail SaaS20266 Weeks Build
DawaPOS
Offline-first pharmacy POS with Khata credit ledger and WhatsApp invoicing for Pakistan.
Client EntityIndependent Product (Pakistan Pharmacy Market)
My RoleFounder, Product Designer & Full-Stack Engineer
Delivery Time6 Weeks Build
Tech StackNext.js 15, React 19 + 7 more

01 // The Problem
Friction, Inefficiency & System Barriers
Pharmacy counters lose sales and stock accuracy when the internet drops; expiry losses go untracked; informal Khata credit lives in paper notebooks; and invoices rarely reach customers digitally.
02 // My Approach & Decisions
Architectural & UX Decisions
Built an offline-first architecture with a local outbox/sync engine, a multi-tenant Supabase backend with row-level security, PKR whole-rupee arithmetic, per-customer double-entry Khata ledgers, and a WhatsApp delivery engine that sends bilingual PDF invoices as document attachments.
03 // Technical Depth
Code Moment: Engineered Core
Offline Outbox Sync Engine
typescript
| 1 | export async function enqueueSale(sale: NewSale): Promise<OutboxEntry> { |
| 2 | const entry = await outbox.put({ ...sale, status: 'pending', attempts: 0 }); |
| 3 | void drainOutbox(); // best-effort: replays FIFO when online |
| 4 | return entry; |
| 5 | } |
| 6 | |
| 7 | async function drainOutbox(): Promise<void> { |
| 8 | if (!navigator.onLine) return; |
| 9 | for (const entry of await outbox.pending()) { |
| 10 | await supabase.from('invoices').insert(entry.payload); |
| 11 | await outbox.markSynced(entry.id); |
| 12 | } |
| 13 | } |
Every sale made offline is queued in a local outbox and replayed to Supabase in order when connectivity returns, so the counter keeps running through internet outages.
04 // Measurable Results
Verified Production Benchmarks
7 SuitesApp Modules
Full POSOffline Mode
EN + اردوInvoice Languages
PKR 0Infra Cost
Key Capabilities Delivered
- Offline-first POS with local outbox queue and automatic sync when back online
- Khata credit ledger with per-customer double-entry accounting and credit-limit warnings
- Bilingual (English/Urdu) PDF invoices with pharmacy profile and drug-license details
- WhatsApp invoice delivery with queued → sent → delivered → read tick tracking
Full Technology Ecosystem
Next.js 15React 19TypeScriptSupabasePostgreSQLDrizzle ORMTauri v2Tailwind CSS v4WhatsApp Cloud API