# nextcloud/bookmarks architecture

> Architecture diagram of the GitHub repository nextcloud/bookmarks, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nextcloud/bookmarks
- Repository: https://github.com/nextcloud/bookmarks

## Overview

Nextcloud Bookmarks lets users create, organize, search, share, import, and export a synchronized bookmark collection. The main path is the web interface or a REST client calling Nextcloud controllers, which enforce permissions and use bookmark/folder services; persistence is represented by the database entities and mappers. Separate registered capabilities provide search, dashboard widgets, references, activity, and context-chat integration. The README documents backups, RSS, and archived-link features; their paths are present, but their wiring is not fully shown in the sampled source.

Main entry points: [`lib/AppInfo/Application.php`](https://github.com/nextcloud/bookmarks/blob/master/lib/AppInfo/Application.php) (App registration), [`lib/Controller/BookmarkController.php`](https://github.com/nextcloud/bookmarks/blob/master/lib/Controller/BookmarkController.php) (Bookmark API), [`src/main.js`](https://github.com/nextcloud/bookmarks/blob/master/src/main.js) (Vue app and state), [`src/App.vue`](https://github.com/nextcloud/bookmarks/blob/master/src/App.vue) (Bookmarks UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["User interfaces"]
  node_web["Bookmarks UI<br/>[App.vue]"]
  node_frontend["Vue app and state<br/>[main.js]"]
end

subgraph group_api["Request and domain"]
  node_webview["Web views"]
  node_bookmark_api["Bookmark API"]
  node_folder_api["Folder and sharing API"]
  node_query["Search filters"]
  node_bookmark_service["Bookmark operations"]
  node_folder_service["Folder operations<br/>[FolderService.php]"]
  node_import_export["Import and export<br/>[HtmlImporter.php]"]
end

subgraph group_data["Collection data"]
  node_bookmark_data[("Bookmark records<br/>[BookmarkMapper.php]")]
  node_folder_data[("Folder and tree records<br/>[FolderMapper.php]")]
  node_tree_cache[("Tree cache")]
end

subgraph group_capabilities["Nextcloud capabilities"]
  node_search["Full-text search<br/>[Provider.php]"]
  node_dashboard["Recent and frequent<br/>[Recent.php]"]
  node_reference["Bookmark references"]
  node_activity["Activity publishing"]
  node_context["Context chat"]
  node_registration["App registration<br/>[Application.php]"]
end

subgraph group_maintenance["Background services"]
  node_backup["Collection backups<br/>[BackupManager.php]"]
  node_rss["RSS collections"]
end

node_user(("Bookmark user"))
node_clients(("Sync clients"))

node_user -->|"uses"| node_web
node_clients -->|"REST requests"| node_bookmark_api
node_web -->|"renders"| node_frontend
node_frontend -->|"loads views"| node_webview
node_frontend -->|"REST requests"| node_bookmark_api
node_frontend -->|"REST requests"| node_folder_api
node_bookmark_api -->|"operates on"| node_bookmark_service
node_bookmark_api -->|"builds filters"| node_query
node_bookmark_api -->|"imports"| node_import_export
node_bookmark_service -->|"persists bookmarks"| node_bookmark_data
node_folder_api -->|"operates on"| node_folder_service
node_folder_service -->|"persists folders"| node_folder_data
node_registration -->|"registers"| node_search
node_registration -->|"registers"| node_dashboard
node_registration -->|"registers"| node_reference
node_registration -->|"registers"| node_activity
node_registration -->|"registers"| node_context
node_registration -->|"registers listeners"| node_tree_cache
node_registration -->|"registers views"| node_rss

click node_web "https://github.com/nextcloud/bookmarks/blob/master/src/App.vue"
click node_frontend "https://github.com/nextcloud/bookmarks/blob/master/src/main.js"
click node_webview "https://github.com/nextcloud/bookmarks/blob/master/lib/Controller/WebViewController.php"
click node_bookmark_api "https://github.com/nextcloud/bookmarks/blob/master/lib/Controller/BookmarkController.php"
click node_folder_api "https://github.com/nextcloud/bookmarks/blob/master/lib/Controller/FoldersController.php"
click node_query "https://github.com/nextcloud/bookmarks/blob/master/lib/QueryParameters.php"
click node_bookmark_service "https://github.com/nextcloud/bookmarks/blob/master/lib/Service/BookmarkService.php"
click node_folder_service "https://github.com/nextcloud/bookmarks/blob/master/lib/Service/FolderService.php"
click node_import_export "https://github.com/nextcloud/bookmarks/blob/master/lib/Service/HtmlImporter.php"
click node_search "https://github.com/nextcloud/bookmarks/blob/master/lib/Search/Provider.php"
click node_dashboard "https://github.com/nextcloud/bookmarks/blob/master/lib/Dashboard/Recent.php"
click node_reference "https://github.com/nextcloud/bookmarks/blob/master/lib/Reference/BookmarkReferenceProvider.php"
click node_activity "https://github.com/nextcloud/bookmarks/blob/master/lib/Activity/ActivityPublisher.php"
click node_context "https://github.com/nextcloud/bookmarks/blob/master/lib/ContextChat/ContextChatProvider.php"
click node_bookmark_data "https://github.com/nextcloud/bookmarks/blob/master/lib/Db/BookmarkMapper.php"
click node_folder_data "https://github.com/nextcloud/bookmarks/blob/master/lib/Db/FolderMapper.php"
click node_tree_cache "https://github.com/nextcloud/bookmarks/blob/master/lib/Service/TreeCacheManager.php"
click node_backup "https://github.com/nextcloud/bookmarks/blob/master/lib/Service/BackupManager.php"
click node_rss "https://github.com/nextcloud/bookmarks/blob/master/lib/Controller/WebViewController.php"
click node_registration "https://github.com/nextcloud/bookmarks/blob/master/lib/AppInfo/Application.php"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_web,node_frontend,node_user,node_clients toneBlue
class node_webview,node_bookmark_api,node_folder_api,node_query,node_bookmark_service,node_folder_service,node_import_export toneAmber
class node_bookmark_data,node_folder_data,node_tree_cache toneMint
class node_search,node_dashboard,node_reference,node_activity,node_context,node_registration toneRose
class node_backup,node_rss toneIndigo
```

## Components

### User interfaces

- [Bookmarks UI](https://github.com/nextcloud/bookmarks/blob/master/src/App.vue): `src/App.vue`
- [Vue app and state](https://github.com/nextcloud/bookmarks/blob/master/src/main.js): `src/main.js`

### Request and domain

- [Web views](https://github.com/nextcloud/bookmarks/blob/master/lib/Controller/WebViewController.php): `lib/Controller/WebViewController.php`
- [Bookmark API](https://github.com/nextcloud/bookmarks/blob/master/lib/Controller/BookmarkController.php): `lib/Controller/BookmarkController.php`
- [Folder and sharing API](https://github.com/nextcloud/bookmarks/blob/master/lib/Controller/FoldersController.php): `lib/Controller/FoldersController.php`
- [Search filters](https://github.com/nextcloud/bookmarks/blob/master/lib/QueryParameters.php): `lib/QueryParameters.php`
- [Bookmark operations](https://github.com/nextcloud/bookmarks/blob/master/lib/Service/BookmarkService.php): `lib/Service/BookmarkService.php`
- [Folder operations](https://github.com/nextcloud/bookmarks/blob/master/lib/Service/FolderService.php): `lib/Service/FolderService.php`
- [Import and export](https://github.com/nextcloud/bookmarks/blob/master/lib/Service/HtmlImporter.php): `lib/Service/HtmlImporter.php`

### Collection data

- [Bookmark records](https://github.com/nextcloud/bookmarks/blob/master/lib/Db/BookmarkMapper.php): `lib/Db/BookmarkMapper.php`
- [Folder and tree records](https://github.com/nextcloud/bookmarks/blob/master/lib/Db/FolderMapper.php): `lib/Db/FolderMapper.php`
- [Tree cache](https://github.com/nextcloud/bookmarks/blob/master/lib/Service/TreeCacheManager.php): `lib/Service/TreeCacheManager.php`

### Nextcloud capabilities

- [Full-text search](https://github.com/nextcloud/bookmarks/blob/master/lib/Search/Provider.php): `lib/Search/Provider.php`
- [Recent and frequent](https://github.com/nextcloud/bookmarks/blob/master/lib/Dashboard/Recent.php): `lib/Dashboard/Recent.php`
- [Bookmark references](https://github.com/nextcloud/bookmarks/blob/master/lib/Reference/BookmarkReferenceProvider.php): `lib/Reference/BookmarkReferenceProvider.php`
- [Activity publishing](https://github.com/nextcloud/bookmarks/blob/master/lib/Activity/ActivityPublisher.php): `lib/Activity/ActivityPublisher.php`
- [Context chat](https://github.com/nextcloud/bookmarks/blob/master/lib/ContextChat/ContextChatProvider.php): `lib/ContextChat/ContextChatProvider.php`
- [App registration](https://github.com/nextcloud/bookmarks/blob/master/lib/AppInfo/Application.php): `lib/AppInfo/Application.php`

### Background services

- [Collection backups](https://github.com/nextcloud/bookmarks/blob/master/lib/Service/BackupManager.php): `lib/Service/BackupManager.php`
- [RSS collections](https://github.com/nextcloud/bookmarks/blob/master/lib/Controller/WebViewController.php): `lib/Controller/WebViewController.php`

### Other components

- **Bookmark user**
- **Sync clients**

## Connections

- Bookmark user → Bookmarks UI: uses
- Sync clients → Bookmark API: REST requests
- Bookmarks UI → Vue app and state: renders
- Vue app and state → Web views: loads views
- Vue app and state → Bookmark API: REST requests
- Vue app and state → Folder and sharing API: REST requests
- Bookmark API → Bookmark operations: operates on
- Bookmark API → Search filters: builds filters
- Bookmark API → Import and export: imports
- Bookmark operations → Bookmark records: persists bookmarks
- Folder and sharing API → Folder operations: operates on
- Folder operations → Folder and tree records: persists folders
- App registration → Full-text search: registers
- App registration → Recent and frequent: registers
- App registration → Bookmark references: registers
- App registration → Activity publishing: registers
- App registration → Context chat: registers
- App registration → Tree cache: registers listeners
- App registration → RSS collections: registers views
