docs/Developer Guide/Developer Guide/Concepts/Entities.md
Trilium's data model is based on five core entities:
graph TD
Note[Note
BNote]
Branch[Branch
BBranch]
Attribute[Attribute
BAttribute]
Revision[Revision
BRevision]
Attachment[Attachment
BAttachment]
Note -->|linked by| Branch
Note -.->|metadata| Attribute
Branch -->|creates| Revision
Note -->|has| Attachment
style Note fill:#e1f5ff
style Branch fill:#fff4e1
style Attribute fill:#ffe1f5
style Revision fill:#f5ffe1
style Attachment fill:#ffe1e1
1. BNote (apps/server/src/becca/entities/bnote.ts)
2. BBranch (apps/server/src/becca/entities/bbranch.ts)
3. BAttribute (apps/server/src/becca/entities/battribute.ts)
4. BRevision (apps/server/src/becca/entities/brevision.ts)
5. BAttachment (apps/server/src/becca/entities/battachment.ts)
6. BBlob (apps/server/src/becca/entities/bblob.ts)
The frontend uses a widget system for modular, reusable UI components.
Located at: apps/client/src/widgets/
// Widget Hierarchy
BasicWidget
├── NoteContextAwareWidget (responds to note changes)
│ ├── RightPanelWidget (displayed in right sidebar)
│ └── Type-specific widgets
├── Container widgets (tabs, ribbons, etc.)
└── Specialized widgets (search, calendar, etc.)
Base Classes:
basic_widget.ts)
note_context_aware_widget.ts)
Type-Specific Widgets:
Each note type has a dedicated widget, which are located in apps/client/src/widgets/type_widgets.