Sehat Kahani
Pakistan's Leading Telemedicine & Digital Healthcare Platform
At a Glance Proof
Built resilient, high-volume telemedicine pipelines serving thousands of daily consultations across rural clinics, urban mobile users, and major corporate healthcare partners with sub-60-second physician match times.
Developed backend REST APIs in Koa.js and Express.js, clinical and admin portals in Angular, transactional medical schemas in MySQL, real-time consultation chat with SendBird SDK, and integrations for native mobile apps in Swift, Kotlin, and Java.
Angular clinical management portals · Koa.js & Express.js backend services · MySQL relational database · SendBird SDK for encrypted clinical chat · Native Java/Kotlin (Android) & Swift (iOS) mobile apps · WebRTC video
Project Overview
Millions of citizens in Pakistan lack immediate access to quality healthcare due to geographic remoteness, severe physician shortages in rural areas, and congested tertiary hospitals. Sehat Kahani required a reliable telemedicine platform capable of connecting patients with licensed physicians 24/7 in under 60 seconds, even over low-bandwidth cellular connections.
Target Users: Patients seeking consultations, licensed general physicians and specialists, rural nurse intermediaries, hospital administrators, and corporate HR managers.
- ▹Private health data (PHDS/HIPAA standards) had to stay protected at rest and in transit.
- ▹Video consultations must maintain stability even on fluctuating 2G/3G mobile networks in semi-urban and rural areas.
- ▹Third-party lab and pharmacy delivery API downtime must not block doctor consultations or delay medical care.
Platform Capabilities & Feature Architecture
Comprehensive architectural breakdown covering user-facing controls, background services, and automated workflows.
24/7 Instant Tele-Consultations & Doctor Matching
Rapid video, voice, and text consultations connecting patients in under 60 seconds
- ▹Rapid Physician Routing: Dynamic queuing matching incoming patient consultation requests with available licensed general physicians in under 60 seconds.
- ▹40+ Specialist Clinics: Scheduled consultations across cardiology, gynecology, pediatrics, dermatology, oncology, psychiatry, and internal medicine.
- ▹Multi-Modal Communication: Secure, low-bandwidth optimized WebRTC video streaming, crystal-clear audio calls, and encrypted in-consultation chat powered by SendBird SDK.
- ▹Native Mobile Apps: Dedicated high-performance apps built in Swift for iOS and Java/Kotlin for Android, optimized for low-latency video and audio consultations.
Encrypted Electronic Medical Records (EMR)
Centralized, compliant medical history vault for patients and practitioners
- ▹Comprehensive Patient Timeline: Consolidated repository of previous consultations, chronic condition notes, vitals histories, and surgical records.
- ▹Relational Clinical Storage: Structured, ACID-compliant patient histories, consultation sessions, and billing logs stored in MySQL with field-level encryption.
- ▹Diagnostic Report Attachments: Secure upload and high-speed viewing of high-resolution radiology scans, blood tests, and ultrasound PDFs.
- ▹Automated Compliance Audit Trails: Immutable logging of every record inspection, prescription generation, and modification for healthcare compliance.
E-Prescriptions & Asynchronous Fulfillment Rails
End-to-end digital prescription generation and home medicine delivery
- ▹Standardized Drug Database: Doctor prescription builder featuring verified pharmaceutical brand names, dosages, frequencies, and duration intervals.
- ▹Automated Pharmacy Dispatch: Webhook integration routing prescriptions directly to certified partner e-pharmacies for doorstep medicine delivery.
- ▹At-Home Lab Sample Collection: Digital diagnostic test orders that automatically schedule certified phlebotomists to collect patient samples at home.
- ▹Fulfillment Status Tracking: Real-time order tracking from prescription validation and pharmacy packing to courier delivery.
Rural E-Clinics & Nurse Intermediary Portals
Bridging the urban-rural healthcare divide through nurse-assisted telemedicine hubs
- ▹Nurse-Assisted Walk-In Flow: Dedicated tablet/desktop interface allowing trained community nurses to register walk-in patients in remote villages.
- ▹Vitals Recording Station: Rapid capture of blood pressure, blood glucose, temperature, and pulse prior to initiating doctor video connection.
- ▹Low-Bandwidth Video Optimization: Dynamic video stream scaling sustaining continuous clinical consultations even on erratic 2G/3G connections.
- ▹Physical Prescription Printout: In-clinic printing of digitally signed prescriptions for patients without smartphones or digital literacy.
Corporate Wellness & Mental Health Portals
Enterprise health benefits, outpatient coverage, and psychological counseling
- ▹B2B Enterprise Admin Dashboard: Real-time corporate health analytics, utilization metrics, and employee coverage verification.
- ▹Dedicated Mental Health Services: Confidential online counseling and therapy sessions with certified psychologists and psychiatrists.
- ▹Corporate OPD Wallet Deductions: Automated billing against corporate employee health allowances with zero out-of-pocket friction.
- ▹Preventative Health Checkups: Scheduled annual screenings, corporate health risk assessments, and wellness webinars.
Product Flow & System Context
One unified platform bridges patients, doctors, rural clinics, and fulfillment partners. Patient consultation requests from native mobile apps (Java, Kotlin, Swift) and web pass through Koa.js and Express.js API gateways into an atomic doctor claiming engine. Consultations execute via WebRTC video and SendBird chat channels, patient records store in MySQL, while prescription and lab fulfillment events queue into resilient asynchronous webhook workers.
Tech Stack and Runtime Architecture
Native Mobile Applications
Hardware-accelerated mobile apps for patients and doctors featuring low-latency camera/microphone integration and push notifications.
Clinical Management Web Portal
High-density clinical web dashboard for physician consultations, patient queue triage, and EMR review.
Clinical API & Consultation Gateway
Handles patient routing, doctor queue management, JWT authentication, and consultation lifecycles.
Encrypted Messaging Engine
HIPAA-ready encrypted messaging infrastructure powering clinical chats, doctor-patient file attachments, and consultation transcripts.
Relational Health Store (EMR)
Strict ACID-compliant relational storage for patient records, medical histories, prescription entries, diagnostic attachments, and immutable audit trails.
Fulfillment Webhook Bus
Enqueues asynchronous dispatch to partner e-pharmacies and diagnostic sample collectors with retry backoff.
Critical Execution Flow
Appointment Booking to Prescription & Lab Fulfillment
How a patient books a session, connects securely with a doctor, and receives automated medicine delivery.
Patient Booking & Atomic Claim Guard
Patient requests a consultation via mobile or web; Koa.js/Express gateway creates a pending consultation record with an atomic database lock in MySQL to prevent concurrent double-booking.
Doctor Notification & Claim Lock
Available licensed physicians receive push alerts; the first doctor to claim acquires the atomic lock and assigns their scoped physician credentials.
Encrypted Video & SendBird Chat Session
Short-lived, cryptographically scoped session tokens are generated for WebRTC video and SendBird chat, granting room access strictly for the scheduled consultation window.
Digital Prescription & Asynchronous Dispatch
Doctor enters digital prescription and diagnostic test orders; system commits records to MySQL and enqueues asynchronous webhooks to fulfillment partners with automatic retries.
Architectural Decisions & Trade-Offs
| Decision | Alternatives Considered | Why Chosen | Cost / Risk Accepted | Quality Attribute |
|---|---|---|---|---|
| Koa.js and Express.js dual-microservice backend architecture | Monolithic single-framework setup, Django or Ruby backends | Koa.js provides an ultra-lightweight, high-throughput asynchronous core for real-time consultation triage and doctor matching, while Express.js reliably orchestrates clinical administration, reporting, and webhook fulfillment. | Required maintaining consistent middleware patterns and error handling standards across both services. | Performance, Throughput & Maintainability |
| MySQL relational database for clinical records and EMR over NoSQL | Schemaless document stores without relational constraints | Patient diagnoses, pharmacy orders, doctor billing, and clinical audit records necessitate strict ACID guarantees, normalized table foreign keys, and zero transactional anomalies. | Required strict schema migration governance across releases. | ACID Consistency, Compliance & Data Integrity |
| SendBird SDK for HIPAA-compliant encrypted in-consultation chat | Building custom WebSocket chat server from scratch | Provided production-grade encrypted messaging, file attachment upload security, typing indicators, and offline message caching with established compliance out of the box. | Incurred third-party SDK subscription dependency and vendor API version maintenance. | Security, Compliance & Fast Time to Market |
What We Delivered & Future Roadmap
- ✓High-performance backend APIs powering thousands of remote clinical consultations daily.
- ✓Instant physician matching connecting patients to certified doctors in under 60 seconds.
- ✓Role-based clinical dashboards for doctors, hospital administrators, and diagnostic partners.
- ✓Rural E-Clinic portal supporting nurse intermediaries and offline-tolerant vitals logging.
- ✓Resilient asynchronous prescription and lab fulfillment integration pipeline.
- →Distributed tracing across pharmacy and courier partner networks.
- →Edge caching for static doctor profile and specialty directory data.
- →AI-assisted clinical note summarization for faster doctor handover.
Explore Other Flagship Case Studies
SentinelKids
Parent-Child Digital Safety & Device Management Platform
Delivered a resilient parent-child monitoring infrastructure processing high-frequency device telemetry with sub-200ms alert propagation, real-time web filtering, instant app blocking, and multi-device synchronization across zero-rollback releases.
Neem
Embedded Financial Infrastructure & Banking-as-a-Service Platform
Delivered mission-critical embedded banking, collections, and bulk disbursement modules for a licensed financial infrastructure platform, facilitating seamless money movement, automated reconciliation, and earned wage access.
Interested in how this project approach can help your product?
I can walk you through the stack choices, delivery process, and results.