Understand the Cloudflare Livestore architecture
mainThe Cloudflare Livestore implementation is split into two main runtimes: the Livestore Runtime (handling data synchronization and persistence) and the SvelteKit Runtime (handling the UI).
Livestore Runtime Components
worker.ts: The client-side worker responsible for syncing data to and from the server.server.ts: The server-side Cloudflare worker that manages data synchronization and WebSocket connections.events.ts: Definitions for the events used within the livestore.tables.ts: SQLite table definitions.queries.ts: SQLite query definitions.materializers.ts: Event-sourced materializers for the livestore.
SvelteKit Runtime Components
src/app/routes/index.svelte: The main entry point for the SvelteKit application UI.