@@ -53,30 +53,30 @@ Trilium Notes is a hierarchical note-taking application built as a TypeScript mo
5353
5454Trilium follows a ** client-server architecture** even in desktop mode, where Electron runs both the backend server and frontend client within the same process.
5555
56- ```
57- ┌─────────────────────────────────────────────────────────────┐
58- │ Frontend │
59- │ ┌────────────┐ ┌────────────┐ ┌────────────┐ │
60- │ │ Widgets │ │ Froca │ │ UI │ │
61- │ │ System │ │ Cache │ │ Services │ │
62- │ └────────────┘ └────────────┘ └────────────┘ │
63- │ │ │
64- │ WebSocket / REST API │
65- │ │ │
66- └─────────────────────────┼────────────────────────────────────┘
67- │
68- ┌─────────────────────────┼────────────────────────────────────┐
69- │ Backend Server │
70- │ ┌────────────┐ ┌────────────┐ ┌────────────┐ │
71- │ │ Express │ │ Becca │ │ Script │ │
72- │ │ Routes │ │ Cache │ │ Engine │ │
73- │ └────────────┘ └────────────┘ └────────────┘ │
74- │ │ │
75- │ ┌────┴─────┐ │
76- │ │ SQLite │ │
77- │ │ Database │ │
78- │ └──────────┘ │
79- └─────────────────────────────────────────────────────────────┘
56+ ``` mermaid
57+ graph TB
58+ subgraph Frontend
59+ Widgets[Widgets<br/>System]
60+ Froca[Froca<br/>Cache]
61+ UIServices[UI<br/> Services]
62+ end
63+
64+ subgraph Backend["Backend Server"]
65+ Express[Express<br/>Routes]
66+ Becca[Becca<br/>Cache]
67+ ScriptEngine[Script<br/>Engine]
68+ Database[(SQLite<br/>Database)]
69+ end
70+
71+ Widgets -.-> API[WebSocket / REST API]
72+ Froca -.-> API
73+ UIServices -.-> API
74+ API -.-> Express
75+ API -.-> Becca
76+ API -.-> ScriptEngine
77+ Becca --> Database
78+ Express --> Database
79+ ScriptEngine --> Database
8080```
8181
8282### Deployment Modes
@@ -225,30 +225,24 @@ Located at: `apps/server/src/share/`
225225
226226Trilium's data model is based on five core entities:
227227
228- ```
229- ┌──────────────────────────────────────────────────────────┐
230- │ Note Tree │
231- │ │
232- │ ┌─────────┐ │
233- │ │ Note │ │
234- │ │ (BNote) │ │
235- │ └────┬────┘ │
236- │ │ │
237- │ │ linked by │
238- │ ▼ │
239- │ ┌──────────┐ ┌─────────────┐ │
240- │ │ Branch │◄────────│ Attribute │ │
241- │ │(BBranch) │ │ (BAttribute)│ │
242- │ └──────────┘ └─────────────┘ │
243- │ │ │
244- │ │ creates │
245- │ ▼ │
246- │ ┌──────────┐ ┌─────────────┐ │
247- │ │ Revision │ │ Attachment │ │
248- │ │(BRevision│ │(BAttachment)│ │
249- │ └──────────┘ └─────────────┘ │
250- │ │
251- └──────────────────────────────────────────────────────────┘
228+ ``` mermaid
229+ graph TD
230+ Note[Note<br/>BNote]
231+ Branch[Branch<br/>BBranch]
232+ Attribute[Attribute<br/>BAttribute]
233+ Revision[Revision<br/>BRevision]
234+ Attachment[Attachment<br/>BAttachment]
235+
236+ Note -->|linked by| Branch
237+ Note -.->|metadata| Attribute
238+ Branch -->|creates| Revision
239+ Note -->|has| Attachment
240+
241+ style Note fill:#e1f5ff
242+ style Branch fill:#fff4e1
243+ style Attribute fill:#ffe1f5
244+ style Revision fill:#f5ffe1
245+ style Attachment fill:#ffe1e1
252246```
253247
254248#### Entity Definitions
@@ -514,18 +508,29 @@ Key services:
514508### UI Components
515509
516510** Main Layout:**
517- ```
518- ┌──────────────────────────────────────────────────────┐
519- │ Title Bar │
520- ├──────────┬────────────────────────┬──────────────────┤
521- │ │ │ │
522- │ Note │ Note Detail │ Right Panel │
523- │ Tree │ Editor │ (Info, Links) │
524- │ │ │ │
525- │ │ │ │
526- ├──────────┴────────────────────────┴──────────────────┤
527- │ Status Bar │
528- └──────────────────────────────────────────────────────┘
511+
512+ ``` mermaid
513+ graph TD
514+ subgraph TriliumUI[" "]
515+ TitleBar[Title Bar]
516+
517+ subgraph MainArea[" "]
518+ NoteTree[Note Tree]
519+ NoteDetail[Note Detail<br/>Editor]
520+ RightPanel[Right Panel<br/>Info, Links]
521+ end
522+
523+ StatusBar[Status Bar]
524+ end
525+
526+ TitleBar -.-> MainArea
527+ MainArea -.-> StatusBar
528+
529+ style TitleBar fill:#e1f5ff
530+ style NoteTree fill:#fff4e1
531+ style NoteDetail fill:#f5ffe1
532+ style RightPanel fill:#ffe1f5
533+ style StatusBar fill:#e1f5ff
529534```
530535
531536** Component Locations:**
0 commit comments