collaborative, git-based typst editing
  • TypeScript 92.9%
  • Nix 4.9%
  • CSS 1.2%
  • HTML 0.5%
  • JavaScript 0.3%
  • Other 0.2%
Find a file
goeranh e3042ade26
Some checks failed
CI / NixOS VM tests (push) Has been cancelled
CI / Unit & E2E tests (push) Has been cancelled
CI / Typecheck (push) Has been cancelled
ai tools
2026-07-23 15:08:25 +02:00
.forgejo/workflows fix: don't trim stdout in runGit to preserve file content newlines 2026-05-28 01:00:09 +02:00
backend ai tools 2026-07-23 15:08:25 +02:00
docker llm api settings per user 2026-07-23 09:37:16 +02:00
frontend document chat working 2026-07-23 14:07:13 +02:00
landing admin interface 2026-05-16 14:04:45 +02:00
nix more keepalive 2026-06-29 21:20:28 +02:00
.env.example ai panel refactoring 2026-07-23 13:43:21 +02:00
.gitignore nixos package, module and sample config 2026-05-13 20:26:54 +02:00
COMPARISON.md comparison between overleaf and typst-web 2026-05-15 18:09:26 +02:00
docker-compose.standalone.yml standalone docker image uses sqlite now 2026-05-20 11:57:06 +02:00
docker-compose.yml llm api settings per user 2026-07-23 09:37:16 +02:00
flake.lock initial flake 2026-05-13 12:03:44 +02:00
flake.nix fix: don't trim stdout in runGit to preserve file content newlines 2026-05-28 01:00:09 +02:00
LICENSE add LICENSE 2026-05-15 23:38:07 +02:00
menu.png update pictures 2026-05-20 16:12:32 +02:00
project.png update pictures 2026-05-20 16:12:32 +02:00
README.md update readme to reference wasm 2026-05-29 15:03:24 +02:00

typst-web

A self-hosted, collaborative Typst editor. Write and compile Typst documents in the browser, with real-time multi-user editing, git version control, and PDF/ZIP export. It now has typst compiled to WASM, if WASM is supported in your browser, the documents are rendered locally.

AI Slop Disclaimer

Large parts of this codebase were written by ai. not by autonomous agents but by claude code and then reviewed, tested and edited by me. I did this largely because i loathe javascript but really wanted this to exist. I wont claim that this is good code, it does what i wanted. For me this is the ability to have collaborative editing AND git support. I would love to see anyone have a go at that in a less sloppy way, I just want this right now :D. For perspective - this project thus far has cost me less than a yearly typst cloud subscription and i really value having my stuff locally.

Project dashboard

Editor

Features

  • Real-time collaborative editing (Yjs + WebSocket)
  • Live SVG preview with source-to-preview sync
  • Multi-file projects with binary asset uploads
  • Git integration: commit, push, pull, diff gutter, git-over-HTTP and git-over-SSH
  • PDF and ZIP export
  • Vim mode, syntax highlighting, autocomplete, spellcheck (EN/DE)
  • Project sharing via invite link or public PDF URL
  • Reusable project templates
  • SSO via OpenID Connect (optional)
  • WASM Typst compiler to compile locally in your browser

Getting Started

Prerequisites: Docker and Docker Compose.

  1. Copy the example env file and set the required secrets:

    cp .env.example .env
    

    Minimum required values in .env:

    JWT_SECRET=<random string>
    INTERNAL_SECRET=<random string>
    POSTGRES_PASSWORD=<random string>
    
  2. Start the stack:

    docker compose up -d
    

    The frontend is available at http://localhost:3000, the backend at http://localhost:3001.

  3. Register an account at http://localhost:3000.

Git Access

Each project has a built-in git repository. You can interact with it from the Git panel in the editor sidebar, or from any external git client.

HTTP clone:

git clone http://<host>/git/<username>/<project>.git

Authenticate with your email as username and your JWT (from browser localStorage token) as password.

SSH clone: Add your SSH public key under Settings, then:

git clone ssh://git@<host>:2222/<username>/<project>.git

Usernames and project names are slugified (lowercased, spaces replaced with -).

Configuration

All configuration is done via environment variables passed to the backend container. Key variables:

Variable Description
DATABASE_URL PostgreSQL connection string
JWT_SECRET Secret for signing auth tokens
CORS_ORIGIN Frontend origin (default: http://localhost:3000)
APP_URL Public frontend URL, used in invite emails
SMTP_HOST/PORT/USER/PASS/FROM Optional SMTP for email invites
SSH_HOST Hostname shown in SSH clone URLs
OIDC_ISSUER/CLIENT_ID/CLIENT_SECRET/REDIRECT_URI Optional OIDC SSO; disables local login when set

Development

Requirements: Bun, PostgreSQL, the typst CLI.

# Backend
cd backend && bun install && bun run dev

# Frontend
cd frontend && bun install && bun run dev

The frontend dev server proxies API requests to http://localhost:3001. Set DATABASE_URL in the backend before starting.