PharmaDesk - Smart Pharmacy Management SaaS
PharmaDesk (available at pharmadesk.in) is a premium, enterprise-grade B2B Software-as-a-Service (SaaS) platform built specifically to automate and streamline pharmacy operations, inventory tracking, and retail billing workflows.
Core Platform Modules
PharmaDesk is divided into specialized modules designed for maximum reliability and ease of use in retail pharmacy setups. Below is an in-depth breakdown of these systems:
Invoicing & Fast Billing Console
Pharmacy billing counters require split-second transactions to keep lines moving. PharmaDesk utilizes a custom keyboard-first interface allowing cashiers to perform all billing tasks without touching a mouse.
- Instant Search: Custom autocomplete modules lookup inventory items by compound name, brand name, or salt schedule in under 150ms.
- Financial Math: Automatically computes state/local sales taxes (GST/VAT splits), coupon discounts, partial credit structures, and prints cleanly formatted receipts (supporting thermal 3-inch layouts and standard A4 sizes).
- Real-time Sync: Decrements stock quantities down to the exact batch ID level upon invoice checkout, avoiding double-sells across multiple cashier lanes.
Inventory & Batch Tracking
Unlike standard retail products, pharmaceutical inventory must track identical SKU items separately under unique manufacturer batch numbers, purchase prices, shelf configurations, and expiration profiles.
- Composite Mapping: Associates stock items with combined database keys (`SKU` + `Batch ID`) to track dynamic purchase costs, wholesale markups, and distributor origins.
- Unit Multipliers: Handles packaging conversions (e.g. bulk box to inner strip to individual tablets), enabling fractional stock updates (e.g. selling 3 tablets from a strip of 10).
Expiry Blocker & Compliance Safeguards
Selling expired medicines poses severe patient safety risks and legal liabilities. PharmaDesk implements active compliance safeguards directly inside the checkout path.
- Visual Compliance Matrix: Automatically monitors and tags batches by shelf-life status (Safe, Expiring Soon, Expired) and displays alerts at the cashier terminal.
- Active UI Blockade: If a cashier scans a barcode belonging to an expired batch, the billing panel triggers a hard validation block, rendering it impossible to add the product to the active checkout cart.
AI PDF Invoice Scanner & OCR Parser
Manually entering hundreds of distinct drug compounds, costs, batch IDs, and expiries from distributor invoices takes hours of repetitive manual data-entry.
- Automatic Extraction: Allows users to drag-and-drop distributor PDFs. An AI-powered parsing model processes the document layout, extracts compound listings, and isolates active batch IDs, quantities, expiries, and costs.
- Verification Screen: Provides a side-by-side reconciliation screen. Upon verification, the records are securely written to the Supabase database.
BI Dashboards & Reports
Provides management with granular insights into store efficiency, financial logs, and inventory turnover schedules.
- Financial Metrics: Dynamically calculates daily sales volume, average transaction size, cost of goods sold (COGS), net profit margins, and inventory valuation.
- Tax & Compliance: Auto-aggregates and generates tax reports (GST/VAT summaries) for easy financial filing.
Predictive Stock Restocking
Maintains optimal supply chains by calculating item depletion triggers dynamically using historic records.
- Demand Forecaster: Analyzes historical sales velocity, distributor delivery timelines, and seasonal regional health trends to suggest purchase order lists, reducing write-off waste from dead stock by up to 30%.
System Architecture & Development
PharmaDesk is engineered for speed, safety, and operational continuity. Here is how the technical stack is structured and how data flows through the application:
Built using Next.js Server Components to optimize page delivery speed and SEO. Dense datasets of pharmacy products and logs are managed using TanStack Tables, enabling instant client-side global searches, paginations, and sorting over thousands of batch items. Keyboard shortcuts and focus traps are implemented via Radix UI primitives to ensure cashiers can operate the system without touching the mouse.
Core transactions are managed inside a relational PostgreSQL database hosted on Supabase. Custom SQL triggers and constraints are implemented at the database level to ensure that batch numbers are valid and expired batches can never be checked out. Authentication relies on Supabase Auth with tenant-isolation schemas, making sure pharmacies cannot read or write to other pharmacies' records.
Merchant subscriptions and invoice payments are integrated using Razorpay Checkout. Critical status updates—such as daily low stock summaries or automated warning alerts for batches expiring in under 60 days—are delivered through HTML transactional mail using the Resend API.
To support rapid scaling and concurrent cashier transactions across thousands of pharmacy franchises, the backend is scheduled to transition from Next.js serverless handlers into microservices written in Go (Golang) and NestJS, utilizing a Redis cache layer for sub-millisecond billing processing.