Free real-time collaborative editor for LaTeX, Typst and Markdown with revision history https://dongba.yhkze.net
  • HTML 38.1%
  • CSS 25.4%
  • JavaScript 19.7%
  • Python 7.3%
  • Lua 5.9%
  • Other 3.6%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
yuuhikaze feb58933f5
All checks were successful
release / release (push) Successful in 2s
docs: release procedure
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q7bU4Kec4w6pVqigbajupv
2026-11-16 18:55:30 -05:00
.forgejo ci: publish a release with a generated changelog for every tag 2026-11-16 18:55:30 -05:00
.tern feat: bootstrap dongba (schema, contract, docs, plan) (#41) 2026-11-16 05:01:24 -05:00
db feat(db): admin audit, termination queue, export formats and storage compression 2026-11-16 17:33:20 -05:00
docs docs: release procedure 2026-11-16 18:55:30 -05:00
docs-html docs: release procedure 2026-11-16 18:55:30 -05:00
scripts ci: publish a release with a generated changelog for every tag 2026-11-16 18:55:30 -05:00
.gitignore chore: initialize repository with license 2026-11-15 22:18:42 -05:00
CLAUDE.md docs: release procedure 2026-11-16 18:55:30 -05:00
flake.lock feat: bootstrap dongba (schema, contract, docs, plan) (#41) 2026-11-16 05:01:24 -05:00
flake.nix chore: carry every cli the agents use in the dev shell 2026-11-16 17:59:27 -05:00
LICENSE chore: initialize repository with license 2026-11-15 22:18:42 -05:00
openapi.yaml feat(api): admin routes, render formats, image optimization and deletion appeal 2026-11-16 17:33:20 -05:00
PLAN.md docs: release procedure 2026-11-16 18:55:30 -05:00
README.md docs: release procedure 2026-11-16 18:55:30 -05:00

dongba

A free, real-time collaborative editor for LaTeX, Typst and Markdown documents, with full revision history and PDF rendering, served at https://dongba.yhkze.net. Everything Overleaf keeps behind a paid tier is free: unlimited collaborators, full history, every compiler.

  • Real-time collaboration — several people edit the same file with live cursors (Yjs CRDTs), plus threaded comments anchored to the text
  • Three render backends — TeX Live (full), Typst and Pandoc, each on its own autoscaled worker pool
  • Many export formats — PDF everywhere, plus HTML (page or site), DOCX, ODT, EPUB, LaTeX, Typst and Markdown through Pandoc, PNG and SVG through Typst
  • Revision history — every render and every named save is an immutable snapshot; restore never rewrites history
  • Sharing — roles (viewer, commenter, editor, owner), teams, email invitations, share links for people without an account
  • Templates — publish any revision as a template, start new projects from it
  • Lean storage — lossless compression at rest, optional image optimization on upload, content deduplication
  • Administration — user list with storage and quotas, audited admin actions, account termination with notice, appeal and a grace period
  • Reports — ten reports over the database views, downloadable as PDF
  • English and Spanish throughout
  • Phase 2 — LaTeX OCR from images and a bring-your-own-key LLM assistant

Built by yuuhikaze (devops, backend), Felipe Bohórquez (frontend) and Liam (database) as the CMP 4002 final project at USFQ, and run as a real service afterwards.

flowchart TB
    B["Browser — SvelteKit"] -->|OIDC PKCE| KC["Keycloak"]
    B --> W["dongba-web"]
    B -->|"/api/v1"| A["dongba-api (Rust, axum)"]
    B -->|"wss /collab"| C["dongba-collab (Rust, yrs)"]
    C <--> N["NATS"]
    A & C --> DB[("MariaDB")]
    A & C --> S3[("Ceph RGW")]
    Q["worker-typst · worker-pandoc · worker-texlive"] -->|"SKIP LOCKED queue"| DB
    Q --> S3

The data model has 19 core tables, 7 associative tables and 8 dictionaries:

erDiagram
    users ||--o{ sessions : opens
    users ||--o{ project_members : ""
    projects ||--o{ project_members : ""
    teams ||--o{ team_projects : ""
    projects ||--o{ team_projects : ""
    projects ||--|{ folders : contains
    folders ||--o{ files : holds
    blobs ||--o{ files : content
    projects ||--o{ revisions : records
    revisions ||--o{ revision_files : snapshots
    revisions ||--o{ render_jobs : "rendered by"
    backend_formats ||--o{ render_jobs : "produced as"
    render_jobs ||--o{ render_artifacts : produces
    files ||--o{ comment_threads : "annotated by"
    comment_threads ||--|{ comments : contains
    projects ||--o{ activity_events : logs
    activity_events ||--o{ notifications : ""
    users |o--o{ account_deletions : "scheduled for"

Documentation

The documentation index is the entry point for readers; every page:

  • Architecture: services, rendering at scale, availability, identity, delivery
  • Data model: ER diagrams, relationships, BCNF, views, procedures, triggers, Workbench
  • API reference: conventions, auth, permissions, errors, real-time editing
  • Operations: environments, database accounts, object storage, configuration
  • Development: toolchain, trunk-based workflow, database rules, UI verification, docs
  • Design: drafts-first process and principles
  • AI usage: the course's generative-AI disclosure log

Planning lives in PLAN.md; rules for contributors and their coding agents in CLAUDE.md.

Quick start

Open the dev shell (tern, pandoc, bun, MariaDB client, typst):

nix develop

Load the schema and demo data into a local MariaDB:

docker run -d --name dongba-db -p 3306:3306 -e MARIADB_ROOT_PASSWORD=dev -e MARIADB_DATABASE=dongba mariadb:11.4
cat db/0*.sql | mariadb -h 127.0.0.1 -u root -pdev dongba

Build the single-file SQL backend (course submission, Workbench import):

db/build.sh

Lint the API contract:

nix run nixpkgs#redocly -- lint openapi.yaml

Compile the documentation to docs-html/:

nix develop path:. --command tern

Repository layout

db/                 Schema, functions, views, procedures, triggers, seed; build.sh → dongba.sql
openapi.yaml        The API contract; api and web both derive from it
docs/               Documentation source
docs-html/          Compiled documentation (tern)
crates/             Rust services: api, collab, worker (issue #3)
web/                SvelteKit app (issue #9)
design/             UI drafts (issue #8)
scripts/            board.sh (Kanban moves), watch.py (hourly upkeep), release_notes.py (changelogs)
PLAN.md             Roadmap, milestones, issue conventions
CLAUDE.md           Rules for contributors and coding agents
flake.nix           Dev shell
.tern/              Docs pipeline configuration

Deployment

Trunk-based: every merge to master ships to the test environment, tags vX.Y.Z ship to production. Charts and promotion live in the GitOps repositories; reference Operations.

License

MIT