Casual Docs

A document editor that respects the .docx.

Open a Word document, edit it in the browser with WYSIWYG fidelity, save it back as .docx — the layout painter keeps OOXML's box model so the file round-trips cleanly. Real-time co-editing rides on a stateless Go gateway that speaks the y-websocket protocol in roughly 120 lines.

Pristine fixtures
39 / 39
npm SDK
v1.2.0
Gateway LOC
~120
Co-edit smoke
5 s
License
Apache-2.0
What it does

A Word-flavored surface, with .docx as the source of truth.

OOXML-preserving model

ProseMirror schema + layout painter (forked from eigenpal/docx-editor, MIT) keeps Word's box model intact through every edit. Round-trips audited per-tag — 39 of 39 fixtures pristine = 100%, with a published gap matrix.

G

Stateless Go gateway

No DB, no on-disk update log. The gateway implements the y-websocket protocol in ~120 lines, brokers frames between room members, and drops the room when the last client disconnects. Document persistence is owned by the host.

Real-time co-editing, verified

Yjs + y-prosemirror. Each room is a single in-memory Y.Doc. A 5-second smoke test proves text fan-out, awareness, and live filename rename across two peers — every push runs it. Share-link model for v0; WOPI / JWT slot in behind one Go interface.

🎁

14-template home gallery

Real .docx files across four categories (Personal, Work, Education, Career), each with a first-page PNG preview rendered via LibreOffice. Title-bar logo click returns to the gallery — the Google Docs pattern.

3

Three-way fidelity harness

Every push runs the suite against LibreOffice and OnlyOffice DocumentBuilder, then compares. Word-compat heuristics live behind an opt-in wordCompat flag for non-spec behaviour (e.g. the last-row closing border, issue #395).

H

Pluggable host integration

One Go interface (host.Integration) with a concrete inline impl for the v0 share-link flow. WOPI and JWT-secured REST API slot in for v1+ without touching the WebSocket layer.

A full writing surface

Paginated WYSIWYG with real page breaks, headers/footers, and multi-column sections. Spell check (Hunspell), autocorrect + smart quotes, find & replace with regex, a command palette (Ctrl+Shift+P), footnotes/endnotes, citations, voice typing, document outline, and live word/character counts.

AI assistant, tools not chat

A document assistant that acts through real editor operations — read the outline, rewrite a selection, convert a range to a table, insert a TOC, harmonize styles, build a report from data. Every mutation defaults to a tracked change you review in the sidebar before it lands. Bring your own key, route through a self-hosted proxy, or run a local model on desktop — the tool catalog is the same everywhere.

Export & embed

Print / Export-as-PDF with page setup, plus IndexedDB autosave + restore. Drop the editor into your own React app with the <DocxEditor> component from @casualoffice/docs (v1.2.0) — see the SDK guide — or run the whole thing from one Docker image.

Stack

React on top, Go underneath, OOXML in the middle.

React + Bun + Vite ProseMirror Yjs + y-prosemirror Go 1.25 y-websocket protocol LibreOffice fidelity harness @casualoffice/docs · npm
Self-host with one image. The Docker image bundles the SPA, the Go gateway, and a static file server into a single port. Upload a .docx, click Share, send the link, edit live.
docker run -p 8080:8080 casualoffice/docs:latest