Skip to main content
M. Aktaruzzaman Opu
Back to All Projects
WebAssembly Studio / SoftwareYear 2026Active Production

Exam Studio

Automated Bengali XeLaTeX examination studio in pure client-side WebAssembly.

DomainWebAssembly Studio / Software
Timeline2026
Technologies11 Stack Tools
StatusActive Production
Exam Studio

The Problem

NCTB-standard exam papers with complex Bengali typography, formulas, and 2×1 booklet imposition often require bulky TeX Live installations or costly, privacy-sensitive backend compilation.

What It Does

  • 100% client-side XeLaTeX compilation in WebAssembly using texlyre-busytex with zero server latency or hosting costs
  • Bengali OpenType font shaping with Kalpurush.ttf via fontspec and polyglossia packages
  • Automated NCTB-standard paper formatting for Creative Questions (CQ), Short Questions (SQ), and 2-column MCQs with dynamic option grid layouts
  • Automated 2x1 landscape booklet imposition ({pLast, pFirst, pSecond, pThird}) and document merging via pdf-lib
  • Dual Web Worker architecture offloading asset downloading and multi-pass WASM compilation from the UI thread
  • 30-day instant persistent caching in IndexedDB with background verification and pre-warming
  • Monaco JSON editor with Zod schema validation, Bengali math symbol quick-input bar, and mobile clipboard integration
  • High-DPR HTML5 PDF canvas viewer with dynamic fit-to-width and IntersectionObserver scroll tracking

How It Works & Architecture

Dual Web Worker pipeline: Worker 1 handles streamed asset downloading and IndexedDB unpacking; Worker 2 executes multi-pass WebAssembly XeLaTeX compilation. Generated A5 CQ/SQ pages are reordered into 2x1 printable A4 booklet signatures via in-memory pdf-lib manipulation, merged with MCQ sections, and rendered through a native HTML5 DPR canvas viewer.

Technical Challenges

  • !Compiling complex Bengali font shaping (fontspec/polyglossia) inside memory-constrained browser WebAssembly runtimes without crashing mobile tabs.
  • !Designing automated 2x1 booklet imposition algorithms that correctly calculate page signatures and offsets for double-sided folding.
  • !Managing a 78MB compiler bundle efficiently using IndexedDB chunked caching and persistent storage locks.

What I Learned

  • Heavy computational workloads like LaTeX typesetting can run entirely on client machines with WebAssembly and Web Workers, eliminating server scaling costs.
  • Decoupling font shaping and asset management into dedicated worker threads keeps the editor UI responsive at 60 FPS.

Technology Stack

Next.js 16React 19TypeScriptTailwind CSS v4WebAssembly (XeLaTeX)pdf-libpdfjs-distMonaco EditorWeb WorkersIndexedDBZod