# diandian18/react-antd-console architecture

> Architecture diagram of the GitHub repository diandian18/react-antd-console, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/diandian18/react-antd-console
- Repository: https://github.com/diandian18/react-antd-console

## Overview

react-antd-console is a React-based admin-console frontend starter. The user-facing path begins at application startup, which initializes mocks and localization, mounts the routed app, and renders configured pages inside an admin layout; authenticated access checks user permissions and builds session tabs. The console also provides menu, breadcrumb, theme, and table-page capabilities. The graph includes these documented product branches, but omits uncertain links where sampled source does not show who invokes a subsystem; unsampled features are represented only by supported paths.

Main entry points: [`src/router/config/index.tsx`](https://github.com/diandian18/react-antd-console/blob/master/src/router/config/index.tsx) (Route configuration), [`src/layouts/ConsoleLayout/index.tsx`](https://github.com/diandian18/react-antd-console/blob/master/src/layouts/ConsoleLayout/index.tsx) (Console layout), [`src/models/withAuth/index.ts`](https://github.com/diandian18/react-antd-console/blob/master/src/models/withAuth/index.ts) (Authentication and access), [`src/main.tsx`](https://github.com/diandian18/react-antd-console/blob/master/src/main.tsx) (Application startup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_routing["Routing and pages"]
  node_startup["Application startup<br/>[main.tsx]"]
  node_app["Routed app shell<br/>[App.tsx]"]
  node_router["Route engine<br/>[index.ts]"]
  node_route_config["Route configuration<br/>[index.tsx]"]
end

subgraph group_identity["Identity and permissions"]
  node_token_store[("Token persistence<br/>[token.ts]")]
  node_auth_model["Authentication and access<br/>[index.ts]"]
  node_permission_rules["Permission mapping<br/>[permissions.ts]"]
  node_login_service["Login service<br/>[login.ts]"]
  node_auth_service["User info service<br/>[withAuth.ts]"]
end

subgraph group_console["Console experience"]
  node_console_layout["Console layout<br/>[index.tsx]"]
  node_keep_alive["Page state cache<br/>[index.tsx]"]
  node_side_menu["Side menu<br/>[index.tsx]"]
  node_breadcrumb["Breadcrumbs<br/>[useBreadcrumb.ts]"]
  node_tabs["Draggable tabs<br/>[useTab.ts]"]
  node_tab_context["Tab context menu<br/>[useContextMenu.ts]"]
end

subgraph group_state["Application state and data"]
  node_theme_model["Theme settings<br/>[index.ts]"]
  node_antd_provider["Ant Design provider<br/>[Provider.tsx]"]
  node_base_model["Base application state<br/>[index.ts]"]
  node_http_client["HTTP client<br/>[index.ts]"]
end

subgraph group_examples["Business page examples"]
  node_table_page["Search and table page<br/>[index.tsx]"]
  node_table_demo["Table page example<br/>[index.tsx]"]
  node_home_demo["Home dashboard<br/>[index.tsx]"]
  node_dynamic_routes["Dynamic routes example<br/>[index.tsx]"]
  node_permission_demo["Permission examples"]
end

node_browser(("Browser user"))
node_api_service[("Backend API")]

node_browser -.->|"opens app"| node_startup
node_startup -->|"mounts"| node_app
node_startup -->|"wraps app"| node_antd_provider
node_app -->|"reads routes"| node_router
node_router -->|"loads config"| node_route_config
node_route_config -->|"routes through"| node_console_layout
node_route_config -->|"routes to"| node_home_demo
node_route_config -->|"routes to"| node_table_demo
node_route_config -->|"routes to"| node_dynamic_routes
node_route_config -->|"routes to"| node_permission_demo
node_console_layout -->|"renders"| node_keep_alive
node_console_layout -->|"renders"| node_side_menu
node_console_layout -->|"renders"| node_tabs
node_console_layout -.->|"includes"| node_breadcrumb
node_tabs -->|"uses menu hook"| node_tab_context
node_startup -->|"sets initial style"| node_theme_model
node_antd_provider -->|"reads theme"| node_theme_model
node_auth_model -->|"reads token"| node_token_store
node_auth_model -->|"requests user info"| node_auth_service
node_auth_model -->|"formats permissions"| node_permission_rules
node_auth_model -->|"requests logout"| node_login_service
node_auth_service -->|"calls HTTP"| node_http_client
node_http_client -->|"reads token"| node_token_store
node_http_client -.->|"sends requests"| node_api_service
node_table_demo -->|"renders"| node_table_page
node_table_demo -->|"navigates to detail"| node_router
node_table_page -.->|"loads list data"| node_api_service
node_home_demo -->|"reads auth state"| node_auth_model

click node_startup "https://github.com/diandian18/react-antd-console/blob/master/src/main.tsx"
click node_app "https://github.com/diandian18/react-antd-console/blob/master/src/App.tsx"
click node_router "https://github.com/diandian18/react-antd-console/blob/master/src/router/index.ts"
click node_route_config "https://github.com/diandian18/react-antd-console/blob/master/src/router/config/index.tsx"
click node_console_layout "https://github.com/diandian18/react-antd-console/blob/master/src/layouts/ConsoleLayout/index.tsx"
click node_keep_alive "https://github.com/diandian18/react-antd-console/blob/master/src/components/KeepAliveOutlet/index.tsx"
click node_side_menu "https://github.com/diandian18/react-antd-console/blob/master/src/layouts/SideMenu/index.tsx"
click node_breadcrumb "https://github.com/diandian18/react-antd-console/blob/master/src/layouts/Breadcrumb/useBreadcrumb.ts"
click node_tabs "https://github.com/diandian18/react-antd-console/blob/master/src/layouts/Tabs/useTab.ts"
click node_tab_context "https://github.com/diandian18/react-antd-console/blob/master/src/layouts/Tabs/ContextMenu/useContextMenu.ts"
click node_theme_model "https://github.com/diandian18/react-antd-console/blob/master/src/models/theme/index.ts"
click node_antd_provider "https://github.com/diandian18/react-antd-console/blob/master/src/components/AntdProvider/Provider.tsx"
click node_base_model "https://github.com/diandian18/react-antd-console/blob/master/src/models/base/index.ts"
click node_http_client "https://github.com/diandian18/react-antd-console/blob/master/src/http/index.ts"
click node_token_store "https://github.com/diandian18/react-antd-console/blob/master/src/utils/business/token.ts"
click node_auth_model "https://github.com/diandian18/react-antd-console/blob/master/src/models/withAuth/index.ts"
click node_permission_rules "https://github.com/diandian18/react-antd-console/blob/master/src/models/withAuth/permissions.ts"
click node_login_service "https://github.com/diandian18/react-antd-console/blob/master/src/services/login.ts"
click node_auth_service "https://github.com/diandian18/react-antd-console/blob/master/src/services/withAuth.ts"
click node_table_page "https://github.com/diandian18/react-antd-console/blob/master/src/components/TablePage/index.tsx"
click node_table_demo "https://github.com/diandian18/react-antd-console/blob/master/src/pages/tablePage/index.tsx"
click node_home_demo "https://github.com/diandian18/react-antd-console/blob/master/src/pages/home/index.tsx"
click node_dynamic_routes "https://github.com/diandian18/react-antd-console/blob/master/src/pages/router/dynamic/index.tsx"
click node_permission_demo "https://github.com/diandian18/react-antd-console/tree/master/src/pages/permission"

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_startup,node_app,node_router,node_route_config,node_browser toneBlue
class node_token_store,node_auth_model,node_permission_rules,node_login_service,node_auth_service,node_api_service toneAmber
class node_console_layout,node_keep_alive,node_side_menu,node_breadcrumb,node_tabs,node_tab_context toneMint
class node_theme_model,node_antd_provider,node_base_model,node_http_client toneRose
class node_table_page,node_table_demo,node_home_demo,node_dynamic_routes,node_permission_demo toneIndigo
```

## Components

### Routing and pages

- [Application startup](https://github.com/diandian18/react-antd-console/blob/master/src/main.tsx): `src/main.tsx`
- [Routed app shell](https://github.com/diandian18/react-antd-console/blob/master/src/App.tsx): `src/App.tsx`
- [Route engine](https://github.com/diandian18/react-antd-console/blob/master/src/router/index.ts): `src/router/index.ts`
- [Route configuration](https://github.com/diandian18/react-antd-console/blob/master/src/router/config/index.tsx): `src/router/config/index.tsx`

### Identity and permissions

- [Token persistence](https://github.com/diandian18/react-antd-console/blob/master/src/utils/business/token.ts): `src/utils/business/token.ts`
- [Authentication and access](https://github.com/diandian18/react-antd-console/blob/master/src/models/withAuth/index.ts): `src/models/withAuth/index.ts`
- [Permission mapping](https://github.com/diandian18/react-antd-console/blob/master/src/models/withAuth/permissions.ts): `src/models/withAuth/permissions.ts`
- [Login service](https://github.com/diandian18/react-antd-console/blob/master/src/services/login.ts): `src/services/login.ts`
- [User info service](https://github.com/diandian18/react-antd-console/blob/master/src/services/withAuth.ts): `src/services/withAuth.ts`

### Console experience

- [Console layout](https://github.com/diandian18/react-antd-console/blob/master/src/layouts/ConsoleLayout/index.tsx): `src/layouts/ConsoleLayout/index.tsx`
- [Page state cache](https://github.com/diandian18/react-antd-console/blob/master/src/components/KeepAliveOutlet/index.tsx): `src/components/KeepAliveOutlet/index.tsx`
- [Side menu](https://github.com/diandian18/react-antd-console/blob/master/src/layouts/SideMenu/index.tsx): `src/layouts/SideMenu/index.tsx`
- [Breadcrumbs](https://github.com/diandian18/react-antd-console/blob/master/src/layouts/Breadcrumb/useBreadcrumb.ts): `src/layouts/Breadcrumb/useBreadcrumb.ts`
- [Draggable tabs](https://github.com/diandian18/react-antd-console/blob/master/src/layouts/Tabs/useTab.ts): `src/layouts/Tabs/useTab.ts`
- [Tab context menu](https://github.com/diandian18/react-antd-console/blob/master/src/layouts/Tabs/ContextMenu/useContextMenu.ts): `src/layouts/Tabs/ContextMenu/useContextMenu.ts`

### Application state and data

- [Theme settings](https://github.com/diandian18/react-antd-console/blob/master/src/models/theme/index.ts): `src/models/theme/index.ts`
- [Ant Design provider](https://github.com/diandian18/react-antd-console/blob/master/src/components/AntdProvider/Provider.tsx): `src/components/AntdProvider/Provider.tsx`
- [Base application state](https://github.com/diandian18/react-antd-console/blob/master/src/models/base/index.ts): `src/models/base/index.ts`
- [HTTP client](https://github.com/diandian18/react-antd-console/blob/master/src/http/index.ts): `src/http/index.ts`

### Business page examples

- [Search and table page](https://github.com/diandian18/react-antd-console/blob/master/src/components/TablePage/index.tsx): `src/components/TablePage/index.tsx`
- [Table page example](https://github.com/diandian18/react-antd-console/blob/master/src/pages/tablePage/index.tsx): `src/pages/tablePage/index.tsx`
- [Home dashboard](https://github.com/diandian18/react-antd-console/blob/master/src/pages/home/index.tsx): `src/pages/home/index.tsx`
- [Dynamic routes example](https://github.com/diandian18/react-antd-console/blob/master/src/pages/router/dynamic/index.tsx): `src/pages/router/dynamic/index.tsx`
- [Permission examples](https://github.com/diandian18/react-antd-console/tree/master/src/pages/permission): `src/pages/permission`

### Other components

- **Browser user**
- **Backend API**

## Connections

- Browser user → Application startup: opens app
- Application startup → Routed app shell: mounts (evidence: `src/main.tsx`)
- Application startup → Ant Design provider: wraps app (evidence: `src/main.tsx`)
- Routed app shell → Route engine: reads routes (evidence: `src/App.tsx`)
- Route engine → Route configuration: loads config (evidence: `src/router/index.ts`)
- Route configuration → Console layout: routes through (evidence: `src/router/config/index.tsx`)
- Route configuration → Home dashboard: routes to (evidence: `src/router/config/index.tsx`)
- Route configuration → Table page example: routes to (evidence: `src/router/config/index.tsx`)
- Route configuration → Dynamic routes example: routes to (evidence: `src/router/config/index.tsx`)
- Route configuration → Permission examples: routes to (evidence: `src/router/config/index.tsx`)
- Console layout → Page state cache: renders (evidence: `src/layouts/ConsoleLayout/index.tsx`)
- Console layout → Side menu: renders (evidence: `src/layouts/ConsoleLayout/index.tsx`)
- Console layout → Draggable tabs: renders (evidence: `src/layouts/ConsoleLayout/index.tsx`)
- Console layout → Breadcrumbs: includes
- Draggable tabs → Tab context menu: uses menu hook (evidence: `src/layouts/Tabs/useTab.ts`)
- Application startup → Theme settings: sets initial style (evidence: `src/main.tsx`)
- Ant Design provider → Theme settings: reads theme (evidence: `src/components/AntdProvider/Provider.tsx`)
- Authentication and access → Token persistence: reads token (evidence: `src/models/withAuth/index.ts`)
- Authentication and access → User info service: requests user info (evidence: `src/models/withAuth/index.ts`)
- Authentication and access → Permission mapping: formats permissions (evidence: `src/models/withAuth/index.ts`)
- Authentication and access → Login service: requests logout (evidence: `src/models/withAuth/index.ts`)
- User info service → HTTP client: calls HTTP (evidence: `src/services/withAuth.ts`)
- HTTP client → Token persistence: reads token (evidence: `src/http/index.ts`)
- HTTP client → Backend API: sends requests
- Table page example → Search and table page: renders (evidence: `src/pages/tablePage/index.tsx`)
- Table page example → Route engine: navigates to detail (evidence: `src/pages/tablePage/index.tsx`)
- Search and table page → Backend API: loads list data
- Home dashboard → Authentication and access: reads auth state (evidence: `src/pages/home/index.tsx`)
