/electric-notes

Multi-user notes taking web app

Primary LanguageTypeScriptMIT LicenseMIT

Electric Notes

Electric Notes is a collaborative note-taking application that demonstrates the power of combining ElectricSQL, Yjs, and Postgres for real-time collaborative editing.

Features

  • 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

Technology Stack

  • 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

Database Schema

The application uses two main tables:

  • notes - Stores note metadata

    • id
    • title
    • created_at
  • notes_operations - Stores Yjs operations for collaborative editing

Implementation Details

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.

Contributing

Feel free to contribute to this project!

License

MIT License - see LICENSE for details