examples/live-notes Public
components: api: kind: worker description: >- The Worker. Routes /notes/:id to that note's room, serves the editor page as static assets, and reads a note's snapshots straight from R2 so history never wakes the room. owns: [src/index.ts, src/routes.ts] talks_to: - { to: note-room, via: rpc } - { to: snapshots, via: r2 } note-room: kind: durable-object description: >- One per note, picked by name. Orders every edit, keeps the note and its op log in SQLite, holds the editors' WebSockets, and copies the note to R2 every 100 versions. binding: NOTES owns: [src/note-room.ts, src/room.ts, src/snapshots.ts] talks_to: - { to: ops, via: import } - { to: snapshots, via: r2 } snapshots: kind: r2-bucket description: >- Bucket live-notes-snapshots. The note's text every 100 versions, at snapshots/<object id>/<version>.txt, kept after the op log has moved on. Written by the note's room, read by the Worker. binding: SNAPSHOTS ops: kind: library description: Insert and delete operations, their transform, and the messages on the socket. The same code runs in the room and in the browser. owns: [src/ops.ts, src/protocol.ts] client: kind: library description: The editor page and its script, compiled by tsc into public/js. owns: [client/**, public/index.html] talks_to: - { to: ops, via: import }