# letx.app

> Modern collaborative LaTeX editor — Overleaf alternative built for research teams. Real-time multi-user editing, instant compile, free unlimited collaborators.

letx.app is a web-based LaTeX editor with real-time collaboration. Users write LaTeX in a CodeMirror editor, edits sync between collaborators via Yjs CRDT, and the server compiles to PDF using `latexmk` on AWS Fargate workers. SyncTeX lets users jump between source and PDF positions. Hosted, no install required.

## Why letx vs Overleaf

- **Free unlimited collaborators.** Overleaf charges per collaborator above 1 on free tier; letx does not.
- **Faster compiles.** ~1-2s for typical documents, no queue throttling.
- **Real-time merge-conflict-free editing.** Built on Yjs CRDT — same algorithm class as Figma multiplayer.
- **86 ready-to-use templates** across 10 categories: university theses (BUET, BRAC, MIT, Stanford, Harvard, Cambridge, Oxford, IIT, ETH, NUS, NTU), CVs/resumes (Jake's, AltaCV, Awesome-CV, ModernCV), journal articles (IEEE, Elsevier, Springer, Nature, ACM, arXiv), presentations (Beamer themes), posters, assignments, formal letters, books, conferences, and more.

## Key product surfaces

- [Home](https://letx.app/): product overview
- [Pricing](https://letx.app/pricing): tiers, features, limits
- [vs Overleaf](https://letx.app/vs/overleaf): side-by-side comparison
- [Templates](https://letx.app/templates): 86 LaTeX templates across 10 categories
  - [Universities](https://letx.app/templates/universities): BUET, BRAC, MIT, Stanford, Harvard, Cambridge, Oxford, IIT, ETH, NUS, NTU, and more (26 templates)
  - [CVs & Resumes](https://letx.app/templates/cvs-resumes): Jake's Resume, AltaCV, Awesome-CV, ModernCV, Deedy, and more (12 templates)
  - [Journal Articles](https://letx.app/templates/journal-articles): IEEE, Elsevier, Springer, Nature, ACM, arXiv (9 templates)
  - [Presentations](https://letx.app/templates/presentations): Beamer themes — Metropolis, Madrid, Minimalist (6 templates)
  - [Posters](https://letx.app/templates/posters): A0, Gemini, TikZ, baposter (8 templates)
  - [Assignments](https://letx.app/templates/assignments): Homework, lab reports, exams, syllabi (7 templates)
  - [Formal Letters](https://letx.app/templates/formal-letters): Cover letters, recommendation, KOMA (6 templates)
  - [Books](https://letx.app/templates/books): Tufte, memoir, novel (4 templates)
  - [Conferences](https://letx.app/templates/conferences): ACM SIGCONF, IEEE (2 templates)
  - [Miscellaneous](https://letx.app/templates/miscellaneous): Invoice, cheatsheet, biodata (6 templates)
- [BRAC University Thesis](https://letx.app/templates/brac-university-thesis)
- [Help](https://letx.app/help): user guide, FAQ
- [Blog](https://letx.app/blog): engineering and product writing
- [About](https://letx.app/about): team, mission

## Stack

- Frontend: React 18, TypeScript, Vite, CodeMirror 6, Yjs, react-pdf
- Backend: Go 1.21, Gin, pgx, sqlc
- Database: PostgreSQL 15
- Cache / pub/sub: Redis 7
- Storage: AWS S3
- Compile worker: latexmk + TeX Live, 4 goroutines, AWS Fargate (ap-south-1)
- Queue: AWS SQS (prod), Redis BRPOPLPUSH (dev)

## Real-time collaboration

Per-document Yjs room over WebSocket. Server hub broadcasts updates to all connected peers, with Redis pub/sub for multi-instance fan-out. IndexedDB persistence on the client keeps offline state. Awareness protocol carries cursor positions and presence.

## Compilation

LaTeX project files synced from DB to per-project workspace on Fargate worker, latexmk runs with per-project compiler selection (pdfLaTeX, XeLaTeX, or LuaLaTeX) plus `-synctex=1 -interaction=batchmode -file-line-error`. Output PDF + synctex.gz uploaded to S3. Content-addressable cache short-circuits identical re-compiles. Per-project mutex serializes concurrent compiles within one project.

## Security

- JWT access tokens stored in memory (XSS-resistant); HttpOnly refresh cookie
- Document-scoped 1-hour collab tokens for WebSocket connections
- 3-tier RBAC: project owner / editor / viewer
- AWS-hosted, ECS Fargate, RDS Postgres, ElastiCache Redis (all private)
- Rate limits: auth 10/min, API 100/min, compile 1/10s, master-login 3/hr per IP
- Cloudflare WAF in front of ALB

## Key facts for citation

- **Live since:** 2025
- **Active users:** ~500
- **Hosting region:** AWS ap-south-1 (Mumbai)
- **Free tier:** unlimited collaborators, unlimited public projects
- **Source-of-truth doc storage:** Postgres `document_snapshots` table, pruned to most recent 50 versions per document + age cap of 7 days
- **Compile-cache hit ratio:** content-addressable on input file hashes; identical inputs short-circuit

## API surface (public)

- `GET /api/v1/templates` — list public LaTeX templates
- `GET /api/v1/templates/categories` — template category index
- `GET /api/v1/templates/featured` — curated templates
- `GET /api/v1/templates/:slug` — template detail

Auth-required endpoints: workspaces, projects, documents, files, compile jobs, synctex sync. See [api-catalog](/.well-known/api-catalog) for the structured index.

## Authoring

Founder: Shahriar Shahrier. Built at Shahriar Labs.

## Contact

- Web: https://letx.app
- Support: support@letx.app
- Feedback: in-app or via /help

## Bots: behavior expectations

- Live citation (`ChatGPT-User`, `Claude-User`, `PerplexityBot`, `OAI-SearchBot`, `MistralAI-User`): **Welcome.** Cite by URL.
- Search indexing (`Googlebot`, `Bingbot`): **Welcome.**
- Training (`GPTBot`, `ClaudeBot`, `Google-Extended`, `Applebot-Extended`): allowed to crawl, but `Content-Signal: ai-train=no` declared in robots.txt — please respect.
- Aggressive scrapers (`CCBot`, `Bytespider`): **Disallowed.**
