§ case
Resume Studio
Jul 2026 — presentWeb Development · Developer Tools · Creator · Engineer
- —A self-hostable LaTeX resume builder that runs its entire compile loop in-product: a form editor generates clean, one-page-tuned LaTeX, and a debounced live preview recompiles on every edit via pdf.js — the downloaded PDF is the exact bytes the preview rendered.
- —A custom-LaTeX mode exposes the generated source directly with a safe revert to the form; inline formatting is escaped so no user input can break the document.
- —Compilation runs through Tectonic (XeTeX-based) in per-request isolated temp dirs with no shell escape and a content-hash LRU cache; the generated .tex compiles unchanged on Overleaf's pdfLaTeX despite the engine difference.
- —Everything — multiple resumes, form/code mode, autosave — lives in browser localStorage with zero accounts; the server only ever sees the .tex it's asked to compile.
- —Deployed as a Docker container on a GCP instance, with the Tectonic engine and full LaTeX package cache baked in at build time for offline, sub-second compiles.
Next.jsTypeScriptTectonic (XeTeX)Zustandpdf.jsZodDockerVercelGoogle Cloud Platform (GCP)
◼ Challenges
- →Compile arbitrary user LaTeX safely and fast enough for a live-preview loop, with no server-side shell escape and no per-request cold start
- →Guarantee the downloaded PDF is byte-identical to what live-preview showed, on a self-hostable image with zero system LaTeX and no sudo
- →Keep generated .tex portable to Overleaf's pdfLaTeX even though the app compiles with XeTeX-based Tectonic
◼ Solutions
- →Tectonic runs per-request in isolated temp dirs with --untrusted (no shell escape), a 30s timeout, and a content-hash LRU PDF cache; the Docker image bakes the engine and full LaTeX package cache in at build time for ~1s offline compiles
- →The same generateTex() → /api/compile path serves both the live preview and the final download, so there is no separate export code path that could drift
- →\ifdefined\pdfgentounicode guards in the generated preamble keep output visually equivalent across Tectonic (XeTeX) and Overleaf (pdfLaTeX); the engine is pinned to Tectonic 0.15.0 after 0.16.x crashed loading fontawesome5's bundled OTF fonts
