Executive Overview
Biomedical researchers, clinicians, and health informatics teams process hundreds of thousands of peer-reviewed articles indexed across the National Center for Biotechnology Information (NCBI) PubMed database. Rapidly synthesizing opposing clinical outcomes, discerning consensus across clinical trials, and building complex Boolean queries on mobile devices is traditionally hampered by fragile network reliance and unwieldy desktop-only interfaces.
RedPledge was commissioned to re-architect PubMed ResearchMiner—transforming a complex monolithic client prototype into a production-grade, offline-first mobile application (Capacitor ready) capable of running intensive graph analyses and clinical contradiction detection directly on-device with strict $0/month recurring backend hosting costs.
Project Metric Highlights
- 0.9s First Contentful Paint (Mobile Lighthouse)
- 100% Automated Headless Test Pass Rate across 11 E2E and Unit Suites
- $0/mo Ongoing Infrastructure & Cloud Costs
- 10x Query Rate Acceleration via Paced NCBI E-Utilities Ingestion Pipeline
The Client Challenge
The client had built an innovative single-file 200KB application prototype (pubmed_miner.html) that implemented custom heuristics for searching NCBI PubMed records, rendering co-occurrence network graphs, and analyzing research keywords. However, the initial prototype faced critical architectural bottlenecks preventing wide adoption:
- Fragile Runtime Dependencies: The app depended on 6 external CDN scripts injected at runtime. Any CDN outage, network hiccup, or breaking upstream CDN push broke client execution.
- Zero Offline Capability: Field medical workers, conference attendees, and researchers in transit lost access to cached query results whenever internet connectivity dropped.
- No Automated Testing: With zero unit or integration tests, incremental algorithmic modifications routinely introduced silent regressions in Boolean query string compilation and node calculation.
- Desktop Monolith Constraints: Touch targets were smaller than 24px, views overflowed on phones, and memory usage spiked when parsing large XML/JSON responses from NCBI E-Utilities.
- Strict Financial Constraint: The platform required a zero-dollar recurring cloud infrastructure budget—ruling out paid backend serverless functions, hosted databases, or proprietary API proxy subscriptions.
The Engineering Solution
RedPledge engineered an architectural overhaul that decoupled the monolith into a modular, test-driven, offline-first progressive web and mobile platform:
1. Modular ES Architecture via Vite
We systematically decomposed the monolithic script into 12 cleanly isolated ES modules:
config.js: Centralized constants, rate limits, and NCBI endpoint bindings.db.js: Dexie-powered transactional persistence layer.ncbi.js: Paced rate-limited API client handling NCBI E-Search, E-Summary, and E-Fetch with retry backoff.parsers.js: High-throughput PubMed XML and JSON metadata extraction.charts.js: Real-time scientific visualization engine.graph.js: Force-directed Cytoscape graph modeling and community clustering.builder.js: Visual Boolean query generation state machine.divergence.js: Scientific contradiction and clinical divergence analysis engine.primers.js: Pre-built biomedical research templates and domain presets.ui.js: Touch-friendly mobile interface controller with accessible modal management.main.js: Core application lifecycle coordinator and event dispatcher.
2. Zero-CDN Dependency Vendoring
We eliminated all runtime CDN dependencies. Production-grade versions of Chart.js 4.4.1, Cytoscape 3.28.1, Dexie 3.2.7, Graphology, and self-hosted Phosphor icons were vendored and bundled locally via Vite. The entire bundle ships as static self-contained assets, eliminating third-party tracking, security vulnerabilities, and network failure points.
3. Zero-Cost Transactional Data Persistence
Rather than deploying an expensive hosted database, we architected a local client-side transactional storage engine using IndexedDB v3 abstracted by Dexie.js. The storage schema caches:
- Multi-tier query histories with timestamps and hit counts.
- Full bibliographic metadata, abstracts, and author affiliations for tens of thousands of articles.
- Computed graph co-occurrence matrices and divergence contradiction pairs.
Researchers can load searches while online, close their devices, and inspect full bibliographies, interactive graphs, and statistical models completely offline.
4. Headless Automated Quality Assurance
We created an automated test runner combining Node.js and headless Playwright, executing 11 sequential test suites:
- Unit tests verifying exact Boolean syntax generation (AND, OR, NOT operator precedence, nesting, and MeSH tag appending).
- Heuristic regression suites validating contradiction classification thresholds.
- Mocked and live integration tests validating NCBI E-Utilities rate limits and error responses.
- Mobile viewport audit verifying touch targets comply with WCAG 2.1 AA (>= 44px minimum touch boundaries).
5. Automated CI/CD & Static Distribution
We configured GitHub Actions workflows to execute the 11 test suites on every pull request and push to main. Upon test completion, Vite compiles production-optimized bundles and automatically deploys them to GitHub Pages, providing zero-latency global CDN edge delivery at zero recurring hosting expense.
Differentiating Technical Features
Visual Drag-and-Drop & Tap Boolean Query Builder
Designing PubMed queries with complex MeSH qualifiers typically requires memorizing specialized NCBI syntax. We engineered an interactive query state machine allowing users on both mobile and desktop to:
- Dynamically add and reorder search terms via draggable and tappable chips.
- Toggle nested Boolean operator modals (
AND,OR,NOT). - Apply grouping parentheses
( )with real-time visual bracket matching. - Live-compile the visual expression into standard NCBI PubMed syntax with one-click copy and execution.
Biomedical Contradiction Mapping (Divergence Engine)
To help clinical researchers navigate conflicting scientific outcomes (e.g., drug efficacy trials with contrasting conclusions), we engineered a proprietary Divergence Engine:
- Scans ingested scientific abstracts sharing $\ge N$ topical MeSH terms.
- Employs linguistic heuristics to detect opposing clinical conclusions (e.g., Direct Opposition, Supports vs. Refutes, Inconclusive).
- Launches a dual-column side-by-side comparison modal juxtaposing conflicting study methodologies and outcome sentences.
- Illuminates contradiction paths directly across the Cytoscape knowledge graph with high-contrast warning edges.
Dynamic Co-occurrence Knowledge Graph
- Interactive force-directed network rendered via Cytoscape.js.
- Implements Louvain community detection to automatically group highly interconnected MeSH keywords, genes, disease pathways, and chemical compounds into color-coded clusters.
- Supports pinch-to-zoom, node filtering by publication frequency, and interactive path tracing between disparate biological entities.
8-Metric Biomedical Statistical Analysis
The application computes real-time analytical distributions over search cohorts:
- Publication Velocity: Multi-year citation volume trendlines.
- Evidence-Level Hierarchy: Classification into Systematic Reviews, Randomized Controlled Trials (RCTs), Meta-Analyses, and Observational Studies.
- Journal Impact Breakdown: Distribution of top-publishing medical journals.
- MeSH Keyword Co-occurrence Heatmaps: Dominant biological themes and emerging therapeutic targets.
Results & Production Impact
- 0.9s Mobile First Contentful Paint: Achieved through tree-shaken static bundles, zero remote CDN blockers, and pre-warmed IndexedDB stores.
- $0 Recurring Monthly Infrastructure Cost: 100% serverless, client-side execution running on GitHub Pages and packaged for mobile distribution via Capacitor.
- 100% Test Pass Rate: 11 continuous Playwright and Node unit/integration test suites ensuring zero regressions across all future enhancements.
- Capacitor Mobile Ready: Certified for smooth iOS and Android deployment with native haptics, safe-area padding, and touch-optimized navigation drawers.