webstudio-is / webstudio

Open Source alternative to Webflow, check out our CMS launch https://webstudio.is/cms
https://webstudio.is
GNU Affero General Public License v3.0
4.08k stars 394 forks source link

Explore realtime collaboration #46

Open kof opened 2 years ago

kof commented 2 years ago

There is a lot of things to consider when building a realtime multiplayer UI, here are a few:

  1. DX and State management
    • We are building on top of immer, using immerhin as a Developer facing interface for transactions. This interface results in JSON patches, after that we can decide where to go considering all other aspects.
  2. Server architecture
    • How will this work with cloudflare workers type of env and a single container env?
  3. Database
    • Can we do that on top of SQLite?
    • RxDB?
  4. Conflicts resolution
  5. Change types:
    • Ephemeral (not important - can be dropped, doesn't need permanent storage)
    • transactional (atomic, very important, has context, needs permanent storage, e.g.: color: was changed to red)
    • blob (non-atomic, e.g. text has changed, no idea what part)
  6. Offline-first

Other links

TrySound commented 1 year ago

Lexical supports yjs CRDT implementation out of the box. We can consider it when start building collaboration.

https://github.com/yjs/yjs https://lexical.dev/docs/collaboration/react