Skip to content

Comments

Feature/files and encryption#25

Open
Aldorax wants to merge 14 commits intomainfrom
feature/files-and-encryption
Open

Feature/files and encryption#25
Aldorax wants to merge 14 commits intomainfrom
feature/files-and-encryption

Conversation

@Aldorax
Copy link
Contributor

@Aldorax Aldorax commented Dec 15, 2025

🔐 Overview

This PR adds file upload capabilities and end-to-end encryption features, enabling users to securely upload, manage, and encrypt their files.

✨ Features Added

Encryption Service

  • XChaCha20-Poly1305: Industry-standard encryption algorithm
  • Key Derivation: Automatic key generation from user identity
  • Encrypt/Decrypt: Methods for content encryption
  • Key Management: Export and import encryption keys
  • Secure Storage: Keys stored securely in localStorage
  • Backup & Restore: Export keys for backup, import to restore

Encryption Status Indicator

  • Visual Feedback: Shows encryption status in UI
  • Key Export: Download encryption keys as JSON
  • Key Import: Upload and restore encryption keys
  • Status Display: Clear indication of encryption state
  • User-Friendly: Simple interface for key management

File Upload Service

  • Storacha Integration: Upload files to IPFS via Storacha
  • File Validation: Max 100MB file size limit
  • Image Compression: Automatic compression for images
  • Thumbnail Generation: Create thumbnails for images
  • Progress Tracking: Real-time upload progress
  • File Icons: Automatic icon selection based on file type

File Upload Component

  • Drag & Drop: Intuitive drag-and-drop interface
  • Click to Upload: Traditional file picker support
  • Progress Bar: Visual upload progress
  • Multiple Files: Upload multiple files at once
  • File Preview: Preview images before upload

Files Page (/files)

  • Dedicated Route: Full-page file management interface
  • File Grid: Beautiful grid view of uploaded files
  • File Actions: View, copy link, and delete files
  • File Metadata: Display file size and upload date
  • Thumbnails: Show image thumbnails
  • Empty State: Helpful message when no files uploaded

Navigation Integration

  • Sidebar Links: Added Files and Templates to sidebar
  • Consistent Icons: Professional SVG icons
  • Active States: Highlight active page
  • Keyboard Shortcuts: Cmd+U for Files, Cmd+T for Templates

🎯 User Benefits

  • Secure Storage: End-to-end encryption for sensitive content
  • File Management: Centralized file upload and management
  • Easy Sharing: Copy file links to share
  • Data Portability: Export/import encryption keys
  • IPFS Benefits: Decentralized, permanent file storage

🔧 Technical Details

Dependencies Added

  • @noble/ciphers - Encryption library

Files Changed

  • package.json - Added encryption dependency
  • src/lib/services/encryption.ts - Encryption service
  • src/lib/services/file-upload.ts - File upload service
  • src/lib/components/EncryptionStatusIndicator.svelte - Encryption UI
  • src/lib/components/FileUpload.svelte - File upload component
  • src/routes/files/+page.svelte - Files page route
  • src/lib/components/sidebar/Sidebar.svelte - Navigation updates

Commits

  1. feat: add encryption dependency - Add @noble/ciphers
  2. feat: add encryption service - Core encryption functionality
  3. feat: add encryption status indicator - Encryption UI component
  4. feat: add file upload service and component - File upload functionality
  5. feat: add files upload page - Dedicated files route
  6. feat: add Files and Templates to sidebar navigation - Navigation integration

🔒 Security Considerations

  • Client-Side Encryption: All encryption happens in the browser
  • Key Derivation: Keys derived from user identity using secure methods
  • No Key Transmission: Keys never leave the user's device
  • Backup Responsibility: Users responsible for backing up keys
  • Clear Warnings: UI warns users about key management

🧪 Testing

  • File upload works correctly
  • Encryption/decryption functions properly
  • Key export/import works
  • File management actions work (view, copy, delete)
  • Progress tracking displays correctly
  • Image compression and thumbnails work
  • Sidebar navigation works
  • Keyboard shortcuts function

🔗 Related

  • Integrates with Storacha client for IPFS uploads
  • Uses notification service for user feedback
  • Follows existing design system with CSS variables

⚠️ Important Notes

  • Users must export and securely store their encryption keys
  • Lost keys cannot be recovered
  • Files uploaded to IPFS are permanent and public (unless encrypted)

Ready for Review

…l for displaying all shortcuts\n- Add SlashCommandMenu for quick block insertion\n- Add WorkspaceSidebar for page navigation\n- Add IconPicker for page icon selection\n- Implement keyboard shortcuts service
… to app layout\n- Register global navigation shortcuts (Cmd+T, Cmd+U, Cmd+D)\n- Add shortcuts modal accessible via Shift+?\n- Make shortcuts work across all pages
… with localStorage\n- Add 7 built-in templates (Blank, Meeting Notes, Daily Journal, etc.)\n- Support for custom templates\n- Template CRUD operations
…emplates\n- Add search and filter functionality\n- Categorized template display\n- Template preview cards with icons
…owse all available templates\n- Search and category filtering\n- One-click page creation from templates\n- Matches app color scheme
…ncryption\n- Update package.json and lock file
…tion\n- Key derivation from user identity\n- Encrypt/decrypt content methods\n- Key export/import for backup\n- Secure key management with localStorage
…in UI\n- Export/import encryption keys\n- Visual feedback for encryption state\n- Key management interface
…d to Storacha\n- Image compression and thumbnail generation\n- File size validation (max 100MB)\n- Drag-and-drop support\n- Upload progress tracking
…e upload interface with drag-and-drop\n- File management (view, copy link, delete)\n- Grid view with file metadata\n- Matches app color scheme
…s link to sidebar\n- Add Files link to sidebar\n- Update navigation icons\n- Integrate with existing sidebar design
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant