# dcloudio/uni-app architecture

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

- Interactive diagram: https://gitdiagram.com/dcloudio/uni-app
- Repository: https://github.com/dcloudio/uni-app

## Overview

This repository is the uni-app x source tree: a cross-platform Vue-based application framework and runtime, with native platform modules and a broad component/plugin ecosystem. A typical developer workflow is to build an application using framework components and APIs, then run the same application on supported native, web, and mini-program platforms. The tree and README establish those stages and major capabilities, but the sampled source is mostly individual modules rather than the framework’s central application entry point; edges are therefore limited to directly evidenced component relationships and documented product scope.

Main entry points: [`src/uni_modules/uni-video/utssdk/app-ios/VideoPlayer/Managers/UniVideoPlayerManager.swift`](https://github.com/dcloudio/uni-app/blob/uni-app-x/src/uni_modules/uni-video/utssdk/app-ios/VideoPlayer/Managers/UniVideoPlayerManager.swift) (Video manager), [`src/wxcomponents/vant/button/index.vue`](https://github.com/dcloudio/uni-app/blob/uni-app-x/src/wxcomponents/vant/button/index.vue) (Vant button), [`src`](https://github.com/dcloudio/uni-app/tree/uni-app-x/src) (uni-app x), [`src/wxcomponents/vant/icon/index.vue`](https://github.com/dcloudio/uni-app/blob/uni-app-x/src/wxcomponents/vant/icon/index.vue) (Vant icon)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_framework["Framework Runtime"]
  node_uniapp["uni-app x"]
  node_uts["UTS extensions"]
  node_webview["WebView bridge"]
end

subgraph group_native["Native APIs"]
  node_camera["Camera module<br/>[CameraImpl.kt]"]
  node_camera_manager["Camera manager<br/>[CameraManager.kt]"]
  node_files["File system"]
  node_location["Location APIs"]
  node_media["Media selection"]
end

subgraph group_media["Media Playback"]
  node_audio_service["Audio service<br/>[AudioService.kt]"]
  node_audio_player["Background player"]
  node_video_manager["Video manager"]
  node_video_actor["Playback state"]
  node_video_config["Video configuration"]
  node_video_state["Video state"]
  node_video_cache["Video cache<br/>[CacheManager.swift]"]
  node_video_drm["FairPlay DRM<br/>[DRMManager.swift]"]
  node_video_gesture["Video gestures"]
  node_video_pip["Picture-in-picture<br/>[PIPManager.swift]"]
  node_video_preview["Frame preview"]
  node_video_m3u8["M3U8 handler"]
end

subgraph group_cloud["Cloud Services"]
  node_cloud_functions["Cloud functions"]
  node_todo["Todo service<br/>[index.obj.js]"]
  node_identity["Identity common<br/>[index.js]"]
  node_payments["Payment service<br/>[index.obj.js]"]
  node_maps["Map service<br/>[index.obj.js]"]
end

subgraph group_components["UI Components"]
  node_collapse["Collapse item"]
  node_alert["Native alerts"]
  node_vant_button["Vant button<br/>[index.vue]"]
  node_vant_icon["Vant icon<br/>[index.vue]"]
  node_vant_loading["Vant loading<br/>[index.vue]"]
  node_vant_component["Vant adapter<br/>[component.js]"]
  node_vant_utils["Vant utilities<br/>[utils.js]"]
end

node_developer(("App developer"))
node_app["Cross-platform app"]

node_developer -->|"authors"| node_app
node_app -->|"uses framework"| node_uniapp
node_uniapp -->|"extends with"| node_uts
node_uniapp -.->|"uses WebView"| node_webview
node_camera_manager -->|"creates and restores"| node_camera
node_audio_service -->|"uses player"| node_audio_player
node_video_manager -->|"requests state"| node_video_actor
node_video_manager -->|"reads configuration"| node_video_config
node_video_manager -->|"updates state"| node_video_state
node_video_manager -->|"uses cache"| node_video_cache
node_video_manager -->|"uses DRM"| node_video_drm
node_video_manager -->|"configures gestures"| node_video_gesture
node_video_manager -->|"configures PiP"| node_video_pip
node_video_manager -->|"requests preview"| node_video_preview
node_video_manager -->|"uses handler"| node_video_m3u8
node_developer -.->|"invokes services"| node_cloud_functions
node_cloud_functions -.->|"includes service"| node_todo
node_developer -.->|"uses identity"| node_identity
node_developer -.->|"uses payments"| node_payments
node_developer -.->|"uses maps"| node_maps
node_vant_button -->|"renders"| node_vant_icon
node_vant_button -->|"renders"| node_vant_loading
node_vant_button -->|"registers with"| node_vant_component
node_vant_icon -->|"registers with"| node_vant_component
node_vant_icon -->|"uses sizing"| node_vant_utils
node_vant_loading -->|"registers with"| node_vant_component
node_vant_loading -->|"uses sizing"| node_vant_utils
node_alert -.->|"presents alerts"| node_app
node_collapse -.->|"provides UI"| node_app
node_files -.->|"provides file APIs"| node_app
node_location -.->|"provides location"| node_app
node_media -.->|"provides selection"| node_app

click node_uniapp "https://github.com/dcloudio/uni-app/tree/uni-app-x/src"
click node_uts "https://github.com/dcloudio/uni-app/tree/uni-app-x/src/uni_modules"
click node_webview "https://github.com/dcloudio/uni-app/blob/uni-app-x/src/hybrid/html/uni.webview.1.5.5.js"
click node_camera "https://github.com/dcloudio/uni-app/blob/uni-app-x/src/uni_modules/uni-camera/utssdk/app-android/CameraImpl.kt"
click node_camera_manager "https://github.com/dcloudio/uni-app/blob/uni-app-x/src/uni_modules/uni-camera/utssdk/app-android/CameraManager.kt"
click node_files "https://github.com/dcloudio/uni-app/blob/uni-app-x/src/uni_modules/uni-fileSystemManager/utssdk/app-ios/UniFileSystemManager.swift"
click node_location "https://github.com/dcloudio/uni-app/blob/uni-app-x/src/uni_modules/uni-location-system/utssdk/app-android/UniSystemLocationService.kt"
click node_media "https://github.com/dcloudio/uni-app/blob/uni-app-x/src/uni_modules/uni-media/utssdk/app-ios/utils/UniChooseFileManager.swift"
click node_audio_service "https://github.com/dcloudio/uni-app/blob/uni-app-x/src/uni_modules/uni-getBackgroundAudioManager/utssdk/app-android/AudioService.kt"
click node_audio_player "https://github.com/dcloudio/uni-app/blob/uni-app-x/src/uni_modules/uni-getBackgroundAudioManager/utssdk/app-android/BackgroundAudioPlayer.kt"
click node_video_manager "https://github.com/dcloudio/uni-app/blob/uni-app-x/src/uni_modules/uni-video/utssdk/app-ios/VideoPlayer/Managers/UniVideoPlayerManager.swift"
click node_video_actor "https://github.com/dcloudio/uni-app/blob/uni-app-x/src/uni_modules/uni-video/utssdk/app-ios/VideoPlayer/Core/UniVideoPlayerActor.swift"
click node_video_config "https://github.com/dcloudio/uni-app/blob/uni-app-x/src/uni_modules/uni-video/utssdk/app-ios/VideoPlayer/Models/UniVideoPlayerConfiguration.swift"
click node_video_state "https://github.com/dcloudio/uni-app/blob/uni-app-x/src/uni_modules/uni-video/utssdk/app-ios/VideoPlayer/Models/UniVideoPlayerState.swift"
click node_video_cache "https://github.com/dcloudio/uni-app/blob/uni-app-x/src/uni_modules/uni-video/utssdk/app-ios/VideoPlayer/Managers/CacheManager.swift"
click node_video_drm "https://github.com/dcloudio/uni-app/blob/uni-app-x/src/uni_modules/uni-video/utssdk/app-ios/VideoPlayer/Managers/DRMManager.swift"
click node_video_gesture "https://github.com/dcloudio/uni-app/blob/uni-app-x/src/uni_modules/uni-video/utssdk/app-ios/VideoPlayer/Managers/GestureManager.swift"
click node_video_pip "https://github.com/dcloudio/uni-app/blob/uni-app-x/src/uni_modules/uni-video/utssdk/app-ios/VideoPlayer/Managers/PIPManager.swift"
click node_video_preview "https://github.com/dcloudio/uni-app/blob/uni-app-x/src/uni_modules/uni-video/utssdk/app-ios/VideoPlayer/Preview/FirstFramePreviewCenter.swift"
click node_video_m3u8 "https://github.com/dcloudio/uni-app/blob/uni-app-x/src/uni_modules/uni-video/utssdk/app-ios/VideoPlayer/Managers/LocalM3U8Handler.swift"
click node_cloud_functions "https://github.com/dcloudio/uni-app/tree/uni-app-x/src/uniCloud-aliyun/cloudfunctions"
click node_todo "https://github.com/dcloudio/uni-app/blob/uni-app-x/src/uniCloud-aliyun/cloudfunctions/todo/index.obj.js"
click node_identity "https://github.com/dcloudio/uni-app/blob/uni-app-x/src/uni_modules/uni-id-common/uniCloud/cloudfunctions/common/uni-id-common/index.js"
click node_payments "https://github.com/dcloudio/uni-app/blob/uni-app-x/src/uni_modules/uni-pay-x/uniCloud/cloudfunctions/uni-pay-co/index.obj.js"
click node_maps "https://github.com/dcloudio/uni-app/blob/uni-app-x/src/uni_modules/uni-map-common/uniCloud/cloudfunctions/uni-map-co/index.obj.js"
click node_collapse "https://github.com/dcloudio/uni-app/blob/uni-app-x/src/components/uni-collapse-item/uni-collapse-item.vue"
click node_alert "https://github.com/dcloudio/uni-app/blob/uni-app-x/src/uni_modules/uni-prompt/utssdk/app-ios/UniAlert/DCAlertViewController.swift"
click node_vant_button "https://github.com/dcloudio/uni-app/blob/uni-app-x/src/wxcomponents/vant/button/index.vue"
click node_vant_icon "https://github.com/dcloudio/uni-app/blob/uni-app-x/src/wxcomponents/vant/icon/index.vue"
click node_vant_loading "https://github.com/dcloudio/uni-app/blob/uni-app-x/src/wxcomponents/vant/loading/index.vue"
click node_vant_component "https://github.com/dcloudio/uni-app/blob/uni-app-x/src/wxcomponents/vant/common/component.js"
click node_vant_utils "https://github.com/dcloudio/uni-app/blob/uni-app-x/src/wxcomponents/vant/common/utils.js"

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_uniapp,node_uts,node_webview toneBlue
class node_camera,node_camera_manager,node_files,node_location,node_media toneAmber
class node_audio_service,node_audio_player,node_video_manager,node_video_actor,node_video_config,node_video_state,node_video_cache,node_video_drm,node_video_gesture,node_video_pip,node_video_preview,node_video_m3u8 toneMint
class node_cloud_functions,node_todo,node_identity,node_payments,node_maps toneRose
class node_collapse,node_alert,node_vant_button,node_vant_icon,node_vant_loading,node_vant_component,node_vant_utils,node_developer,node_app toneIndigo
```

## Components

### Framework Runtime

- [uni-app x](https://github.com/dcloudio/uni-app/tree/uni-app-x/src): `src`
- [UTS extensions](https://github.com/dcloudio/uni-app/tree/uni-app-x/src/uni_modules): `src/uni_modules`
- [WebView bridge](https://github.com/dcloudio/uni-app/blob/uni-app-x/src/hybrid/html/uni.webview.1.5.5.js): `src/hybrid/html/uni.webview.1.5.5.js`

### Native APIs

- [Camera module](https://github.com/dcloudio/uni-app/blob/uni-app-x/src/uni_modules/uni-camera/utssdk/app-android/CameraImpl.kt): `src/uni_modules/uni-camera/utssdk/app-android/CameraImpl.kt`
- [Camera manager](https://github.com/dcloudio/uni-app/blob/uni-app-x/src/uni_modules/uni-camera/utssdk/app-android/CameraManager.kt): `src/uni_modules/uni-camera/utssdk/app-android/CameraManager.kt`
- [File system](https://github.com/dcloudio/uni-app/blob/uni-app-x/src/uni_modules/uni-fileSystemManager/utssdk/app-ios/UniFileSystemManager.swift): `src/uni_modules/uni-fileSystemManager/utssdk/app-ios/UniFileSystemManager.swift`
- [Location APIs](https://github.com/dcloudio/uni-app/blob/uni-app-x/src/uni_modules/uni-location-system/utssdk/app-android/UniSystemLocationService.kt): `src/uni_modules/uni-location-system/utssdk/app-android/UniSystemLocationService.kt`
- [Media selection](https://github.com/dcloudio/uni-app/blob/uni-app-x/src/uni_modules/uni-media/utssdk/app-ios/utils/UniChooseFileManager.swift): `src/uni_modules/uni-media/utssdk/app-ios/utils/UniChooseFileManager.swift`

### Media Playback

- [Audio service](https://github.com/dcloudio/uni-app/blob/uni-app-x/src/uni_modules/uni-getBackgroundAudioManager/utssdk/app-android/AudioService.kt): `src/uni_modules/uni-getBackgroundAudioManager/utssdk/app-android/AudioService.kt`
- [Background player](https://github.com/dcloudio/uni-app/blob/uni-app-x/src/uni_modules/uni-getBackgroundAudioManager/utssdk/app-android/BackgroundAudioPlayer.kt): `src/uni_modules/uni-getBackgroundAudioManager/utssdk/app-android/BackgroundAudioPlayer.kt`
- [Video manager](https://github.com/dcloudio/uni-app/blob/uni-app-x/src/uni_modules/uni-video/utssdk/app-ios/VideoPlayer/Managers/UniVideoPlayerManager.swift): `src/uni_modules/uni-video/utssdk/app-ios/VideoPlayer/Managers/UniVideoPlayerManager.swift`
- [Playback state](https://github.com/dcloudio/uni-app/blob/uni-app-x/src/uni_modules/uni-video/utssdk/app-ios/VideoPlayer/Core/UniVideoPlayerActor.swift): `src/uni_modules/uni-video/utssdk/app-ios/VideoPlayer/Core/UniVideoPlayerActor.swift`
- [Video configuration](https://github.com/dcloudio/uni-app/blob/uni-app-x/src/uni_modules/uni-video/utssdk/app-ios/VideoPlayer/Models/UniVideoPlayerConfiguration.swift): `src/uni_modules/uni-video/utssdk/app-ios/VideoPlayer/Models/UniVideoPlayerConfiguration.swift`
- [Video state](https://github.com/dcloudio/uni-app/blob/uni-app-x/src/uni_modules/uni-video/utssdk/app-ios/VideoPlayer/Models/UniVideoPlayerState.swift): `src/uni_modules/uni-video/utssdk/app-ios/VideoPlayer/Models/UniVideoPlayerState.swift`
- [Video cache](https://github.com/dcloudio/uni-app/blob/uni-app-x/src/uni_modules/uni-video/utssdk/app-ios/VideoPlayer/Managers/CacheManager.swift): `src/uni_modules/uni-video/utssdk/app-ios/VideoPlayer/Managers/CacheManager.swift`
- [FairPlay DRM](https://github.com/dcloudio/uni-app/blob/uni-app-x/src/uni_modules/uni-video/utssdk/app-ios/VideoPlayer/Managers/DRMManager.swift): `src/uni_modules/uni-video/utssdk/app-ios/VideoPlayer/Managers/DRMManager.swift`
- [Video gestures](https://github.com/dcloudio/uni-app/blob/uni-app-x/src/uni_modules/uni-video/utssdk/app-ios/VideoPlayer/Managers/GestureManager.swift): `src/uni_modules/uni-video/utssdk/app-ios/VideoPlayer/Managers/GestureManager.swift`
- [Picture-in-picture](https://github.com/dcloudio/uni-app/blob/uni-app-x/src/uni_modules/uni-video/utssdk/app-ios/VideoPlayer/Managers/PIPManager.swift): `src/uni_modules/uni-video/utssdk/app-ios/VideoPlayer/Managers/PIPManager.swift`
- [Frame preview](https://github.com/dcloudio/uni-app/blob/uni-app-x/src/uni_modules/uni-video/utssdk/app-ios/VideoPlayer/Preview/FirstFramePreviewCenter.swift): `src/uni_modules/uni-video/utssdk/app-ios/VideoPlayer/Preview/FirstFramePreviewCenter.swift`
- [M3U8 handler](https://github.com/dcloudio/uni-app/blob/uni-app-x/src/uni_modules/uni-video/utssdk/app-ios/VideoPlayer/Managers/LocalM3U8Handler.swift): `src/uni_modules/uni-video/utssdk/app-ios/VideoPlayer/Managers/LocalM3U8Handler.swift`

### Cloud Services

- [Cloud functions](https://github.com/dcloudio/uni-app/tree/uni-app-x/src/uniCloud-aliyun/cloudfunctions): `src/uniCloud-aliyun/cloudfunctions`
- [Todo service](https://github.com/dcloudio/uni-app/blob/uni-app-x/src/uniCloud-aliyun/cloudfunctions/todo/index.obj.js): `src/uniCloud-aliyun/cloudfunctions/todo/index.obj.js`
- [Identity common](https://github.com/dcloudio/uni-app/blob/uni-app-x/src/uni_modules/uni-id-common/uniCloud/cloudfunctions/common/uni-id-common/index.js): `src/uni_modules/uni-id-common/uniCloud/cloudfunctions/common/uni-id-common/index.js`
- [Payment service](https://github.com/dcloudio/uni-app/blob/uni-app-x/src/uni_modules/uni-pay-x/uniCloud/cloudfunctions/uni-pay-co/index.obj.js): `src/uni_modules/uni-pay-x/uniCloud/cloudfunctions/uni-pay-co/index.obj.js`
- [Map service](https://github.com/dcloudio/uni-app/blob/uni-app-x/src/uni_modules/uni-map-common/uniCloud/cloudfunctions/uni-map-co/index.obj.js): `src/uni_modules/uni-map-common/uniCloud/cloudfunctions/uni-map-co/index.obj.js`

### UI Components

- [Collapse item](https://github.com/dcloudio/uni-app/blob/uni-app-x/src/components/uni-collapse-item/uni-collapse-item.vue): `src/components/uni-collapse-item/uni-collapse-item.vue`
- [Native alerts](https://github.com/dcloudio/uni-app/blob/uni-app-x/src/uni_modules/uni-prompt/utssdk/app-ios/UniAlert/DCAlertViewController.swift): `src/uni_modules/uni-prompt/utssdk/app-ios/UniAlert/DCAlertViewController.swift`
- [Vant button](https://github.com/dcloudio/uni-app/blob/uni-app-x/src/wxcomponents/vant/button/index.vue): `src/wxcomponents/vant/button/index.vue`
- [Vant icon](https://github.com/dcloudio/uni-app/blob/uni-app-x/src/wxcomponents/vant/icon/index.vue): `src/wxcomponents/vant/icon/index.vue`
- [Vant loading](https://github.com/dcloudio/uni-app/blob/uni-app-x/src/wxcomponents/vant/loading/index.vue): `src/wxcomponents/vant/loading/index.vue`
- [Vant adapter](https://github.com/dcloudio/uni-app/blob/uni-app-x/src/wxcomponents/vant/common/component.js): `src/wxcomponents/vant/common/component.js`
- [Vant utilities](https://github.com/dcloudio/uni-app/blob/uni-app-x/src/wxcomponents/vant/common/utils.js): `src/wxcomponents/vant/common/utils.js`

### Other components

- **App developer**
- **Cross-platform app**

## Connections

- App developer → Cross-platform app: authors
- Cross-platform app → uni-app x: uses framework
- uni-app x → UTS extensions: extends with (evidence: `src/uni_modules/uni-getBackgroundAudioManager/utssdk/app-android/AudioService.kt`)
- uni-app x → WebView bridge: uses WebView
- Camera manager → Camera module: creates and restores (evidence: `src/uni_modules/uni-camera/utssdk/app-android/CameraManager.kt`)
- Audio service → Background player: uses player (evidence: `src/uni_modules/uni-getBackgroundAudioManager/utssdk/app-android/AudioService.kt`)
- Video manager → Playback state: requests state (evidence: `src/uni_modules/uni-video/utssdk/app-ios/VideoPlayer/Managers/UniVideoPlayerManager.swift`)
- Video manager → Video configuration: reads configuration (evidence: `src/uni_modules/uni-video/utssdk/app-ios/VideoPlayer/Managers/UniVideoPlayerManager.swift`)
- Video manager → Video state: updates state (evidence: `src/uni_modules/uni-video/utssdk/app-ios/VideoPlayer/Managers/UniVideoPlayerManager.swift`)
- Video manager → Video cache: uses cache (evidence: `src/uni_modules/uni-video/utssdk/app-ios/VideoPlayer/Managers/UniVideoPlayerManager.swift`)
- Video manager → FairPlay DRM: uses DRM (evidence: `src/uni_modules/uni-video/utssdk/app-ios/VideoPlayer/Managers/UniVideoPlayerManager.swift`)
- Video manager → Video gestures: configures gestures (evidence: `src/uni_modules/uni-video/utssdk/app-ios/VideoPlayer/Managers/UniVideoPlayerManager.swift`)
- Video manager → Picture-in-picture: configures PiP (evidence: `src/uni_modules/uni-video/utssdk/app-ios/VideoPlayer/Managers/UniVideoPlayerManager.swift`)
- Video manager → Frame preview: requests preview (evidence: `src/uni_modules/uni-video/utssdk/app-ios/VideoPlayer/Managers/UniVideoPlayerManager.swift`)
- Video manager → M3U8 handler: uses handler (evidence: `src/uni_modules/uni-video/utssdk/app-ios/VideoPlayer/Managers/UniVideoPlayerManager.swift`)
- App developer → Cloud functions: invokes services
- Cloud functions → Todo service: includes service
- App developer → Identity common: uses identity
- App developer → Payment service: uses payments
- App developer → Map service: uses maps
- Vant button → Vant icon: renders (evidence: `src/wxcomponents/vant/button/index.vue`)
- Vant button → Vant loading: renders (evidence: `src/wxcomponents/vant/button/index.vue`)
- Vant button → Vant adapter: registers with (evidence: `src/wxcomponents/vant/button/index.vue`)
- Vant icon → Vant adapter: registers with (evidence: `src/wxcomponents/vant/icon/index.vue`)
- Vant icon → Vant utilities: uses sizing (evidence: `src/wxcomponents/vant/icon/index.vue`)
- Vant loading → Vant adapter: registers with (evidence: `src/wxcomponents/vant/loading/index.vue`)
- Vant loading → Vant utilities: uses sizing (evidence: `src/wxcomponents/vant/loading/index.vue`)
- Native alerts → Cross-platform app: presents alerts
- Collapse item → Cross-platform app: provides UI
- File system → Cross-platform app: provides file APIs
- Location APIs → Cross-platform app: provides location
- Media selection → Cross-platform app: provides selection
