Vuer-RTC
CRDT-based real-time collaborative data structures for building multiplayer applications.
Conflict-Free
Operations merge automatically without conflicts. LWW for absolute values, additive for deltas.
Journal-Based
Append-only journal with periodic snapshots. Enables undo, replay, recovery, and audit trails.
Graph State
Current computed state. Fast to read, but rebuilt from journal on restart.
Scene Graph
Hierarchical node structure for building complex 3D scenes with parent-child relationships.
Quick Example
import { createEmptyGraph, applyMessage } from '@vuer-ai/vuer-rtc';
// Create initial state
let graph = createEmptyGraph();
// Apply operations from any client
graph = applyMessage(graph, {
id: 'msg-1',
sessionId: 'alice',
clock: { alice: 1 },
lamportTime: 1,
timestamp: Date.now(),
ops: [
{ otype: 'node.insert', key: 'cube-1', path: 'cube-1',
value: { key: 'uuid', tag: 'Mesh', name: 'Cube' } },
{ otype: 'vector3.set', key: 'cube-1', path: 'position', value: [0, 1, 0] },
],
});