How streetwriters/notesnook works
High-Level Architecture Components
a. Client Applications (Frontend Layer):
• Web Client (React)
• Desktop Client (Electron)
• Mobile Client (React Native)
• Web Clipper Extension
b. Core Services Layer:
• Database Management
• Encryption Services
• Sync Engine
• Management
• Collections Management
c. Shared Components Layer:
• Editor (@notesnook/editor)
• Cryptography (@notesnook/crypto)
• Theme Engine (@notesnook/theme)
• Logging System (@notesnook/logger)
Data Flow & Integration Points
a. Client-Core Communication:
• Data encryption/decryption flow
• Synchronization
• User authentication
• Storage operations
b. Storage & Encryption:
• IndexedDB (via @notesnook/streamable-fs)
• Local encryption layer
• Remote sync storage
Key Architectural Features
a. Security Components:
• Encryption mechanisms:
• XChaCha20-Poly1305 encryption
• Argon2 key derivation
• Zero-knowledge architecture
b. Cross-Platform Integration:
• Shared components:
• Common core logic
• Unified editor experience
• Consistent theming
Important Subsystems
a. Editor System:
• Rich text editing
• Markdown support
• Attachments handling
• Real-time collaboration
b. Sync Engine:
• Components for:
• Change detection
• Conflict resolution
• Delta synchronization
• Multi-device sync
External Integrations
• Connections for:
• Web Clipper integration
• Import/Export systems
• Backup systems
• Third-party integrations
Implementation Details
Specific technologies:
• React/React Native for UI
• Electron for desktop
• IndexedDB for storage
• WebAssembly for encryption
• TypeScript/JavaScript
Security boundaries and data flow
Remember to:
• Use consistent styling
• Related components
• Clear boundaries between systems
• Security zones
• Document all major interfaces
This system design should provide a clear understanding of how Notesnook's various components interact while maintaining its core promise of privacy and security.