MC Modeler works entirely offline using IndexedDB when no Supabase project is connected. Setting the two environment variables below activates cloud mode: authentication, persistent diagrams, collaboration, and the image library all become available without any code changes.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.
Without
VITE_SUPABASE_URL and VITE_SUPABASE_ANON_KEY, MC Modeler runs in local-only mode (IndexedDB, no auth). Diagrams exist only in that browser and are not shared or backed up. Configure the variables below to switch to cloud mode.1. Create a Supabase Project
- Go to supabase.com and sign in.
- Click New project, choose an organization, name the project (e.g.
mc-modeler), set a database password, and pick the region closest to your users. - Wait for the project to finish provisioning (about 30 seconds).
2. Get Your Project Credentials
In the Supabase dashboard, go to Settings → API:- Project URL — looks like
https://<ref>.supabase.co - Project API keys →
anon/public— the public anonymous key
3. Set Environment Variables
The Supabase client insrc/lib/supabase.ts reads exactly these two variable names:
4. Run Database Migrations
Thesupabase/migrations/ directory contains 18 migrations that must be applied in order. Use the Supabase CLI (supabase db push) or run each file manually in the SQL Editor inside the dashboard.
| # | File | What it creates |
|---|---|---|
| 01 | 0001_init.sql | Core schema: profiles, folders, diagrams, diagram_collaborators, diagram_invites, yjs_documents; RLS; thumbnails storage bucket |
| 02 | 0002_harden_functions.sql | Hardens security-definer helper functions |
| 03 | 0003_move_helpers_to_private_schema.sql | Moves RLS helpers to private schema |
| 04 | 0004_redeem_invite_rpc.sql | redeem_invite RPC for accepting collaboration invites |
| 05 | 0005_yjs_state_as_text.sql | Changes Yjs document state column to text |
| 06 | 0006_add_subprocess_columns.sql | Adds parent_diagram_id and sub_process_element_id columns |
| 07 | 0007_projects_collaboration.sql | projects table, project collaborators, project invites |
| 08 | 0008_comment_delete_policies.sql | Comment delete RLS policies |
| 09 | 0009_notifications.sql | notifications outbox table and delivery infrastructure |
| 10 | 0010_collaborator_visibility.sql | Lets collaborators see each other’s profiles |
| 11 | 0011_mention_thread_deeplink.sql | Deep-link data for comment-mention notifications |
| 12 | 0012_notification_inbox.sql | In-app notification inbox table |
| 13 | 0013_notification_prefs.sql | Per-user notification preferences (email_enabled, invite_events, mention_events) |
| 14 | 0014_notification_digest.sql | Notification digest / batching logic |
| 15 | 0015_readonly_comment_access.sql | Read-only access to comments for viewer collaborators |
| 16 | 0016_image_library.sql | image_folders and images tables; diagram-images storage bucket |
| 17 | 0017_image_library_realtime.sql | Enables Supabase Realtime for images and image_folders |
| 18 | 0018_drop_yjs_tables.sql | Removes the yjs_documents table (superseded) |
5. Create Storage Buckets
The migrations create both buckets automatically via SQL, but if you prefer to create them manually through the dashboard, go to Storage → New bucket:| Bucket name | Visibility | Purpose |
|---|---|---|
thumbnails | Private | Diagram thumbnail images (<diagram_id>/thumb.png) — created in migration 0001 |
diagram-images | Private | Image library files (<scopeId>/imglib/<uuid>.<ext>) — created in migration 0016 |
6. Enable Realtime for the Image Library
Migration0017_image_library_realtime.sql adds the images and image_folders tables to the supabase_realtime publication. If you applied all migrations via supabase db push this is already done. To verify manually:
- In the Supabase dashboard go to Database → Replication.
- Confirm that
imagesandimage_foldersappear under thesupabase_realtimepublication. - Both tables should have Replica Identity set to
FULL(also applied by migration0017).
7. Configure Authentication
In the Supabase dashboard, go to Authentication → Providers:Email (Magic Link) — recommended
Enable the Email provider. MC Modeler uses magic links (passwordless): users enter their email and receive a sign-in link. No extra configuration is needed beyond enabling the provider.Google OAuth — optional
- Enable the Google provider.
- Create OAuth credentials in the Google Cloud Console (Credentials → Create credentials → OAuth client ID, type Web application).
- Add your Supabase callback URL (
https://<ref>.supabase.co/auth/v1/callback) as an authorized redirect URI. - Paste the Client ID and Client Secret into the Supabase Google provider settings.
public.profiles automatically via the on_auth_user_created trigger installed by migration 0001.
8. Build and Deploy
dist/ to any static host (Vercel, Netlify, Cloudflare Pages, etc.). Make sure your hosting provider has the two environment variables set as described in Step 3.
Verifying the Connection
After deploying (or runningnpm run dev):
- Sign in — open the app and use the email magic link or Google button. If the sign-in screen appears, Supabase is reachable.
- Create a diagram — click New diagram, give it a name, add a few elements.
- Save — press Ctrl+S (or ⌘+S on Mac). The status bar should show “Saved”.
- Reload the page — the diagram should reappear. If it does, data is persisting to Supabase.
- Check the database — in the Supabase dashboard, go to Table Editor → diagrams and confirm a row exists for the diagram you just created.