# soybeanjs/soybean-admin architecture

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

- Interactive diagram: https://gitdiagram.com/soybeanjs/soybean-admin
- Repository: https://github.com/soybeanjs/soybean-admin

## Overview

SoybeanAdmin is a Vue 3 administrative dashboard template. The principal user workflow is to sign in, pass route authorization, load the permitted navigation and pages, and use dashboard and administration features within a configurable responsive layout. Supporting branches include theme and language settings, tabs and search, and API access. The graph follows documented capabilities and source-index references; unsampled implementation details are represented conservatively, and their connections are omitted where evidence is unavailable.

Main entry points: [`src/router/guard/route.ts`](https://github.com/soybeanjs/soybean-admin/blob/main/src/router/guard/route.ts) (Route guards), [`src/service/request/index.ts`](https://github.com/soybeanjs/soybean-admin/blob/main/src/service/request/index.ts) (API request layer), [`src/utils/storage.ts`](https://github.com/soybeanjs/soybean-admin/blob/main/src/utils/storage.ts) (Persistent storage), [`src/App.vue`](https://github.com/soybeanjs/soybean-admin/blob/main/src/App.vue) (App shell)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_startup["Application startup"]
  node_entry["Vue entry<br/>[main.ts]"]
  node_app["App shell<br/>[App.vue]"]
end

subgraph group_identity["Identity and navigation"]
  node_router["Router setup<br/>[index.ts]"]
  node_guard["Route guards<br/>[route.ts]"]
  node_login["Login flows<br/>[pwd-login.vue]"]
  node_auth["Authentication state<br/>[index.ts]"]
  node_route["Route and menu state<br/>[index.ts]"]
  node_route_transform["Route transformation<br/>[transform.ts]"]
end

subgraph group_workspace["Admin workspace"]
  node_layout["Responsive layouts<br/>[index.vue]"]
  node_menu["Navigation menu<br/>[index.vue]"]
  node_tabs["Page tabs<br/>[index.ts]"]
  node_search["Global search<br/>[search-modal.vue]"]
  node_theme_ui["Theme settings UI<br/>[index.vue]"]
  node_theme["Theme state<br/>[index.ts]"]
  node_app_state["App and locale state<br/>[index.ts]"]
  node_home["Dashboard<br/>[index.vue]"]
end

subgraph group_shared["Shared services"]
  node_api["API request layer<br/>[index.ts]"]
  node_auth_api["Auth and route APIs<br/>[auth.ts]"]
  node_storage[("Persistent storage<br/>[storage.ts]")]
  node_axios["HTTP client<br/>[shared.ts]"]
  node_i18n["Internationalization<br/>[app.ts]"]
end

node_user(("Administrator"))
node_backend{{"Admin backend"}}

node_user -->|"signs in"| node_login
node_entry -->|"mounts"| node_app
node_entry -->|"sets up"| node_router
node_app -->|"reads settings"| node_theme
node_app -->|"reads locale"| node_app_state
node_router -->|"registers"| node_guard
node_guard -->|"checks identity"| node_auth
node_guard -->|"initializes routes"| node_route
node_guard -->|"reads token"| node_storage
node_guard -->|"resolves route name"| node_route_transform
node_login -.->|"submits credentials"| node_auth
node_auth -->|"requests identity"| node_auth_api
node_route -->|"requests routes"| node_auth_api
node_auth_api -->|"uses requests"| node_api
node_api -->|"sends requests"| node_axios
node_api -->|"reads credentials"| node_storage
node_api -.->|"calls API"| node_backend
node_router -.->|"renders routes"| node_layout
node_layout -.->|"presents navigation"| node_menu
node_layout -.->|"presents tabs"| node_tabs
node_search -->|"searches menus"| node_route
node_theme_ui -.->|"configures appearance"| node_theme
node_theme -->|"persists settings"| node_storage
node_app_state -->|"persists preferences"| node_storage
node_user -->|"views dashboard"| node_home
node_i18n -->|"provides locale options"| node_app_state

click node_entry "https://github.com/soybeanjs/soybean-admin/blob/main/src/main.ts"
click node_app "https://github.com/soybeanjs/soybean-admin/blob/main/src/App.vue"
click node_router "https://github.com/soybeanjs/soybean-admin/blob/main/src/router/index.ts"
click node_guard "https://github.com/soybeanjs/soybean-admin/blob/main/src/router/guard/route.ts"
click node_login "https://github.com/soybeanjs/soybean-admin/blob/main/src/views/_builtin/login/modules/pwd-login.vue"
click node_auth "https://github.com/soybeanjs/soybean-admin/blob/main/src/store/modules/auth/index.ts"
click node_route "https://github.com/soybeanjs/soybean-admin/blob/main/src/store/modules/route/index.ts"
click node_route_transform "https://github.com/soybeanjs/soybean-admin/blob/main/src/router/elegant/transform.ts"
click node_api "https://github.com/soybeanjs/soybean-admin/blob/main/src/service/request/index.ts"
click node_auth_api "https://github.com/soybeanjs/soybean-admin/blob/main/src/service/api/auth.ts"
click node_layout "https://github.com/soybeanjs/soybean-admin/blob/main/src/layouts/base-layout/index.vue"
click node_menu "https://github.com/soybeanjs/soybean-admin/blob/main/src/layouts/modules/global-menu/index.vue"
click node_tabs "https://github.com/soybeanjs/soybean-admin/blob/main/src/store/modules/tab/index.ts"
click node_search "https://github.com/soybeanjs/soybean-admin/blob/main/src/layouts/modules/global-search/components/search-modal.vue"
click node_theme_ui "https://github.com/soybeanjs/soybean-admin/blob/main/src/layouts/modules/theme-drawer/index.vue"
click node_theme "https://github.com/soybeanjs/soybean-admin/blob/main/src/store/modules/theme/index.ts"
click node_app_state "https://github.com/soybeanjs/soybean-admin/blob/main/src/store/modules/app/index.ts"
click node_home "https://github.com/soybeanjs/soybean-admin/blob/main/src/views/home/index.vue"
click node_storage "https://github.com/soybeanjs/soybean-admin/blob/main/src/utils/storage.ts"
click node_axios "https://github.com/soybeanjs/soybean-admin/blob/main/packages/axios/src/shared.ts"
click node_i18n "https://github.com/soybeanjs/soybean-admin/blob/main/src/constants/app.ts"

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_entry,node_app toneBlue
class node_router,node_guard,node_login,node_auth,node_route,node_route_transform toneAmber
class node_layout,node_menu,node_tabs,node_search,node_theme_ui,node_theme,node_app_state,node_home toneMint
class node_api,node_auth_api,node_storage,node_axios,node_i18n toneRose
class node_user,node_backend toneIndigo
```

## Components

### Application startup

- [Vue entry](https://github.com/soybeanjs/soybean-admin/blob/main/src/main.ts): `src/main.ts`
- [App shell](https://github.com/soybeanjs/soybean-admin/blob/main/src/App.vue): `src/App.vue`

### Identity and navigation

- [Router setup](https://github.com/soybeanjs/soybean-admin/blob/main/src/router/index.ts): `src/router/index.ts`
- [Route guards](https://github.com/soybeanjs/soybean-admin/blob/main/src/router/guard/route.ts): `src/router/guard/route.ts`
- [Login flows](https://github.com/soybeanjs/soybean-admin/blob/main/src/views/_builtin/login/modules/pwd-login.vue): `src/views/_builtin/login/modules/pwd-login.vue`
- [Authentication state](https://github.com/soybeanjs/soybean-admin/blob/main/src/store/modules/auth/index.ts): `src/store/modules/auth/index.ts`
- [Route and menu state](https://github.com/soybeanjs/soybean-admin/blob/main/src/store/modules/route/index.ts): `src/store/modules/route/index.ts`
- [Route transformation](https://github.com/soybeanjs/soybean-admin/blob/main/src/router/elegant/transform.ts): `src/router/elegant/transform.ts`

### Admin workspace

- [Responsive layouts](https://github.com/soybeanjs/soybean-admin/blob/main/src/layouts/base-layout/index.vue): `src/layouts/base-layout/index.vue`
- [Navigation menu](https://github.com/soybeanjs/soybean-admin/blob/main/src/layouts/modules/global-menu/index.vue): `src/layouts/modules/global-menu/index.vue`
- [Page tabs](https://github.com/soybeanjs/soybean-admin/blob/main/src/store/modules/tab/index.ts): `src/store/modules/tab/index.ts`
- [Global search](https://github.com/soybeanjs/soybean-admin/blob/main/src/layouts/modules/global-search/components/search-modal.vue): `src/layouts/modules/global-search/components/search-modal.vue`
- [Theme settings UI](https://github.com/soybeanjs/soybean-admin/blob/main/src/layouts/modules/theme-drawer/index.vue): `src/layouts/modules/theme-drawer/index.vue`
- [Theme state](https://github.com/soybeanjs/soybean-admin/blob/main/src/store/modules/theme/index.ts): `src/store/modules/theme/index.ts`
- [App and locale state](https://github.com/soybeanjs/soybean-admin/blob/main/src/store/modules/app/index.ts): `src/store/modules/app/index.ts`
- [Dashboard](https://github.com/soybeanjs/soybean-admin/blob/main/src/views/home/index.vue): `src/views/home/index.vue`

### Shared services

- [API request layer](https://github.com/soybeanjs/soybean-admin/blob/main/src/service/request/index.ts): `src/service/request/index.ts`
- [Auth and route APIs](https://github.com/soybeanjs/soybean-admin/blob/main/src/service/api/auth.ts): `src/service/api/auth.ts`
- [Persistent storage](https://github.com/soybeanjs/soybean-admin/blob/main/src/utils/storage.ts): `src/utils/storage.ts`
- [HTTP client](https://github.com/soybeanjs/soybean-admin/blob/main/packages/axios/src/shared.ts): `packages/axios/src/shared.ts`
- [Internationalization](https://github.com/soybeanjs/soybean-admin/blob/main/src/constants/app.ts): `src/constants/app.ts`

### Other components

- **Administrator**
- **Admin backend**

## Connections

- Administrator → Login flows: signs in (evidence: `README.md`)
- Vue entry → App shell: mounts (evidence: `src/main.ts`)
- Vue entry → Router setup: sets up (evidence: `src/main.ts`)
- App shell → Theme state: reads settings (evidence: `src/App.vue`)
- App shell → App and locale state: reads locale (evidence: `src/App.vue`)
- Router setup → Route guards: registers (evidence: `src/router/index.ts`)
- Route guards → Authentication state: checks identity (evidence: `src/router/guard/route.ts`)
- Route guards → Route and menu state: initializes routes (evidence: `src/router/guard/route.ts`)
- Route guards → Persistent storage: reads token (evidence: `src/router/guard/route.ts`)
- Route guards → Route transformation: resolves route name (evidence: `src/router/guard/route.ts`)
- Login flows → Authentication state: submits credentials
- Authentication state → Auth and route APIs: requests identity (evidence: `src/store/modules/auth/index.ts`)
- Route and menu state → Auth and route APIs: requests routes (evidence: `src/store/modules/route/index.ts`)
- Auth and route APIs → API request layer: uses requests
- API request layer → HTTP client: sends requests (evidence: `src/service/request/index.ts`)
- API request layer → Persistent storage: reads credentials (evidence: `src/service/request/index.ts`)
- API request layer → Admin backend: calls API
- Router setup → Responsive layouts: renders routes
- Responsive layouts → Navigation menu: presents navigation
- Responsive layouts → Page tabs: presents tabs
- Global search → Route and menu state: searches menus (evidence: `src/layouts/modules/global-search/components/search-modal.vue`)
- Theme settings UI → Theme state: configures appearance
- Theme state → Persistent storage: persists settings (evidence: `src/store/modules/theme/index.ts`)
- App and locale state → Persistent storage: persists preferences (evidence: `src/store/modules/app/index.ts`)
- Administrator → Dashboard: views dashboard (evidence: `README.md`)
- Internationalization → App and locale state: provides locale options (evidence: `src/constants/app.ts`)
