Electric Notes is a collaborative note-taking application that demonstrates the power of combining ElectricSQL, Yjs, and Postgres for real-time collaborative editing.
- Real-time collaborative note editing
- Uses Postgres to store yjs documents so scalable to millions of documents
- Uses Electric's scalable sync capabilities for millions of concurrent users
- Battle-tested conflict resolution through Yjs
- ElectricSQL - Provides real-time sync and data consistency
- Yjs - Powers collaborative editing functionality
- PostgreSQL - Database backend for reliable storage and querying
- React - Frontend framework
- TypeScript - Programming language
The application uses two main tables:
-
notes
- Stores note metadata- id
- title
- created_at
-
notes_operations
- Stores Yjs operations for collaborative editing
The project implements a custom Yjs provider similar to y-websocket in src/y-electric/index.ts
. This provider syncs Yjs operations using ElectricSQL's ShapeStream
class from the Electric TypeScript client.
Feel free to contribute to this project!
MIT License - see LICENSE for details