Healthcare TechnologyPharmacy & Healthcare Operations • Healthcare Technology

PharmaPluse

An AI-powered pharmacy operations and inventory platform.

PharmaPluse
Production Verified System Case Study
FlutterNode.jsExpressTypeScriptMongoDB
01 System Overview & Product Vision

Engineering a connected pharmacy operations platform that unifies inventory management, stock batch tracking, supplier logistics, mobile barcode billing, and AI intelligence.

An AI-powered pharmacy operations and inventory platform combining Flutter mobile applications, modular Node.js/Express backend services, Redis/BullMQ queues, and a Python FastAPI AI microservice.

Architecture Narrative:Flutter Mobile App -> Node.js / Express API -> Auth & Organization Layer -> Business Modules -> MongoDB + Redis / BullMQ -> Background Jobs -> Python AI Service.
02 The Engineering Challenge

Problem Context & Constraints

Disjointed inventory tracking across branches, manual batch verification, slow checkout workflows, and difficulty anticipating stockouts without real-time intelligence.

Architectural Solution

Engineered a decoupled platform architecture separating core transactional backend workflows from asynchronous background jobs and specialized AI services.

Technical Blueprint

PharmaPluse Architecture Diagram

Interactive system node topology and network boundary relationships.

Hover or tap nodes to highlight connected flows
Flow:Flutter Mobile App -> Node.js / Express API -> Auth & Organization Layer -> Business Modules -> MongoDB + Redis / BullMQ -> Background Jobs -> Python AI Service.

Flutter Mobile App

Barcode Scanning & Billing

Cross-platform mobile application with offline-first secure storage, barcode scanner, and location-aware capabilities.

Node.js / Express API

API Gateway & Routing

TypeScript REST API with Zod validation, JWT authentication, and Express rate limiting.

Auth & Org Layer

Multi-Tenant RBAC

Organization boundaries, user roles, permission checks, and security middleware.

Business Modules

Drugs, Stock, Sales & Suppliers

Core business domains including drugs catalog, batch inventory, purchase orders, transfers, and billing.

MongoDB (Mongoose)

Primary Data Store

Document persistence for multi-branch pharmacy records, sales history, and organizational schemas.

Redis & BullMQ

Asynchronous Job Queues

Background job processing for expiry alerts, demand calculations, and stock reports.

Python AI Service

FastAPI Microservice

Dedicated AI service providing OCR prescription extraction, demand forecasting, stock anomaly detection, and drug substitution recommendations.

04 Core Platform Capabilities

Engineered System Features

Platform Operations

Pharmacy Operations & Multi-Branch Management
Organization & Multi-Tenant Role Isolation
Drug Catalog & Batch Expiry Tracking
Real-Time Stock Inventory & Warehousing
Supplier Logistics & Purchase Orders
Sales Processing & Branch Transfers
Automated Stock Alerts & Inventory Reports
Consumer Workflow Portal & Branch Locator

AI Intelligence Layer

OCR Document Extraction for Prescriptions & Invoices
Predictive Demand Forecasting by Location & Season
Inventory Stock Anomaly & Expiry Detection
Intelligent Drug Substitution Assistance

Mobile & Edge Workflows

Flutter Cross-Platform Application
High-Speed Mobile Barcode Scanning
Voice-Enabled Billing Workflows
Secure Local Storage & Encryption
Location-Aware Branch Navigation
05 Architectural Trade-offs & Engineering Rationale

Why Was It Designed This Way?

Problem Statement

Heavy AI processing (OCR & demand forecasting) was blocking point-of-sale checkout APIs.

Architectural Decision

Separated AI workloads into a dedicated Python FastAPI service invoked asynchronously.

Rationale

Prevents CPU-intensive model inference from degrading real-time mobile billing and inventory APIs.

Verified Result

Core business REST APIs maintain sub-100ms response times regardless of AI workload spikes.

Problem Statement

High-frequency inventory updates and expiry alert recalculations caused database write lock contention.

Architectural Decision

Offloaded batch updates and notification triggers to Redis and BullMQ queues.

Rationale

Asynchronous task processing decouples real-time sales transactions from background batch calculations.

Verified Result

Zero billing lag during peak pharmacy operating hours.

06 Security Architecture & Boundaries

REST API Authentication & Rate Limiting Guard

JWT Stateless Token Authentication & Bcrypt Password Hashing
Zod Schema Request Payload Validation & Sanitization
Express Rate Limiting & Helmet Security Headers
Organization-Level Multi-Tenant Data Scoping
07 Observability by Design

Telemetry, Tracing & Operational Health

Structured logging and background queue monitoring across Node.js API and Python AI service.

Winston Structured JSON Logging
BullMQ Dashboard & Queue Latency Metrics
FastAPI Request Execution Timings
MongoDB Query Profiling
CI/CD & Deployment

PharmaPluse Deployment Pipeline

Containerized deployment architecture and health probe verification steps.

Containerized CI/CD deployment using Docker and GitHub Actions with a self-hosted deployment runner.

01

Developer Push

Developer pushes code to branch triggering GitHub Actions runner.

Verified Step
02

Container Build

GitHub Actions self-hosted runner executes docker build with versioned image tags (e.g. dev-BUILD_NUMBER or prod-BUILD_NUMBER).

Verified Step
03

Verification & Deployment

Docker network and environment verification followed by container launch with readiness health checks.

Verified Step
04

Cleanup & Notification

Automated old container and image pruning upon verified healthy endpoint status.

Verified Step
Stack Cluster

PharmaPluse Technology Cluster

Curated tech cluster of production-verified libraries, languages, databases, and deployment platforms.

Mobile

FlutterDartBarcode ScannerVoice Billing

Backend API

Node.jsExpressTypeScriptZodJWTBcryptWinston

Data & Queues

MongoDBMongooseRedisBullMQ

AI Service

PythonFastAPIOpenAIGoogle Generative AIGroq SDK

Deployment

DockerGitHub ActionsSelf-Hosted RunnerAWS S3 SDK
10 Qualitative Outcomes & System Delivery

Engineered Results

Modular platform architecture separating transactional REST services from AI workloads
Centralized multi-branch inventory tracking with batch expiry prevention
Asynchronous background job processing for stock alerts and forecasting
Containerized deployment pipeline with automated health verification
System Architecture Consultation

Have a system like this in mind?

Tell us what you're building. We'll help turn the architecture into a scalable, production-ready product.

START A PROJECT