Document Formats

Detailed specifications of the document formats used by each Cloudillo application.

Overview

Each Cloudillo app stores collaborative documents using application-specific data models. Most apps use Yjs CRDTs for conflict-free concurrent editing, while some use the Real-Time Database (RTDB) for query-oriented structured data. This section provides the complete format specification for each app’s document structure, enabling third-party developers, tool builders, and contributors to understand, extend, and interoperate with Cloudillo documents.

Relationship to CRDT Design Guide

The CRDT Design Guide teaches generic patterns for building collaborative apps (ID-based storage, style inheritance, separate content maps). This section documents the concrete format specifications — the exact field names, types, and structures used by each app.

Application Formats

Application Content Type Storage Complexity Status
Prezillo application/vnd.cloudillo.prezillo+json CRDT (Yjs) High (14 object types, palette, templates) Documented
Calcillo application/vnd.cloudillo.calcillo+json CRDT (Yjs) Medium (cells, formulas, sheets) Documented
Ideallo application/vnd.cloudillo.ideallo+json CRDT (Yjs) Medium (9 object types, linked copies) Documented
Notillo application/vnd.cloudillo.notillo+json RTDB Low (rich text document) Planned
Quillo application/vnd.cloudillo.quillo+json CRDT (Yjs) Low (rich text editor) Planned

Common Conventions

Compact Field Names

CRDT-based apps use short field names (typically 1-3 characters) to minimize wire overhead during real-time synchronization. For example, t for type, xy for position, wh for dimensions. Each app’s format spec documents the mapping from compact names to their meanings.

ID Format

All entity IDs (objects, containers, views, styles, templates) use 72-bit entropy encoded as 12 base64url characters. IDs are generated client-side using crypto.getRandomValues() and are typed using branded types (ObjectId, ContainerId, ViewId, StyleId, RichTextId, TemplateId) for compile-time safety.

ChildRef Tuples

Several apps use a ChildRef tuple to reference children that can be either objects or containers:

type ChildRef = [0 | 1, string]  // [0, objectId] or [1, containerId]

The discriminant (0 or 1) allows a single ordered array to contain references to both types without ambiguity.

See Also