# zhao-001225/ruoyi-app architecture

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

- Interactive diagram: https://gitdiagram.com/zhao-001225/ruoyi-app
- Repository: https://github.com/zhao-001225/ruoyi-app

## Overview

RuoYi App is a UniApp mobile client for RuoYi backends, with cross-platform login, account/profile management, and a workbench. The main flow initializes the client, gates access on a token, authenticates through the API, and stores user identity and permissions for later use. The tree and excerpts also establish registration, dictionary access, profile/avatar updates, and shared upload/request helpers. Other account pages and workbench capabilities are preserved from the README and tree; unsampled page-level calls are not inferred.

Main entry points: [`store/modules/user.js`](https://github.com/zhao-001225/ruoyi-app/blob/master/store/modules/user.js) (User state), [`store/index.js`](https://github.com/zhao-001225/ruoyi-app/blob/master/store/index.js) (Vuex store), [`utils/request.js`](https://github.com/zhao-001225/ruoyi-app/blob/master/utils/request.js) (HTTP client), [`main.js`](https://github.com/zhao-001225/ruoyi-app/blob/master/main.js) (Client registration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App entry"]
  node_bootstrap["App initialization<br/>[App.vue]"]
  node_main["Client registration<br/>[main.js]"]
  node_home["Home page<br/>[index.vue]"]
end

subgraph group_identity["Identity and access"]
  node_login_page["Login and registration<br/>[login.vue]"]
  node_permission["Route permission<br/>[permission.js]"]
  node_auth_util["Token storage<br/>[auth.js]"]
  node_user_state["User state<br/>[user.js]"]
  node_store["Vuex store<br/>[index.js]"]
  node_auth_plugin["Role permissions<br/>[auth.js]"]
  node_storage[("Identity storage<br/>[storage.js]")]
end

subgraph group_account["Account features"]
  node_mine["My account<br/>[index.vue]"]
  node_avatar["Avatar update<br/>[index.vue]"]
  node_profile["Profile editing<br/>[edit.vue]"]
  node_password["Password change<br/>[index.vue]"]
  node_settings["Account settings<br/>[index.vue]"]
  node_help["Help and about<br/>[index.vue]"]
  node_about["About page<br/>[index.vue]"]
  node_work["Workbench<br/>[index.vue]"]
end

subgraph group_services["Backend services"]
  node_login_api["Authentication API<br/>[login.js]"]
  node_request["HTTP client<br/>[request.js]"]
  node_dict_api["Dictionary API<br/>[data.js]"]
  node_user_api["User API<br/>[user.js]"]
  node_upload["Upload service<br/>[upload.js]"]
end

subgraph group_ui["UI components"]
  node_file_picker["File selection"]
  node_file_upload["Choose and upload"]
  node_datetime["Date-time picker"]
  node_calendar["Calendar view<br/>[calendar.vue]"]
  node_time_picker["Time picker<br/>[time-picker.vue]"]
end

node_user(("Mobile user"))
node_backend{{"RuoYi backend"}}

node_user -->|"submits credentials"| node_login_page
node_bootstrap -->|"checks token"| node_auth_util
node_bootstrap -->|"redirects unauthenticated"| node_login_page
node_main -->|"registers store"| node_store
node_main -->|"loads guard"| node_permission
node_main -->|"exposes dictionary lookup"| node_dict_api
node_permission -->|"checks token"| node_auth_util
node_user_state -->|"calls authentication"| node_login_api
node_user_state -->|"stores token"| node_auth_util
node_user_state -->|"persists identity"| node_storage
node_store -->|"registers module"| node_user_state
node_auth_plugin -->|"reads permissions"| node_store
node_login_api -->|"sends API requests"| node_request
node_dict_api -->|"sends API requests"| node_request
node_user_api -->|"sends API requests"| node_request
node_user_api -->|"delegates uploads"| node_upload
node_request -.->|"calls endpoints"| node_backend
node_user -->|"opens account"| node_mine
node_user -->|"opens workbench"| node_work
node_avatar -->|"updates avatar"| node_user_api
node_avatar -->|"reads account state"| node_store
node_file_picker -->|"delegates selection"| node_file_upload
node_datetime -->|"renders calendar"| node_calendar
node_datetime -->|"renders time picker"| node_time_picker

click node_bootstrap "https://github.com/zhao-001225/ruoyi-app/blob/master/App.vue"
click node_main "https://github.com/zhao-001225/ruoyi-app/blob/master/main.js"
click node_login_page "https://github.com/zhao-001225/ruoyi-app/blob/master/pages/login.vue"
click node_permission "https://github.com/zhao-001225/ruoyi-app/blob/master/permission.js"
click node_auth_util "https://github.com/zhao-001225/ruoyi-app/blob/master/utils/auth.js"
click node_user_state "https://github.com/zhao-001225/ruoyi-app/blob/master/store/modules/user.js"
click node_store "https://github.com/zhao-001225/ruoyi-app/blob/master/store/index.js"
click node_auth_plugin "https://github.com/zhao-001225/ruoyi-app/blob/master/plugins/auth.js"
click node_login_api "https://github.com/zhao-001225/ruoyi-app/blob/master/api/login.js"
click node_request "https://github.com/zhao-001225/ruoyi-app/blob/master/utils/request.js"
click node_dict_api "https://github.com/zhao-001225/ruoyi-app/blob/master/api/system/dict/data.js"
click node_user_api "https://github.com/zhao-001225/ruoyi-app/blob/master/api/system/user.js"
click node_upload "https://github.com/zhao-001225/ruoyi-app/blob/master/utils/upload.js"
click node_mine "https://github.com/zhao-001225/ruoyi-app/blob/master/pages/mine/index.vue"
click node_avatar "https://github.com/zhao-001225/ruoyi-app/blob/master/pages/mine/avatar/index.vue"
click node_profile "https://github.com/zhao-001225/ruoyi-app/blob/master/pages/mine/info/edit.vue"
click node_password "https://github.com/zhao-001225/ruoyi-app/blob/master/pages/mine/pwd/index.vue"
click node_settings "https://github.com/zhao-001225/ruoyi-app/blob/master/pages/mine/setting/index.vue"
click node_help "https://github.com/zhao-001225/ruoyi-app/blob/master/pages/mine/help/index.vue"
click node_about "https://github.com/zhao-001225/ruoyi-app/blob/master/pages/mine/about/index.vue"
click node_work "https://github.com/zhao-001225/ruoyi-app/blob/master/pages/work/index.vue"
click node_home "https://github.com/zhao-001225/ruoyi-app/blob/master/pages/index.vue"
click node_file_picker "https://github.com/zhao-001225/ruoyi-app/blob/master/uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.vue"
click node_file_upload "https://github.com/zhao-001225/ruoyi-app/blob/master/uni_modules/uni-file-picker/components/uni-file-picker/choose-and-upload-file.js"
click node_datetime "https://github.com/zhao-001225/ruoyi-app/blob/master/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue"
click node_calendar "https://github.com/zhao-001225/ruoyi-app/blob/master/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar.vue"
click node_time_picker "https://github.com/zhao-001225/ruoyi-app/blob/master/uni_modules/uni-datetime-picker/components/uni-datetime-picker/time-picker.vue"
click node_storage "https://github.com/zhao-001225/ruoyi-app/blob/master/utils/storage.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_bootstrap,node_main,node_home,node_user toneBlue
class node_login_page,node_permission,node_auth_util,node_user_state,node_store,node_auth_plugin,node_storage toneAmber
class node_mine,node_avatar,node_profile,node_password,node_settings,node_help,node_about,node_work toneMint
class node_login_api,node_request,node_dict_api,node_user_api,node_upload toneRose
class node_file_picker,node_file_upload,node_datetime,node_calendar,node_time_picker,node_backend toneIndigo
```

## Components

### App entry

- [App initialization](https://github.com/zhao-001225/ruoyi-app/blob/master/App.vue): `App.vue`
- [Client registration](https://github.com/zhao-001225/ruoyi-app/blob/master/main.js): `main.js`
- [Home page](https://github.com/zhao-001225/ruoyi-app/blob/master/pages/index.vue): `pages/index.vue`

### Identity and access

- [Login and registration](https://github.com/zhao-001225/ruoyi-app/blob/master/pages/login.vue): `pages/login.vue`
- [Route permission](https://github.com/zhao-001225/ruoyi-app/blob/master/permission.js): `permission.js`
- [Token storage](https://github.com/zhao-001225/ruoyi-app/blob/master/utils/auth.js): `utils/auth.js`
- [User state](https://github.com/zhao-001225/ruoyi-app/blob/master/store/modules/user.js): `store/modules/user.js`
- [Vuex store](https://github.com/zhao-001225/ruoyi-app/blob/master/store/index.js): `store/index.js`
- [Role permissions](https://github.com/zhao-001225/ruoyi-app/blob/master/plugins/auth.js): `plugins/auth.js`
- [Identity storage](https://github.com/zhao-001225/ruoyi-app/blob/master/utils/storage.js): `utils/storage.js`

### Account features

- [My account](https://github.com/zhao-001225/ruoyi-app/blob/master/pages/mine/index.vue): `pages/mine/index.vue`
- [Avatar update](https://github.com/zhao-001225/ruoyi-app/blob/master/pages/mine/avatar/index.vue): `pages/mine/avatar/index.vue`
- [Profile editing](https://github.com/zhao-001225/ruoyi-app/blob/master/pages/mine/info/edit.vue): `pages/mine/info/edit.vue`
- [Password change](https://github.com/zhao-001225/ruoyi-app/blob/master/pages/mine/pwd/index.vue): `pages/mine/pwd/index.vue`
- [Account settings](https://github.com/zhao-001225/ruoyi-app/blob/master/pages/mine/setting/index.vue): `pages/mine/setting/index.vue`
- [Help and about](https://github.com/zhao-001225/ruoyi-app/blob/master/pages/mine/help/index.vue): `pages/mine/help/index.vue`
- [About page](https://github.com/zhao-001225/ruoyi-app/blob/master/pages/mine/about/index.vue): `pages/mine/about/index.vue`
- [Workbench](https://github.com/zhao-001225/ruoyi-app/blob/master/pages/work/index.vue): `pages/work/index.vue`

### Backend services

- [Authentication API](https://github.com/zhao-001225/ruoyi-app/blob/master/api/login.js): `api/login.js`
- [HTTP client](https://github.com/zhao-001225/ruoyi-app/blob/master/utils/request.js): `utils/request.js`
- [Dictionary API](https://github.com/zhao-001225/ruoyi-app/blob/master/api/system/dict/data.js): `api/system/dict/data.js`
- [User API](https://github.com/zhao-001225/ruoyi-app/blob/master/api/system/user.js): `api/system/user.js`
- [Upload service](https://github.com/zhao-001225/ruoyi-app/blob/master/utils/upload.js): `utils/upload.js`

### UI components

- [File selection](https://github.com/zhao-001225/ruoyi-app/blob/master/uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.vue): `uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.vue`
- [Choose and upload](https://github.com/zhao-001225/ruoyi-app/blob/master/uni_modules/uni-file-picker/components/uni-file-picker/choose-and-upload-file.js): `uni_modules/uni-file-picker/components/uni-file-picker/choose-and-upload-file.js`
- [Date-time picker](https://github.com/zhao-001225/ruoyi-app/blob/master/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue): `uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue`
- [Calendar view](https://github.com/zhao-001225/ruoyi-app/blob/master/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar.vue): `uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar.vue`
- [Time picker](https://github.com/zhao-001225/ruoyi-app/blob/master/uni_modules/uni-datetime-picker/components/uni-datetime-picker/time-picker.vue): `uni_modules/uni-datetime-picker/components/uni-datetime-picker/time-picker.vue`

### Other components

- **Mobile user**
- **RuoYi backend**

## Connections

- Mobile user → Login and registration: submits credentials (evidence: `README.md`)
- App initialization → Token storage: checks token (evidence: `App.vue`)
- App initialization → Login and registration: redirects unauthenticated (evidence: `App.vue`)
- Client registration → Vuex store: registers store (evidence: `main.js`)
- Client registration → Route permission: loads guard (evidence: `main.js`)
- Client registration → Dictionary API: exposes dictionary lookup (evidence: `main.js`)
- Route permission → Token storage: checks token (evidence: `permission.js`)
- User state → Authentication API: calls authentication (evidence: `store/modules/user.js`)
- User state → Token storage: stores token (evidence: `store/modules/user.js`)
- User state → Identity storage: persists identity (evidence: `store/modules/user.js`)
- Vuex store → User state: registers module (evidence: `store/index.js`)
- Role permissions → Vuex store: reads permissions (evidence: `plugins/auth.js`)
- Authentication API → HTTP client: sends API requests (evidence: `api/login.js`)
- Dictionary API → HTTP client: sends API requests (evidence: `api/system/dict/data.js`)
- User API → HTTP client: sends API requests (evidence: `api/system/user.js`)
- User API → Upload service: delegates uploads (evidence: `api/system/user.js`)
- HTTP client → RuoYi backend: calls endpoints
- Mobile user → My account: opens account (evidence: `README.md`)
- Mobile user → Workbench: opens workbench (evidence: `README.md`)
- Avatar update → User API: updates avatar (evidence: `pages/mine/avatar/index.vue`)
- Avatar update → Vuex store: reads account state (evidence: `pages/mine/avatar/index.vue`)
- File selection → Choose and upload: delegates selection (evidence: `uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.vue`)
- Date-time picker → Calendar view: renders calendar (evidence: `uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue`)
- Date-time picker → Time picker: renders time picker (evidence: `uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue`)
