Skip to content

Add a generic realtime collaboration service for web apps based on Yjs #2542

@mschneider82

Description

@mschneider82

OpenCloud currently provides collaboration capabilities primarily for WOPI-based document servers such as Collabora, ONLYOFFICE, or Microsoft integrations. This works well for office-style document editing, but it does not offer a reusable realtime collaboration layer for custom OpenCloud web apps.

I would like to propose a generic realtime collaboration feature in OpenCloud that web apps can use directly for shared state synchronization, presence, and multi-user editing. A good technical foundation for this would be Yjs, since it is widely used for CRDT-based collaborative editing and works well for arbitrary app data models such as whiteboards, notes, markdown editors, task boards, calendars, or other structured JSON-like state.

Problem
Today, each custom web app that wants realtime collaboration would need to implement its own synchronization backend, authentication flow, room management, and permission checks. This creates duplicated effort and makes it harder to build reusable collaborative apps on top of OpenCloud.

There is currently no common platform-level API that allows a web app to say, in effect: “open a shared collaborative document for this OpenCloud resource and synchronize it securely with other users.”

Proposal
Introduce a generic realtime collaboration service in OpenCloud that can be consumed by any web app.

Suggested scope:

A backend realtime service, for example realtime or sharedstate, integrated into OpenCloud.
WebSocket-based shared document synchronization using Yjs.
Presence / awareness support, such as active users, cursors, selections, or editing state.
Authentication based on the existing OpenCloud session or short-lived access tokens issued by OpenCloud.
Authorization checks against OpenCloud resources and shares before joining a collaborative room.

Example use cases
Whiteboard or drawing apps.
Markdown / note-taking editors.
Knowledge base or wiki-style apps.
Calendar or planning apps with shared editing.
Custom JSON/state-based web apps embedded in OpenCloud.

+-------------------------------------------------------------+
|                         OpenCloud                           |
|                                                             |
|  +-------------------+        +--------------------------+  |
|  |  Web UI / Shell   |        |   Backend Services       |  |
|  |                   |        |                          |  |
|  |  loads web apps   |        |  Graph / Auth / Shares   |  |
|  |  provides session |        |  Files / Spaces / ACLs   |  |
|  +---------+---------+        +-------------+------------+  |
|            |                                  ^             |
|            | session / context                | ACL check   |
|            v                                  |             |
|  +-------------------+        join token      |             |
|  |   Custom Web App  |------------------------+             |
|  | (Excalidraw etc.) |                                      |
|  |                   |                                      |
|  |  Y.Doc            |                                      |
|  |  Awareness        |                                      |
|  |  App bindings     |                                      |
|  +---------+---------+                                      |
|            | websocket / shared updates                     |
+------------|------------------------------------------------+
             |
             v
   +-----------------------------+
   |   Realtime Service (new)    |
   |-----------------------------|
   |  Yjs room handling          |
   |  Presence / awareness       |
   |  Auth validation            |
   |  Permission enforcement     |
   |  Optional snapshot hooks    |
   +-------------+---------------+
                 |
                 | load / save snapshot
                 v
   +-----------------------------+
   |   OpenCloud Resource        |
   |-----------------------------|
   |  File / App object / Space  |
   |  JSON / Markdown / Canvas   |
   +-----------------------------+

opencloud-eu/web-extensions#308
mschneider82/opencloud-excalidraw#1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions