Collaborative writing, structured documents, and Typst-powered export in one browser-based editor.
Write in a familiar visual interface. Produce professional, print-ready documents without leaving the browser.
Overview · Why ladoc · Features · Architecture · Quick start · Roadmap · Contributing
ladoc is an open-source collaborative document editor built for the browser.
It combines the usability of a modern visual editor with the output quality of a structured typesetting system. Instead of forcing users to choose between ease of use and professional layout, ladoc brings both into a single workflow:
- write in a familiar editor
- collaborate in real time
- preview changes instantly
- export polished, print-ready documents
Under the hood, ladoc uses TipTap for editing, Typst for document rendering and export, and Yjs/Hocuspocus for collaborative editing.
Most document tools still force a tradeoff.
Visual editors are easy to use, but often weak when it comes to structure, typography, and reliable export. Typesetting systems produce excellent output, but they are too technical for many users and teams.
ladoc is built to bridge that gap.
It provides a browser-based editing experience for people who want:
- a Word-like writing workflow
- collaborative editing in real time
- structured, reusable document templates
- high-quality PDF and document export
- a modern open-source foundation for professional writing tools
- Visual editor built with TipTap
- Multiple working modes: visual, split, and Typst source
- Support for headings, lists, tables, images, formulas, and code blocks
- Footnotes, citations, and automatic table of contents
- Rich text formatting, highlighting, and layout controls
- Template-based document creation
- Autosave by default
- Version history with restore support
- Soft delete and recovery
- Export to PDF, SVG, Typst, plain text, and LaTeX
- Real-time collaboration with Yjs
- Sync server powered by Hocuspocus
- Live cursors for active collaborators
- Offline persistence with IndexedDB
- Email/password authentication
- GitHub and Google sign-in
- Role-based sharing per document
- PostgreSQL-backed persistence with Prisma
- English
- German
Additional languages can be added through messages/*.json.
A live demo is planned. Screenshots currently provide a preview of the interface and editing experience.
ladoc is built around a simple idea:
Keep writing approachable at the surface, and structured underneath.
- TipTap provides the browser editing experience
- Typst powers structured document rendering and export
- Yjs + Hocuspocus enable collaborative editing
- Next.js provides the application framework
- Prisma + PostgreSQL handle persistence and data access
TipTap JSON -> serializer -> Typst source -> WASM worker -> preview/export
- The editor produces structured document content.
- ladoc serializes that content into Typst.
- Typst is compiled in the browser through WASM.
- The output is used for preview and export.
This architecture makes it possible to preserve a visual editing workflow while still producing high-quality documents.
| Area | Technology |
|---|---|
| Framework | Next.js 16 |
| UI | React 19 |
| Language | TypeScript 5 |
| Styling | Tailwind CSS 4 |
| Editor | TipTap v3 |
| Typesetting | Typst via @myriaddreamin/typst.ts |
| Collaboration | Yjs + Hocuspocus |
| Database | PostgreSQL |
| ORM | Prisma 7 |
| Authentication | Auth.js / NextAuth v5 |
| State | Zustand |
| i18n | next-intl |
| Testing | Vitest + Testing Library |
ladoc includes templates for common professional document types:
- Thesis
- Resume
- Letter
- Report
- Presentation
- Book
- Invoice
- Meeting minutes
Custom templates can be added in src/lib/templates/.
- Node.js >= 20
- PostgreSQL >= 14
- npm, pnpm, or yarn
git clone https://github.com/Hamido212/ladoc.git
cd ladocnpm installcp .env.example .envSet at least the following values:
DATABASE_URL="postgresql://ladoc:ladoc_dev@localhost:5432/ladoc"
AUTH_SECRET="<generate-with-openssl-rand-hex-32>"
NEXTAUTH_URL="http://localhost:3000"Generate a secure secret with:
openssl rand -hex 32npx prisma migrate dev
npx prisma generatenpm run devOpen http://localhost:3000.
npm run collabThe collaboration server listens on ws://localhost:1234 by default.
A complete environment template is available in .env.example.
| Variable | Description | Example |
|---|---|---|
DATABASE_URL |
PostgreSQL connection string | postgresql://user:pass@localhost:5432/ladoc |
AUTH_SECRET |
Secret used for authentication | openssl rand -hex 32 |
NEXTAUTH_URL |
Base URL of the application | http://localhost:3000 |
AUTH_GITHUB_ID / AUTH_GITHUB_SECRET |
GitHub OAuth credentials | — |
AUTH_GOOGLE_ID / AUTH_GOOGLE_SECRET |
Google OAuth credentials | — |
NEXT_PUBLIC_COLLAB_URL |
Hocuspocus WebSocket endpoint | ws://localhost:1234 |
S3_ENDPOINT |
S3-compatible storage endpoint | http://localhost:9000 |
S3_ACCESS_KEY |
Storage access key | — |
S3_SECRET_KEY |
Storage secret key | — |
S3_BUCKET |
Storage bucket name | ladoc-assets |
S3_PUBLIC_URL |
Public asset base URL | http://localhost:9000/ladoc-assets |
| Command | Description |
|---|---|
npm run dev |
Start the development server |
npm run build |
Build for production |
npm run start |
Start the production server |
npm run lint |
Run ESLint |
npm run format |
Format the codebase |
npm run format:check |
Check formatting |
npm run test |
Run tests |
npm run test:coverage |
Run tests with coverage |
npm run collab |
Start the collaboration server |
ladoc/
├── src/
│ ├── app/ # Next.js App Router
│ ├── components/ # UI components
│ ├── hooks/ # Editor and app hooks
│ ├── lib/ # Auth, db, editor, templates, typst
│ ├── stores/ # Zustand stores
│ └── generated/ # Generated code
├── server/ # Collaboration server
├── prisma/ # Database schema
├── messages/ # i18n messages
└── public/ # Static assets
- Visual editor with live Typst preview
- Template-based document creation
- Autosave, version history, and restore
- Authentication with email/password and OAuth
- German and English localization
- Real-time collaboration with live cursors
- Export to PDF, SVG, Typst, plain text, and LaTeX
- Comments and review mode
- Improved bibliography and citation workflows
- Better asset handling for preview and export
- PWA support and mobile polish
- AI-assisted writing tools
- More languages
- LaTeX import
- Custom theme editor
- Cloud storage integrations
Contributions are welcome.
- Fork the repository
- Create a feature branch
- Commit your changes
- Push the branch
- Open a pull request
Before submitting changes:
- run formatting with
npm run format - run linting with
npm run lint - run tests with
npm run test
This project is licensed under the MIT License. See LICENSE for details.
ladoc builds on top of excellent open-source tools, especially:
If you find ladoc useful, consider giving it a star.

