# nextcloud/external architecture

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

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

## Overview

External Sites lets administrators configure language-, device-, and group-targeted links, then exposes eligible sites in Nextcloud navigation or the personal quota area. Users open links directly or through a framed route; administrators can also retrieve sites through the authenticated OCS API. The map includes configuration, icon handling, JWT support, and capability discovery. Some route registrations and unsampled implementations are not shown, so uncertain connections are omitted or marked unverified.

Main entry points: [`lib/SitesManager.php`](https://github.com/nextcloud/external/blob/master/lib/SitesManager.php) (Site Configuration), [`src/AdminSettings.vue`](https://github.com/nextcloud/external/blob/master/src/AdminSettings.vue) (Admin Settings), [`lib/Controller/APIController.php`](https://github.com/nextcloud/external/blob/master/lib/Controller/APIController.php) (OCS Sites API), [`lib/Controller/SiteController.php`](https://github.com/nextcloud/external/blob/master/lib/Controller/SiteController.php) (Framed Site)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_admin["Administration"]
  node_admin_ui["Admin Settings<br/>[AdminSettings.vue]"]
  node_site_dialog["Site Editor"]
  node_frontend_api["Admin API Client<br/>[api.ts]"]
end

subgraph group_site_runtime["Site Runtime"]
  node_site_store["Site Configuration<br/>[SitesManager.php]"]
  node_navigation["Navigation Links<br/>[Application.php]"]
  node_frame_route["Framed Site<br/>[SiteController.php]"]
  node_quota_settings["Quota Settings<br/>[Personal.php]"]
end

subgraph group_api["API and Integration"]
  node_icon_endpoints["Icon Handling<br/>[IconController.php]"]
  node_ocs_api["OCS Sites API<br/>[APIController.php]"]
  node_jwt["JWT Tokens<br/>[JWTManager.php]"]
  node_capabilities["Capabilities<br/>[Capabilities.php]"]
end

node_admin_user(("Administrator"))
node_nextcloud(("Nextcloud User"))
node_external_site["External Website"]
node_ocs_client(("Authenticated OCS Client"))

node_admin_user -->|"configures"| node_admin_ui
node_admin_ui -->|"edits sites"| node_site_dialog
node_admin_ui -->|"calls"| node_frontend_api
node_frontend_api -.->|"requests site data"| node_ocs_api
node_ocs_api -->|"reads and writes"| node_site_store
node_site_store -->|"uses tokens"| node_jwt
node_site_store -->|"supplies eligible sites"| node_navigation
node_nextcloud -.->|"opens link"| node_navigation
node_nextcloud -.->|"opens framed site"| node_frame_route
node_frame_route -->|"loads site"| node_site_store
node_frame_route -->|"frames URL"| node_external_site
node_site_store -->|"provides quota sites"| node_quota_settings
node_ocs_client -->|"requests sites"| node_ocs_api
node_ocs_api -.->|"advertises support"| node_capabilities
node_admin_ui -.->|"manages icons"| node_icon_endpoints

click node_admin_ui "https://github.com/nextcloud/external/blob/master/src/AdminSettings.vue"
click node_site_dialog "https://github.com/nextcloud/external/blob/master/src/components/ExternalWebsite.vue"
click node_frontend_api "https://github.com/nextcloud/external/blob/master/src/services/api.ts"
click node_site_store "https://github.com/nextcloud/external/blob/master/lib/SitesManager.php"
click node_navigation "https://github.com/nextcloud/external/blob/master/lib/AppInfo/Application.php"
click node_frame_route "https://github.com/nextcloud/external/blob/master/lib/Controller/SiteController.php"
click node_quota_settings "https://github.com/nextcloud/external/blob/master/lib/Settings/Personal.php"
click node_icon_endpoints "https://github.com/nextcloud/external/blob/master/lib/Controller/IconController.php"
click node_ocs_api "https://github.com/nextcloud/external/blob/master/lib/Controller/APIController.php"
click node_jwt "https://github.com/nextcloud/external/blob/master/lib/JWTManager.php"
click node_capabilities "https://github.com/nextcloud/external/blob/master/lib/Capabilities.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_admin_ui,node_site_dialog,node_frontend_api,node_nextcloud,node_ocs_client toneBlue
class node_site_store,node_navigation,node_frame_route,node_quota_settings toneAmber
class node_icon_endpoints,node_ocs_api,node_jwt,node_capabilities toneMint
class node_admin_user,node_external_site toneIndigo
```

## Components

### Administration

- [Admin Settings](https://github.com/nextcloud/external/blob/master/src/AdminSettings.vue): `src/AdminSettings.vue`
- [Site Editor](https://github.com/nextcloud/external/blob/master/src/components/ExternalWebsite.vue): `src/components/ExternalWebsite.vue`
- [Admin API Client](https://github.com/nextcloud/external/blob/master/src/services/api.ts): `src/services/api.ts`

### Site Runtime

- [Site Configuration](https://github.com/nextcloud/external/blob/master/lib/SitesManager.php): `lib/SitesManager.php`
- [Navigation Links](https://github.com/nextcloud/external/blob/master/lib/AppInfo/Application.php): `lib/AppInfo/Application.php`
- [Framed Site](https://github.com/nextcloud/external/blob/master/lib/Controller/SiteController.php): `lib/Controller/SiteController.php`
- [Quota Settings](https://github.com/nextcloud/external/blob/master/lib/Settings/Personal.php): `lib/Settings/Personal.php`

### API and Integration

- [Icon Handling](https://github.com/nextcloud/external/blob/master/lib/Controller/IconController.php): `lib/Controller/IconController.php`
- [OCS Sites API](https://github.com/nextcloud/external/blob/master/lib/Controller/APIController.php): `lib/Controller/APIController.php`
- [JWT Tokens](https://github.com/nextcloud/external/blob/master/lib/JWTManager.php): `lib/JWTManager.php`
- [Capabilities](https://github.com/nextcloud/external/blob/master/lib/Capabilities.php): `lib/Capabilities.php`

### Other components

- **Administrator**
- **Nextcloud User**
- **External Website**
- **Authenticated OCS Client**

## Connections

- Administrator → Admin Settings: configures (evidence: `src/AdminSettings.vue`)
- Admin Settings → Site Editor: edits sites (evidence: `src/AdminSettings.vue`)
- Admin Settings → Admin API Client: calls (evidence: `src/AdminSettings.vue`)
- Admin API Client → OCS Sites API: requests site data
- OCS Sites API → Site Configuration: reads and writes (evidence: `lib/Controller/APIController.php`)
- Site Configuration → JWT Tokens: uses tokens (evidence: `lib/SitesManager.php`)
- Site Configuration → Navigation Links: supplies eligible sites (evidence: `lib/AppInfo/Application.php`)
- Nextcloud User → Navigation Links: opens link
- Nextcloud User → Framed Site: opens framed site
- Framed Site → Site Configuration: loads site (evidence: `lib/Controller/SiteController.php`)
- Framed Site → External Website: frames URL (evidence: `lib/Controller/SiteController.php`)
- Site Configuration → Quota Settings: provides quota sites (evidence: `lib/Settings/Personal.php`)
- Authenticated OCS Client → OCS Sites API: requests sites (evidence: `README.md`)
- OCS Sites API → Capabilities: advertises support
- Admin Settings → Icon Handling: manages icons
