Lattice
A workspace for your research.
A word processor for the browser, compatible with Word files. Open, edit and save .docx with tracked changes, versions, collaboration, templates and PDF — in packages you take one at a time.
ProductivityTypeScript · JavaScriptGitHub @JFranciscoRoblesOnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
Owners of public repositories under a personal GitHub account can sign in to verify ownership and manage the introduction themselves. No administrator approval is needed.
Sign in, generate a verification file, and commit it to this repository’s default branch within 30 minutes. Files on other branches or forks do not count. Then check the file below to manage the project without administrator approval. Keep the file to retain your access.
If needed, you will go to sign-in. After signing in, return here and press your chosen verification button again.
Run /nomorevibe verify in your project folder to verify ownership and manage the introduction yourself.
Verify in one minuteAsk about other verification options
A word processor for the browser, compatible with Word (DOCX) files, with its own engine: layout, collaboration, templates and PDF.
Taken from the repository README
Loading the full README.
Read the full README ↗Rebodocs writes its own document model, line breaking, pagination, caret,
selection and DOCX reader and writer. It does not use ProseMirror,
contenteditable or any editing library, and the engine's only runtime
dependency is fflate. Pages are laid out by Word's rules, so a document
looks the same in both, and what the editor does not understand is kept in
the file untouched.
It is not a copy of Word. It leaves out much of what Word has, and adds things of its own, such as template variables and an MCP server for AI assistants.
npm install @rebodocs/react
'use client';
import { DocsEditor } from '@rebodocs/react';
export default function Contract({ file }: { file: Uint8Array }) {
return (
<div style={{ height: '100vh' }}>
<DocsEditor docx={file} name="contract.docx" onSave={(docx) => upload(docx)} />
</div>
);
}
That is the whole editor: toolbar, ruler, side panel, pages and status bar.
For an interface of your own, the same package has headless hooks
(DocsProvider, useDocs, …). See React component
and Headless.
test-documents/ that anyone can run: 99% of Word's lines land where Word puts them.{{client.name}} is a variable, with formats for dates and amounts, and {{#lines}} … {{/lines}} repeats rows or paragraphs. Fill them in the editor, on a server or from the command line.| Package | What it is | Runs in |
|---|---|---|
@rebodocs/react | The editor as a React component, and headless hooks. Everything below is bundled in. | Browser (SSR-safe) |
@rebodocs/editor | The editor and its interface pieces, without a framework. | Browser |
@rebodocs/viewer | A document only to read, with or without React, and the first page as a thumbnail. | Browser (SSR-safe) |
@rebodocs/core | The engine: document model, DOCX, layout, PDF, templates. No DOM. | Browser, Node, Deno, Bun, Workers |
@rebodocs/collab | The collaboration server and its browser client. | Node, browser |
@rebodocs/mcp | An MCP server for AI assistants, and the route that takes a chat to the Claude API. | Node |
@rebodocs/core ◄── @rebodocs/editor ◄── @rebodocs/viewer ◄── @rebodocs/react
▲ │
├─ @rebodocs/collab ◄────────────────────────────────────────┘
└─ @rebodocs/mcp
// Any page, no framework
import { Editor, createToolbar } from '@rebodocs/editor';
const editor = new Editor(document.querySelector('#pages')!);
createToolbar(document.querySelector('#toolbar')!, editor);
editor.loadDocx(bytes);
// A server, filling a template
import { importDocx, fillVariables, exportDocx } from '@rebodocs/core';
const docx = exportDocx(fillVariables(importDocx(template), { client: { name: 'Ana Pérez' }, amount: 2500 }));
npx @rebodocs/mcp --root ~/Documents/contracts # MCP server for Claude Desktop and other clients
npx @rebodocs/collab --backend https://app.example/api/docs # collaboration server
Each is a small application that uses the packages the way yours would. Run them from the repository.
| Demo | Command | What it shows |
|---|---|---|
apps/demo | npm run demo · online | The editor as it comes, another layout, and an interface built on the hooks. |
apps/storage | npm run storage | Documents in S3, R2 or MinIO through signed addresses; a PDF made on the server. |
apps/realtime | npm run realtime | Several people on one document, a backend with signed tickets, a version per session. |
apps/assistant | npm run assistant | Claude beside a shared document; the API key stays on the server. |
apps/viewer | npm run viewer | Documents only to read: a shelf with their thumbnails, each opened in the viewer. |
apps/crm | npm run crm | The editor inside a CRM: contracts from templates, autosave, review, the assistant. |
apps/desktop | npm run desktop | A Tauri desktop application for .docx files on disk. |
Node 22.12 or later.
git clone https://github.com/JFranciscoRobles/rebodocs.git
cd rebodocs
npm install
npm run dev # playground at http://localhost:5173
npm test # Vitest
npm run test:browser # the editor itself, in Chrome
npm run typecheck
| Command | What it does |
|---|---|
npm run build:packages | Builds core, editor, collab and mcp into packages/<name>/dist. |
npm run build:react | Builds @rebodocs/react and packs it as a tarball. |
npm run site | The documentation site at http://localhost:5174. |
npm run generate -- template.docx data.json -o out.pdf | Fills a template without a browser; npx -p @rebodocs/mcp rebodocs-generate outside the repository. |
npm run word-check | Lays out the documents of test-documents/ and compares them with the PDFs Word made of them. |
npm run word-compare -- file.docx | Compares one document with Word's PDF of it; --word has Word make it (macOS). |
npm run locale -- fr texts/fr.json | Starts or updates a translation of the interface. |
0.13: ready to try in production, not yet stable. The API may still change before 1.0; every change is listed in the changelog.
What is checked, and how, is on the status page:
737 automated tests, 76 of them driving the editor and the viewer in Chrome
(npm run test:browser), layout measured line by line against Word with the
documents of test-documents/ (npm run word-check), a round trip of real
documents, collaboration across networks, and the rest of the interface
driven in a browser by hand. The main limits today:
Issues and pull requests are welcome. See CONTRIBUTING.md.
MIT. Third-party notices are in THIRD_PARTY_NOTICES.md.
apps/playgroundnpm run dev |
| Every piece wired together without a framework, on a 100-page document. |