Storage backends
Local filesystem
FileSystemStorage uses the browser File System Access API (showDirectoryPicker). The web editor can open a local project folder directly; it remembers the handle in IndexedDB. Browser support is strongest in Chromium-based browsers; Firefox and Safari fall back to the hosted/API workflows.
The legacy desktop app is parked and is not part of the supported web delivery path.
GitHub
GitHubStorage wraps the GitHub Contents API. Caches:
- file SHAs (to avoid 409 on write)
- file contents (per session)
- the file tree
- blob URLs (for media)
Operations: mergeTo(branch) performs a 3-way merge via the GitHub compare/merge API. compareBranches(base, head) returns ahead/behind counts. clearCache() is called on branch switch.
API / multi-tenant
ApiStorage talks to /api/projects/:id/files* on api.app.magicms.cloud. The API enforces project membership, roles and allowed paths, and uses the project's GitHub credential server-side. No GitHub PAT is sent to the browser for multi-tenant projects.