How zadam/trilium works
Main Components
A. Frontend Layer:
• Desktop Application (Electron-based)
• Web Application
• Mobile Frontend
• Key components in src/public/app:
• Widgets (note editing, tree view, etc.)
• Services (search, sync, etc.)
• Components (app context, tab management)
B. Backend Layer:
• Core Services (src/services):
• Management
• Search Engine
• Encryption Services
• Synchronization
• Authentication
• ETAPI (REST API)
C. Data Layer:
• SQLite Database
• File Storage (for attachments/blobs)
• Migration System
• Client Layer |
• Desktop | | Web | | Mobile | | Web Clipper | |
• Application | | Interface | | Interface | | | |
• Application Layer |
• Note Editor | | Tree Manager | | Search Engine | | Attribute System | |
• (CKEditor) | | (FancyTree) | | | | | |
• Encryption | | Sync | | Scripts | | Share System | |
• System | | Service | | Engine | | | |
• Data Layer |
• SQLite | | Blobs | | Revisions | |
• Database | | Storage | | Storage | |
Key Interactions to Highlight
• Bidirectional sync between clients and server
• Encryption flow for protected notes
• Search request flow
• Revision history system
• ETAPI interactions
• File attachment handling
Technical Details to Note
• Built on Node.js
• Uses Electron for desktop
• CKEditor for WYSIWYG
• CodeMirror for code editing
• WebSocket for real-time updates
• SQLite for data storage