LaTeX Report Studio
A unified web-based engineering report workspace combining Monaco LaTeX editing, on-demand PDF compilation, embedded draw.io diagramming, IEEE BibTeX citation management, and AES-256 encrypted BYO-key Gemini AI text humanization.
Screenshots
Key Metrics
Next.js 16 App Router & Edge Middleware
YtoTech LaTeX-on-HTTP Service
Embedded draw.io Canvas (9 Diagram Types)
AES-256 Encrypted User-Supplied Gemini Keys
One-Click Structured Zip (TeX, Bib, Images)
MongoDB Atlas (Mongoose)
Overview
LaTeX Report Studio is an all-in-one web-based report workspace designed for engineering students and researchers. The platform integrates VS Code-grade Monaco editing, real-time LaTeX compilation via a hosted compiler, embedded draw.io diagramming, IEEE citation management, and BYO-key Google Gemini AI text humanizing within a single authenticated boundary.
Problem
Engineering students writing IEEE technical reports must constantly context-switch between five separate applications: Overleaf for LaTeX, draw.io for diagrams, Grammarly/humanizers for AI text cleaning, Zotero for BibTeX citations, and manual file compression to ship final reports.
Solution
Engineered a unified Next.js 16 workspace that combines editing, compiling, diagramming, citing, and exporting under a single custom JWT auth boundary. Embedded draw.io exports directly into document TeX code, automated BibTeX IEEE citation generation, and offloaded PDF compilation to a stateless HTTP LaTeX compiler.
Architecture
Full-stack Next.js 16 App Router architecture with Edge middleware (middleware.ts) enforcing JWT authentication gates (jose + bcryptjs). The frontend uses @monaco-editor/react, Zustand for editor state, and TanStack Query for server state caching. Project metadata, chapters, and citations persist in MongoDB Atlas. Images and draw.io canvas PNGs upload to AWS S3. Document compilation POSTs assembled main.tex and S3 asset resources to YtoTech LaTeX-on-HTTP, streaming back raw PDF preview bytes.
Challenges
- Assembling a single valid main.tex document from independently-edited chapter files, S3 image references, draw.io PNGs, and a generated .bib file without ordering bugs.
- Managing AWS post-2023 "Bucket owner enforced" S3 bucket policies for public asset URL rendering inside compiled PDFs.
- Encrypting user-supplied Google Gemini API keys at rest using AES-256 crypto primitives to prevent key leaks while avoiding shared API costs.
- Mapping opaque LaTeX compilation error logs into structured, user-friendly UI diagnostics.
Lessons Learned
- Edge-middleware authentication gating for protected Next.js App Router endpoints.
- Designing document assembly pipelines that aggregate nested chapters, BibTeX records, and cloud media into valid TeX code.
- Integrating third-party canvas applications (draw.io) and external stateless compilers (LaTeX-on-HTTP).
- AES-256 symmetric encryption patterns for user-supplied API key storage.
- Building complex Monaco Editor integrations with auto-save debouncing and custom TeX snippets.
Future Improvements
- Self-hosted Docker-based LaTeX compiler fallback to eliminate dependency on third-party compilation service uptime.
- Async queued compilation jobs with WebSockets for large multi-page reports.
- Upgrading Nodemailer / Gmail SMTP to transactional email providers (Resend / AWS SES) for higher sending volume.
- Comprehensive automated unit test suite for BibTeX generator and LaTeX assembler modules.