Cloud & Sharing
Saved files live in the cloud — accessible from any browser session with the same account. The cloud layer handles upload, download, sharing, and quota management.
Cloud Upload
When you save, the compressed file is sent to the server via a real-time WebSocket connection (Socket.IO). The server:
- Authenticates the request using the JWT token and session ID
- Validates that the upload won't exceed the user's storage quota
- Stores the compressed data in the data collection
- Creates a metadata record in the meta collection linking to the data
- Returns a success response with the file identifier
The upload is atomic — either the entire file is stored or nothing is.
Cloud Download
To load a file, the application requests the file list and then downloads a specific version:
Listing Files
The `get_files` request returns all files owned by or shared with the current user. For each file, the response includes the head metadata — title, kind, comment, tags, groups.
Downloading a Version
The `get_FileByID` request retrieves a specific version by its ID. The server fetches the data blob and returns it to the client, which decompresses and restores it to the canvas.
Sharing with Groups
Files can be shared via groups — named collections of users managed separately from files:
Creating a Group
A group has:
- Code — a short unique identifier
- Name — a human-readable group name
- Owner — the user who created and manages the group
- Members — a list of user IDs with access
Assigning Files to Groups
When saving or editing file metadata, you can assign one or more groups. All members of those groups can then list and download the file.
Per-Version Sharing
Groups can be assigned at the version level. This means:
- Version 1 might be shared with the "Engineering" group
- Version 2 might be shared with "Engineering" and "Quality"
- Each version's audience can differ
Quota Management
Each account has a storage quota limiting the total size of stored data. The quota system:
- Tracks cumulative usage across all files and versions
- Rejects uploads that would exceed the limit with a clear error
- Reports current usage and maximum so users can plan
Reducing Usage
- Delete old versions you no longer need
- Trim version history to keep only recent versions
- Delete entire files that are no longer relevant
Server-Side Storage
The backend uses MongoDB with two collections:
Meta Collection
Stores lightweight metadata for fast listing:
- File identity (ID, owner, title, kind)
- Version metadata (label, comment, tags, groups)
- A reference to the data document (`dataId`)
Data Collection
Stores the compressed file payloads:
- Binary data (ZIP archive with JSON)
- Referenced by the meta document's `dataId` field
This architecture means listing all files requires only scanning the meta collection (small documents, indexed), while downloading a file fetches one large document from the data collection.
Security
All cloud operations require authentication:
- JWT token — verified on every request
- Session ID — validates that the current session is still active
- User ID — ensures the user has permission for the requested operation
The server rejects any request with an invalid or expired token, an unknown session, or a user ID that doesn't match the authenticated identity.