Pharmacy Management System (PMS) – Complete Offline-First POS & Inventory Solution
Desktop AppFeatured

Pharmacy Management System (PMS) – Complete Offline-First POS & Inventory Solution

A fully self-hosted, offline-first Pharmacy Management System built entirely on Python's standard library and Vanilla JavaScript. It streamlines billing, batch-level inventory (FEFO), multi-branch stock transfers, supplier payables, and comprehensive financial reporting without requiring an internet connection or external dependencies.

Client: DigiNexus Lab
Completed: October 2026

About This Project

Overview
The Nexus Pharmacy Management System is a robust, end-to-end software solution designed specifically for pharmacies operating in environments with unreliable internet connectivity or strict data sovereignty requirements. Built as a zero-dependency application, it runs entirely on a local PC (Windows, Mac, or Linux) and serves multiple counters over a local network.

Core Functionalities

  • Point of Sale (POS) & Billing: A high-performance checkout interface supporting split payments (Cash/Card/Credit), item-level and bill-level discounts, loyalty points, and prescription capture. It generates detailed printable receipts with barcode and FBR-compliant QR codes.

  • Advanced Inventory Management: Tracks stock at the batch level with First Expired, First Out (FEFO) deduction logic. It features low-stock alerts, expiry tracking (90-day warning), stock adjustments with reason codes, and vendor pricing comparisons.

  • Medicine Pack Staging: To solve the problem of "phantom inventory," a staging area contains 6,100+ pre-loaded medicines. Users can select, edit, and route items directly to a Purchase Order or Record Purchase, ensuring no stock enters the system without a commercial event backing it.

  • Purchasing & Supplier Ledgers: Full lifecycle management for Purchase Orders (Ordered → Partially Received → Received). Supplier payments are allocated against specific invoices, providing accurate payables tracking and vendor price stability reports.

  • Multi-Branch & Transfers: Supports federated branch architectures. Stock transfers are generated as secure files that can be imported at another branch, preventing duplicate stock entries.

  • Comprehensive Reporting: 11+ built-in reports including Profit & Loss, Sales by Item (with true batch cost margins), Stock Valuation, Tax, Expiry, and Cash Drawer shift reconciliation. All reports are printable and exportable to Excel.

  • Role-Based Access Control: Granular permissions for Cashiers, Managers, and Admins. Sensitive data like cost prices and profit margins are redacted server-side for unauthorized roles.

Technical Achievements & Architecture
This project is a masterclass in "constraint-driven development."

  • Zero Dependencies: The entire backend is built using only the Python Standard Library (no Flask, no SQLAlchemy, no npm). The frontend is pure Vanilla JS/CSS. This ensures the software never breaks due to expired third-party APIs, missing packages, or network issues.

  • Bulletproof Data Integrity: The system uses SQLite in WAL mode. A strict BEGIN IMMEDIATE transaction protocol and a "no nested commits" rule prevent race conditions during high-volume concurrent checkouts. A regression test suite of 291 automated tests (including multi-threaded load tests) verifies that a 16-counter environment can handle 537 sales/sec with zero data loss.

  • Offline Licensing: Implements machine-bound RSA key cryptography to enforce paid tenures entirely offline, requiring no phone-home server.

  • FBR Digital Invoicing: Built-in queue and retry logic for Pakistan's FBR tax API, complete with a dependency-free QR encoder and Sandbox/Production switching.

  • Seamless Deployment: Ships as a standalone Windows .exe via PyInstaller and Inno Setup, automatically handling data persistence in the user's %APPDATA% directory to survive uninstalls and upgrades.

The DigiNexus Lab Difference
Every feature in this system was stress-tested against real-world pharmacy edge cases. From preventing double-refunds on loyalty points during sale voids, to fixing FEFO batch splits across different purchase prices, the software prioritizes financial accuracy and auditability. The UI is clean, responsive, and designed for rapid keyboard-only entry at the counter.

Project Gallery

Technologies Used

Python 3.9+SQLiteHTML5CSS3 (Custom, responsive design)Vanilla JavaScript (ES6+)ThreadingHTTPServer with a custom regex routerPBKDF2 password hashingBearer token authentication

Quick Links

Interested in a similar project?

Let's discuss how we can help bring your vision to life.