A hybrid system that combines a React-based frontend with a FastAPI backend — balancing in-memory logic for speed and using backend calls only when necessary.
This powers a blazing-fast, in-memory LaTeX-to-PDF conversion platform with real-time LaTeX editing, snapshot versioning, and live PDF preview — built entirely from scratch using React, FastAPI, and Dockerized TeX Live. The system supports Overleaf-style editing, rapid compile, responsive layout, and dark/light themes — all optimized for performance, clarity, and extensibility.
🔧 Zero-Latency Compilation
- Instant PDF generation using
pdfTeXvia MacTeX (Dockerized for isolation) - FastAPI backend with clean
/compileAPI for PDF serving
🧠 In-Memory File System & Snapshots
- Files stored in browser memory for ultra-fast read/write
- Snapshot versioning with O(1) constant complexity — supports instant restore & comparison
- Zero backend database usage (unless extended) = blazing speed
🧾 Live PDF Preview + Editor Sync
- Write LaTeX → Compile → See PDF preview without reloading
- React-based UI ensures updates are smooth and non-blocking
🧩 Feature-Rich File Tree
- Built using vanilla React & JavaScript
- Add, delete, rename
.texfiles in a real-time nested structure
🕵️ Real-Time Diff + History Viewer
- Save snapshots of file content over time
- View changes between snapshots using color-coded text diffs (
diff-match-patch) - Restore or download past versions
🌗 Dark/Light Mode & Responsive UI
- Toggle between clean light mode and distraction-free dark mode
- Drag-resizable layout (via
react-split) to rearrange panels live
📥 PDF Download Support
- Once compiled, PDFs can be downloaded instantly
- Clean output naming & blob object creation handled client-side
- React + TypeScript
- CodeMirror (planned) for LaTeX syntax highlighting
react-pdffor previewing compiled PDFsdiff-match-patchfor real-time file comparisonreact-splitfor resizable layout panels
- FastAPI (Python) for secure and fast LaTeX compilation
- MacTeX + pdfTeX inside a Docker container for LaTeX rendering
- Minimal and extendable — currently stateless but can integrate SQLite if needed
- User edits LaTeX source in a live editor.
- On "Compile", frontend sends LaTeX content via POST to FastAPI.
- FastAPI uses
pdfTeX(from MacTeX) to compile into PDF. - PDF is returned as a blob and rendered using
react-pdf. - Users can download PDF, take snapshots, or view diffs from any point in history.
frontend/
├── App.tsx
├── components/
│ ├── Editor.tsx
│ ├── FileTree.tsx
│ ├── PDFPreview.tsx
│ └── SnapshotHistory.tsx
└── styles/
backend/
├── main.py
├── compiler.py
├── Dockerfile
└── requirements.txt
To get started instantly with the full application, you can download and run the pre-built Docker images directly — no need to clone or build anything.
🔽 Download Docker Images (Frontend + Backend):
Download LaTeXPlatform.tar
Once downloaded, load and run them as follows:
docker load -i LaTeXPlatform.tarExpected output:
Loaded image: backend-backend:latest
Loaded image: frontend-interface:latest
docker run -d --name front1 -p 5173:5173 frontend-interfacedocker run -d --name back -p 8000:8000 backend-backendOnce both containers are running:
📄 Frontend: http://localhost:5173
⚙️ Backend API: http://localhost:8000
You'll now see the full SwiftLaTeX interface with:
- ✍️ Real-time LaTeX Editing
- 📁 File Tree Navigation
- 📑 Live PDF Preview
- 🕒 Snapshot Versioning & Diff Viewer
Everything is in-memory — ensuring lightning-fast compile times and a fluid Overleaf-like experience.
- No database or disk dependency — it runs entirely in memory
- O(1) snapshot handling (via simple timestamped file state)
- Smart file diffing (not just full-text comparison)
- Looks clean, works fast, and mimics Overleaf without the clutter
Agastya Rathee
Computer Science & Data Science @ UW–Madison
📧 ratheeagastya@gmail.com
🔗 GitHub
- Integrate AI-powered
DiffChatEditorfor smarter change insights - Real-time collaboration with CRDT/WebSocket layer
MIT License – Free to use, fork, and build upon.
“A fully functional LaTeX IDE in your browser — fast, clean, and memory-based.”