MC Modeler supports real-time multi-user editing on every BPMN diagram. When a Supabase backend is configured, any number of collaborators can edit the same diagram simultaneously — changes propagate in milliseconds and conflicts are resolved automatically via a CRDT. Without Supabase, the app runs in local-only mode and none of the collaboration features described in this section are available.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Aston2710/mc-modeler/llms.txt
Use this file to discover all available pages before exploring further.
Collaboration requires a configured Supabase project. See the Supabase Setup guide to connect your backend before inviting collaborators.
Local-only mode vs. collaborative mode
| Capability | Local-only | With Supabase |
|---|---|---|
| Create and edit diagrams | ✅ | ✅ |
| Autosave to browser storage | ✅ | ✅ |
| Real-time co-editing | ❌ | ✅ |
| Presence avatars and cursors | ❌ | ✅ |
| Comments and @mentions | ❌ | ✅ |
| Shareable invite links | ❌ | ✅ |
| Role-based access control | ❌ | ✅ |
isSupabaseConfigured flag is false and canEdit() always returns true — there are no permission checks to enforce.
Role system
Every collaborator on a diagram holds one of three roles. Roles are stored in thediagram_collaborators table and enforced by Supabase Row Level Security (RLS) on every query.
| Role | Permissions |
|---|---|
| owner | Full control — edit, share, delete, manage collaborators |
| editor | Edit the diagram, add and reply to comments |
| viewer | Read-only — view the diagram, add and reply to comments |
Diagram roles vs. project roles
Roles can be granted at two levels:- Diagram level — stored in
diagram_collaborators, applies to one diagram. - Project level — stored in
project_collaborators, applies to every diagram in the project.
viewer < editor < owner.
useCollabStore:
The collaboration channel
Each open diagram joins a single Supabase Realtime channel nameddiagram:{diagramId}. The CollabChannel class manages the lifecycle of this channel.
Presence sync
Each participant tracks theirParticipantMeta (userId, name, color) in the presence slot. When any participant joins or leaves, a presence sync event fires and the onPresence handler updates the list of participants shown in Presence Avatars.
Cursor broadcast
Cursor positions are sent asbroadcast events (not presence) for lower latency. Coordinates are expressed in diagram space (not screen pixels) so they remain accurate regardless of each user’s zoom level or viewport position.
Yjs CRDT update broadcast
All structural edits to the diagram are encoded as Yjs binary updates and broadcast to peers as base64 strings. TheYjsBpmnBinding class maintains a bidirectional binding between the bpmn-js canvas and a Y.Doc:
- Local → Y: on
commandStack.changed, diffs the current canvas snapshots against the last known state and writes changes intoY.Map('elements'). - Y → Local: observes
Y.Map('elements'); applies incoming remote changes to the canvas via the bpmn-js modeling API while suppressing re-emission.
BROADCAST_COALESCE_MS = 150).
Anti-entropy
Because Supabase Realtimebroadcast is fire-and-forget, a single dropped message would cause permanent divergence for that session. Every 20 seconds (ANTIENTROPY_INTERVAL_MS = 20000) each client:
- Publishes its own Yjs state vector (
yjs-svevent). - Any peer that receives the vector responds with the exact diff it has that the sender lacks (
diffForPeer).
Optimistic concurrency control
Saving a diagram uses compare-and-swap (CAS): the save request includesexpectedUpdatedAt (the timestamp of the version the client last loaded). If another user saved in between, the server detects the mismatch and throws a DiagramConflictError. The conflict dialog then lets the user choose between loading the server version or saving a duplicate copy.
Authentication
MC Modeler uses Supabase Auth for identity. Two sign-in methods are supported:- Magic link (email) — sends a one-time sign-in link to the user’s inbox.
- Google OAuth — one-click sign-in via a Google account.
id is used as the userId in ParticipantMeta, as the presence key in the Realtime channel, and as the subject of all RLS policies.
Sharing & Access Control
Invite collaborators, manage roles, and generate shareable links.
Comments & Mentions
Threaded comments anchored to diagram elements with @mention notifications.
Presence & Live Cursors
See who’s online and watch their cursors move in real time.