A proof-of-concept implementation of a tree-based CRDT algorithm with local SQLite database and PartyKit-based backend. Each thoughtspace gets its own room and Turso SQLite database. Real-time collaboration is powered by WebSocket connections through PartyKit, with full history synchronization via HTTP streaming.
- Tree-based CRDT algorithm for conflict-free collaborative editing
- Local SQLite database for offline-first capabilities
- Real-time collaboration via PartyKit WebSocket connections
- Dedicated sync server for initial state replication with Postgres
COPYstreams - Full history synchronization through HTTP streaming
- Separate room and
Turso SQLite DBdedicated Postgres tables for each thoughtspace - Foreground sync with all capabilities until local client is fully hydrated
To start the development environment:
yarn devThis will open two terminal tabs:
- Client development server
- PartyKit development server
- Sync development server
You can also run them separately:
# Run the client development server
yarn client:dev
# Run the PartyKit server
yarn partykit:dev
# Run the sync server
yarn server:dev# Build the client
yarn client:build
# Deploy to PartyKit
yarn deploy
# Seed the database
yarn seedsrc/shared- Shared code between client and serversrc/party/server.ts- PartyKit server implementationsrc/sync-server/server.ts- Sync server implementationsrc/app- Client-side React applicationsrc/app/worker- Web Workers for database operations
For more information about PartyKit, visit the PartyKit documentation.