[ RETURN TO PRODUCTION INDEX ]
[ CASE STUDY // 01 • 2026 ]

DoctorDocs.in

// Privacy-First WebAssembly Document Suite

DoctorDocs addresses a major privacy flaw in document manipulation: uploading sensitive personal tax, health, and legal files to third-party servers. All transformations (PDF merging, page rotation, image conversion, OpenCV edge detection) compile to WebAssembly and run inside browser Web Worker threads. Text extraction employs an intelligent multi-engine cascade (PDF.js text layer → fast cloud inference fallback → client-side WebAssembly Tesseract.js). Deployed live on Vercel with $0 infrastructure running costs.

Compute Architecture

100% Client-Side

Browser Utilities

200+ Tools

Inference Cost

$0 Server Cost

// INTERACTIVE 4-TIER OCR CASCADE SIMULATOR
LIVE PIPELINE // DOCTORDOCS.IN 4-TIER OCR CASCADE
Browser DOMBYPASSED

01 / PDF.js Native Text

WebWorker SIMD● ACTIVE

02 / Tesseract WASM

Edge FallbackBYPASSED

03 / Gemini Vision 1.5

Zod Strict Schema● ACTIVE

04 / Tally XML Export

EXECUTION PATHTier 2: Canvas Grayscale/Contrast Pre-pass → Tesseract.js WASM Worker → GSTIN Checksum Verifier
END-TO-END LATENCY340 ms
COMPUTE COST & ACCURACY₹0.00 (Browser WebAssembly) • 96.4%

[ ARCHITECTURAL INSPECTOR ]

System Design & Code

Architectural Overview & Pipeline

DoctorDocs.in executes client-side WebAssembly compute across 200+ document utilities, keeping zero user files on remote disk. Its ingestion pipeline runs an intelligent 4-tier OCR cascade: Native PDF.js character extraction (Tier 1) cascades to WebWorker Tesseract.js SIMD with OpenCV contrast/deskew pre-processing (Tier 2), falling back to Gemini Vision on low-confidence thresholds (Tier 3). Structured financial documents are validated with custom GSTIN Modulo-36 checksum logic and serialized to Tally-compliant XML envelopes in browser memory.

Primary Stack:

Next.jsTypeScriptWebAssemblyTesseract.jsOpenCV

Engineering Challenges & Solutions

CHALLENGE 01: WASM WebWorker Memory Leaks on High-Resolution PDF Batches

Constructed a Worker lifecycle pool that recycles memory heaps after 10 consecutive page renders and forcibly unlinks OffscreenCanvas backing stores to prevent mobile browser tab crashes.

CHALLENGE 02: Skewed & Low-Contrast Thermal Receipts

Engineered an OpenCV.js adaptive Gaussian thresholding pre-pass that calculates line angle variance and deskews the bitmap prior to feeding character blobs into the Tesseract neural engine.