Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Rudra Code

The open-source document engine that lets any product add professional editing, real-time collaboration, and format conversion — embeddable in hours, not months.


What is Rudra Code?

Rudra Code is a modular, pure-Rust SDK for document workflows. It reads, writes, edits, and converts documents across DOCX, ODT, PDF, TXT, Markdown, XLSX, ODS, and CSV formats — with CRDT-based real-time collaboration, a page layout engine, and a production-ready web editor.

CapabilityDescription
Multi-formatDOCX, ODT, PDF, TXT, Markdown, XLSX, ODS, CSV, legacy DOC
Pure RustZero C/C++ dependencies. Compiles to native, WASM, and C FFI
CollaborativeFugue CRDT for conflict-free multi-user editing
Layout enginePagination, text shaping (rustybuzz), font subsetting, PDF export
Web editorProduction-grade browser editor with toolbar, comments, track changes
PDF viewerBuilt-in PDF viewer with annotations (highlight, comment, draw, redact)
SpreadsheetCanvas-based spreadsheet with 60+ formulas, charts, and real-time collab
AI integrationOptional AI sidecar (llama.cpp with Qwen2.5-3B) for document assistance
Self-hostableSingle Docker image with white-labeling support
EmbeddableRust library, WASM module, C shared library, npm packages, or Docker

Architecture

Layer 1: Core Engine (Rust)     — Format I/O, document model, operations, CRDT
Layer 2: Server (Rust/Axum)     — REST API, WebSocket collab, storage, auth, admin
Layer 3: Client SDK (JS/TS)     — Embeddable editor, headless API, React/Vue components
Layer 4: Platform Features      — White-labeling, integration mode, webhooks, AI sidecar

Each layer is independently usable:

  • Just need format conversion? Use Layer 1 as a Rust library or WASM module
  • Need a document API? Use Layers 1+2 — deploy the server via Docker
  • Need an embeddable editor? Use Layers 1+2+3 — npm install and embed
  • Need a full branded product? Use all 4 layers — white-label and self-host

Quick Start

Docker (fastest):

docker run -p 8080:8080 rudra/server
# Editor at http://localhost:8080
# API at http://localhost:8080/api/v1

Rust library:

cargo add s1engine --features full

npm (browser):

npm install @rudra/sdk @rudra/wasm

Tip: See the Quick Start guide for a complete walkthrough, or jump to Docker deployment for self-hosting.

Distribution

I want to…Install
Process documents in Rustcargo add s1engine
Process documents in JS (no UI)npm install @rudra/sdk
Embed an editor in Reactnpm install @rudra/react
Embed an editor in Vuenpm install @rudra/vue
Run a document API serverdocker run rudra/server
Self-host the full platformdocker compose up
Convert DOCX to PDF (CLI)Download from GitHub Releases

Crate Structure

crates/
  s1-model/          Core document model (zero dependencies)
  s1-ops/            Operations, transactions, undo/redo
  s1-format-docx/    DOCX (OOXML) reader/writer
  s1-format-odt/     ODT (ODF) reader/writer
  s1-format-pdf/     PDF export
  s1-format-txt/     Plain text reader/writer
  s1-format-xlsx/    XLSX/ODS/CSV spreadsheet reader/writer
  s1-convert/        Format conversion pipelines
  s1-crdt/           Fugue CRDT for collaboration
  s1-layout/         Page layout, pagination, line breaking
  s1-text/           Text shaping (rustybuzz), font discovery
  s1engine/          Facade crate — high-level public API

License

AGPL-3.0-or-later. Commercial dual-licensing available — contact us for details.