Appearance
Spec: Cloud Sync & Sharing
Overview
Enable saving circuit files to cloud storage, sharing circuits via links, and optionally collaborating with others. Provides cross-device access and easy sharing for educational settings.
Motivation
- Students need to share circuits with instructors for grading.
- Users want to access their designs from multiple computers.
- Instructors want to distribute template circuits to entire classes.
- Community sharing enables a library of example circuits.
- Backup protection against local data loss.
Requirements
Functional Requirements
Cloud Storage
- Cloud Save: Save circuit files to cloud storage (user's account).
- Cloud Open: Browse and open circuits from cloud storage.
- Auto-Sync: Optionally sync a local folder with cloud storage.
- Conflict Resolution: Handle simultaneous edits with merge or last-writer-wins.
- Offline Support: Work offline; sync when connection restored.
- Version History: Cloud-stored files maintain version history.
Sharing
- Share via Link: Generate a shareable URL for any circuit.
- Permission Levels: View-only, duplicate (fork), or edit permissions.
- Public/Private: Circuits can be public (anyone with link) or private (specific users).
- Embed Code: Generate HTML embed code for websites/LMS.
- QR Code: Generate QR code for easy mobile/classroom sharing.
Collaboration (Future)
- Real-Time Collaboration: Multiple users edit the same circuit simultaneously.
- Presence Indicators: See who else is viewing/editing.
- Comments: Add comments on specific components or areas.
- Change Attribution: Track who made each change.
Community
- Public Gallery: Browse community-shared circuits by category.
- Templates: Use shared circuits as starting templates.
- Ratings/Favorites: Rate and bookmark shared circuits.
Non-Functional Requirements
- Cloud operations complete in under 3 seconds on reasonable internet.
- Offline-first: app works fully without internet; sync is additive.
- Data encrypted in transit (TLS) and at rest.
- User data is private by default; sharing is opt-in.
- Storage quota: at least 100MB per free user.
Design
Architecture
DigitalWorks App
→ CloudService (abstraction layer)
→ StorageProvider (OneDrive / GitHub / Custom backend)
→ SharingService (link generation, permissions)
→ SyncEngine (local ↔ cloud reconciliation)Authentication
- Microsoft Account (OneDrive integration).
- GitHub (Gist/Repo for circuits).
- Custom backend (email/password or OAuth).
Storage Options
| Provider | Pros | Cons |
|---|---|---|
| OneDrive | Native Windows integration | Microsoft account required |
| GitHub Gists | Version control built-in | Technical barrier for students |
| Custom Backend | Full control | Hosting cost, maintenance |
| Firebase | Real-time sync | Google dependency |
Sync Strategy
1. Local file saved → compute hash
2. Compare with cloud version hash
3. If different:
a. Cloud newer → pull and merge/overwrite
b. Local newer → push to cloud
c. Both changed → conflict resolution dialog
4. Maintain sync metadata (last sync time, version IDs)Sharing Flow
User clicks "Share" → generates unique URL
→ https://digitalworks.app/circuit/{id}
→ Recipient clicks link → opens in app (or web viewer)
→ Permission check → view/fork/editImplementation Tasks
- Design cloud service abstraction layer (
ICloudStorageProvider). - Implement OneDrive/GitHub storage provider.
- Implement authentication flow (OAuth 2.0).
- Implement file upload/download with progress.
- Implement sync engine with conflict detection.
- Implement share link generation with permissions.
- Create cloud file browser UI (open/save dialog).
- Create sharing dialog (permissions, link copy, QR code).
- Implement offline queue (pending uploads).
- Create account/settings page for cloud configuration.
- Implement public gallery browser (future phase).
Risks & Open Questions
- Which cloud provider to support first? OneDrive is natural for Windows.
- How to handle very large circuits (memory components with data)?
- Should real-time collaboration be in v1 or deferred to a later phase?
- Cost model: free tier vs. paid for extra storage/collaboration?
- Privacy: what data is sent to the cloud (telemetry, usage)?
- Web viewer: do we need a read-only web version for sharing recipients without the app?
Priority
Medium-Low — Nice-to-have for education scenarios, significant infrastructure investment.