Skip to content

yyq1025/light-doc

Repository files navigation

Light Doc (Live Demo)

A lightweight collaborative doc editor built with TipTap + Yjs on the frontend and PartyServer (Cloudflare Durable Objects) on the backend; inspired by the collaboration flow of Excalidraw.

Preview

light-doc-demo.mp4

Always sync + Full GFM support + File import/export

Highlights

  • Real-time collaboration with CRDTs: Yjs handles conflict-free edits and presence (multi-cursor) across tabs and users.
  • Offline-first UX: documents persist locally via IndexedDB and become editable after local state sync completes.
  • Edge-native backend: collaboration server runs on Cloudflare Workers + Durable Objects, with persistence to Cloudflare D1 via Drizzle ORM.
  • Modern TypeScript stack: React 19, TanStack Start/Router, Vite, and end-to-end type-safe patterns.
  • Production-minded tooling: Biome for lint/format, Zod for runtime validation, and shadcn/ui components.

Features

  • Rich-text editing (headings, lists, code blocks, blockquotes, text alignment, highlight, etc.)
  • Markdown import (.md) with confirmation dialog
  • Export to Markdown (.md) and HTML (.html)
  • “Share link” collaboration sessions (/?room=...) with presence avatars and colored carets
  • Solo mode still supports cross-tab sync and local persistence

Getting Started

To run this application:

pnpm install
npx wrangler d1 migrations apply light-doc-db --local
pnpm dev

Building For Production

To build this application for production:

pnpm build

Testing

This project uses Vitest for testing. You can run the tests with:

pnpm test

Styling

This project uses Tailwind CSS for styling.

Linting & Formatting

This project uses Biome for linting and formatting. The following scripts are available:

pnpm lint
pnpm format
pnpm check

About

A lightweight collaborative doc editor built with TipTap + Yjs and PartyServer.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors