mirror of
https://github.com/zadam/trilium.git
synced 2025-11-05 21:05:55 +01:00
1.4 KiB
Vendored
1.4 KiB
Vendored
Frontend
Application Entry Point
Desktop: apps/client/src/desktop.ts Web: apps/client/src/index.ts
Service Layer
Located at: apps/client/src/services/
Key services:
froca.ts- Frontend cacheserver.ts- API communicationws.ts- WebSocket connectiontree_service.ts- Note tree managementnote_context.ts- Active note trackingprotected_session.ts- Encryption key managementlink.ts- Note linking and navigationexport.ts- Note export functionality
UI Components
Component Locations:
widgets/containers/- Layout containerswidgets/buttons/- Toolbar buttonswidgets/dialogs/- Modal dialogswidgets/ribbon_widgets/- Tab widgetswidgets/type_widgets/- Note type editors
Event System
Application Events:
// Subscribe to events
appContext.addBeforeUnloadListener(() => {
// Cleanup before page unload
})
// Trigger events
appContext.trigger('noteTreeLoaded')
Note Context Events:
// NoteContextAwareWidget automatically receives:
- noteSwitched()
- noteChanged()
- refresh()
State Management
Trilium uses custom state management rather than Redux/MobX:
note_context.ts- Active note and contextfroca.ts- Entity cache- Component local state
- URL parameters for shareable state