# imkaihong1015/yuindex architecture

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

- Interactive diagram: https://gitdiagram.com/imkaihong1015/yuindex
- Repository: https://github.com/imkaihong1015/yuindex

## Overview

YuIndex is a command-driven browser homepage and reusable web terminal. Users enter commands in the terminal; the command engine matches and parses them, dispatches command actions, and the terminal displays their results. The command set spans search, navigation, saved web links, user accounts, terminal customization, productivity, and entertainment. A supporting Express backend exposes account, music, translation, and background endpoints. Edges are limited to excerpted relationships or README-documented capabilities; unsampled wiring is omitted.

Main entry points: [`src/components/yu-terminal/YuTerminal.vue`](https://github.com/imkaihong1015/yuindex/blob/master/src/components/yu-terminal/YuTerminal.vue) (Terminal UI), [`src/core/commandRegister.ts`](https://github.com/imkaihong1015/yuindex/blob/master/src/core/commandRegister.ts) (Command registry), [`server/src/routes.js`](https://github.com/imkaihong1015/yuindex/blob/master/server/src/routes.js) (API routes), [`src/core/commandExecutor.ts`](https://github.com/imkaihong1015/yuindex/blob/master/src/core/commandExecutor.ts) (Command executor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_terminal["Web terminal"]
  node_index["Homepage<br/>[IndexPage.vue]"]
  node_terminal_ui["Terminal UI<br/>[YuTerminal.vue]"]
  node_output["Output renderer<br/>[ContentOutput.vue]"]
  node_history["Command history<br/>[history.ts]"]
  node_shortcuts["Keyboard shortcuts<br/>[shortcuts.ts]"]
  node_hints["Input hints<br/>[hint.ts]"]
end

subgraph group_engine["Command engine"]
  node_executor["Command executor<br/>[commandExecutor.ts]"]
  node_registry["Command registry<br/>[commandRegister.ts]"]
end

subgraph group_commands["Command capabilities"]
  node_search["Platform search<br/>[searchCommands.ts]"]
  node_navigation["Web navigation<br/>[gotoCommand.ts]"]
  node_space[("Saved web space<br/>[spaceStore.ts]")]
  node_user_commands["Account commands<br/>[userCommands.ts]"]
end

subgraph group_backend["Backend services"]
  node_account_api["Account API<br/>[userController.js]"]
  node_account_service["Account service<br/>[userService.js]"]
  node_user_store[("User records<br/>[user.js]")]
  node_music_api["Music API<br/>[musicController.js]"]
  node_music_service["Music service<br/>[musicService.js]"]
  node_translate_api["Translation API<br/>[fanyiController.js]"]
  node_background_api["Background API"]
  node_routes["API routes<br/>[routes.js]"]
end

subgraph group_integrations["External integrations"]
  node_translate_provider["Baidu translation<br/>[baiduFanYiApi.js]"]
  node_background_provider["Wallpaper provider<br/>[backgroundApi.js]"]
  node_music_provider["Netease music provider<br/>[neteaseMusicApi.js]"]
end

node_user(("User"))

node_user -->|"enters commands"| node_terminal_ui
node_terminal_ui -->|"renders results"| node_output
node_terminal_ui -->|"uses history"| node_history
node_terminal_ui -->|"registers shortcuts"| node_shortcuts
node_terminal_ui -->|"requests hints"| node_hints
node_index -->|"invokes commands"| node_executor
node_executor -->|"matches commands"| node_registry
node_registry -->|"registers search"| node_search
node_registry -->|"registers navigation"| node_navigation
node_registry -->|"registers space commands"| node_space
node_registry -->|"registers account commands"| node_user_commands
node_routes -->|"routes account requests"| node_account_api
node_routes -->|"routes music requests"| node_music_api
node_routes -->|"routes translation requests"| node_translate_api
node_routes -->|"routes background requests"| node_background_api
node_account_api -->|"calls account service"| node_account_service
node_account_service -->|"queries users"| node_user_store
node_music_api -->|"calls music service"| node_music_service
node_music_service -->|"uses music provider"| node_music_provider
node_translate_api -->|"requests translation"| node_translate_provider
node_background_api -->|"requests wallpaper"| node_background_provider

click node_index "https://github.com/imkaihong1015/yuindex/blob/master/src/pages/IndexPage.vue"
click node_terminal_ui "https://github.com/imkaihong1015/yuindex/blob/master/src/components/yu-terminal/YuTerminal.vue"
click node_output "https://github.com/imkaihong1015/yuindex/blob/master/src/components/yu-terminal/ContentOutput.vue"
click node_history "https://github.com/imkaihong1015/yuindex/blob/master/src/components/yu-terminal/history.ts"
click node_shortcuts "https://github.com/imkaihong1015/yuindex/blob/master/src/components/yu-terminal/shortcuts.ts"
click node_hints "https://github.com/imkaihong1015/yuindex/blob/master/src/components/yu-terminal/hint.ts"
click node_executor "https://github.com/imkaihong1015/yuindex/blob/master/src/core/commandExecutor.ts"
click node_registry "https://github.com/imkaihong1015/yuindex/blob/master/src/core/commandRegister.ts"
click node_search "https://github.com/imkaihong1015/yuindex/blob/master/src/core/commands/search/searchCommands.ts"
click node_navigation "https://github.com/imkaihong1015/yuindex/blob/master/src/core/commands/gotoCommand.ts"
click node_space "https://github.com/imkaihong1015/yuindex/blob/master/src/core/commands/space/spaceStore.ts"
click node_user_commands "https://github.com/imkaihong1015/yuindex/blob/master/src/core/commands/user/userCommands.ts"
click node_account_api "https://github.com/imkaihong1015/yuindex/blob/master/server/src/controller/userController.js"
click node_account_service "https://github.com/imkaihong1015/yuindex/blob/master/server/src/service/userService.js"
click node_user_store "https://github.com/imkaihong1015/yuindex/blob/master/server/src/model/user.js"
click node_music_api "https://github.com/imkaihong1015/yuindex/blob/master/server/src/controller/musicController.js"
click node_music_service "https://github.com/imkaihong1015/yuindex/blob/master/server/src/service/musicService.js"
click node_translate_api "https://github.com/imkaihong1015/yuindex/blob/master/server/src/controller/fanyiController.js"
click node_translate_provider "https://github.com/imkaihong1015/yuindex/blob/master/server/src/thirdpart/baiduFanYi/baiduFanYiApi.js"
click node_background_api "https://github.com/imkaihong1015/yuindex/blob/master/server/src/controller/backgroundController.js"
click node_background_provider "https://github.com/imkaihong1015/yuindex/blob/master/server/src/thirdpart/backgroundApi.js"
click node_music_provider "https://github.com/imkaihong1015/yuindex/blob/master/server/src/thirdpart/neteaseMusicApi.js"
click node_routes "https://github.com/imkaihong1015/yuindex/blob/master/server/src/routes.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_index,node_terminal_ui,node_output,node_history,node_shortcuts,node_hints,node_user toneBlue
class node_executor,node_registry toneAmber
class node_search,node_navigation,node_space,node_user_commands toneMint
class node_account_api,node_account_service,node_user_store,node_music_api,node_music_service,node_translate_api,node_background_api,node_routes toneRose
class node_translate_provider,node_background_provider,node_music_provider toneIndigo
```

## Components

### Web terminal

- [Homepage](https://github.com/imkaihong1015/yuindex/blob/master/src/pages/IndexPage.vue): `src/pages/IndexPage.vue`
- [Terminal UI](https://github.com/imkaihong1015/yuindex/blob/master/src/components/yu-terminal/YuTerminal.vue): `src/components/yu-terminal/YuTerminal.vue`
- [Output renderer](https://github.com/imkaihong1015/yuindex/blob/master/src/components/yu-terminal/ContentOutput.vue): `src/components/yu-terminal/ContentOutput.vue`
- [Command history](https://github.com/imkaihong1015/yuindex/blob/master/src/components/yu-terminal/history.ts): `src/components/yu-terminal/history.ts`
- [Keyboard shortcuts](https://github.com/imkaihong1015/yuindex/blob/master/src/components/yu-terminal/shortcuts.ts): `src/components/yu-terminal/shortcuts.ts`
- [Input hints](https://github.com/imkaihong1015/yuindex/blob/master/src/components/yu-terminal/hint.ts): `src/components/yu-terminal/hint.ts`

### Command engine

- [Command executor](https://github.com/imkaihong1015/yuindex/blob/master/src/core/commandExecutor.ts): `src/core/commandExecutor.ts`
- [Command registry](https://github.com/imkaihong1015/yuindex/blob/master/src/core/commandRegister.ts): `src/core/commandRegister.ts`

### Command capabilities

- [Platform search](https://github.com/imkaihong1015/yuindex/blob/master/src/core/commands/search/searchCommands.ts): `src/core/commands/search/searchCommands.ts`
- [Web navigation](https://github.com/imkaihong1015/yuindex/blob/master/src/core/commands/gotoCommand.ts): `src/core/commands/gotoCommand.ts`
- [Saved web space](https://github.com/imkaihong1015/yuindex/blob/master/src/core/commands/space/spaceStore.ts): `src/core/commands/space/spaceStore.ts`
- [Account commands](https://github.com/imkaihong1015/yuindex/blob/master/src/core/commands/user/userCommands.ts): `src/core/commands/user/userCommands.ts`

### Backend services

- [Account API](https://github.com/imkaihong1015/yuindex/blob/master/server/src/controller/userController.js): `server/src/controller/userController.js`
- [Account service](https://github.com/imkaihong1015/yuindex/blob/master/server/src/service/userService.js): `server/src/service/userService.js`
- [User records](https://github.com/imkaihong1015/yuindex/blob/master/server/src/model/user.js): `server/src/model/user.js`
- [Music API](https://github.com/imkaihong1015/yuindex/blob/master/server/src/controller/musicController.js): `server/src/controller/musicController.js`
- [Music service](https://github.com/imkaihong1015/yuindex/blob/master/server/src/service/musicService.js): `server/src/service/musicService.js`
- [Translation API](https://github.com/imkaihong1015/yuindex/blob/master/server/src/controller/fanyiController.js): `server/src/controller/fanyiController.js`
- [Background API](https://github.com/imkaihong1015/yuindex/blob/master/server/src/controller/backgroundController.js): `server/src/controller/backgroundController.js`
- [API routes](https://github.com/imkaihong1015/yuindex/blob/master/server/src/routes.js): `server/src/routes.js`

### External integrations

- [Baidu translation](https://github.com/imkaihong1015/yuindex/blob/master/server/src/thirdpart/baiduFanYi/baiduFanYiApi.js): `server/src/thirdpart/baiduFanYi/baiduFanYiApi.js`
- [Wallpaper provider](https://github.com/imkaihong1015/yuindex/blob/master/server/src/thirdpart/backgroundApi.js): `server/src/thirdpart/backgroundApi.js`
- [Netease music provider](https://github.com/imkaihong1015/yuindex/blob/master/server/src/thirdpart/neteaseMusicApi.js): `server/src/thirdpart/neteaseMusicApi.js`

### Other components

- **User**

## Connections

- User → Terminal UI: enters commands (evidence: `README.md`)
- Terminal UI → Output renderer: renders results (evidence: `src/components/yu-terminal/YuTerminal.vue`)
- Terminal UI → Command history: uses history (evidence: `src/components/yu-terminal/YuTerminal.vue`)
- Terminal UI → Keyboard shortcuts: registers shortcuts (evidence: `src/components/yu-terminal/YuTerminal.vue`)
- Terminal UI → Input hints: requests hints (evidence: `src/components/yu-terminal/YuTerminal.vue`)
- Homepage → Command executor: invokes commands (evidence: `src/pages/IndexPage.vue`)
- Command executor → Command registry: matches commands (evidence: `src/core/commandExecutor.ts`)
- Command registry → Platform search: registers search (evidence: `src/core/commandRegister.ts`)
- Command registry → Web navigation: registers navigation (evidence: `src/core/commandRegister.ts`)
- Command registry → Saved web space: registers space commands (evidence: `src/core/commandRegister.ts`)
- Command registry → Account commands: registers account commands (evidence: `src/core/commandRegister.ts`)
- API routes → Account API: routes account requests (evidence: `server/src/routes.js`)
- API routes → Music API: routes music requests (evidence: `server/src/routes.js`)
- API routes → Translation API: routes translation requests (evidence: `server/src/routes.js`)
- API routes → Background API: routes background requests (evidence: `server/src/routes.js`)
- Account API → Account service: calls account service (evidence: `server/src/controller/userController.js`)
- Account service → User records: queries users (evidence: `server/src/service/userService.js`)
- Music API → Music service: calls music service (evidence: `server/src/controller/musicController.js`)
- Music service → Netease music provider: uses music provider (evidence: `server/src/service/musicService.js`)
- Translation API → Baidu translation: requests translation (evidence: `server/src/controller/fanyiController.js`)
- Background API → Wallpaper provider: requests wallpaper (evidence: `server/src/controller/backgroundController.js`)
