How diandian18/react-antd-console works
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: config/index.tsx Route configuration · ConsoleLayout/index.tsx Console layout · index.ts Authentication and access · main.tsx Application startup
Components 26
Routing and pages
- Application startup
src/main.tsx - Routed app shell
src/App.tsx - Route engine
src/router/index.ts - Route configuration
src/router/config/index.tsx
Identity and permissions
- Token persistence
src/utils/business/token.ts - Authentication and access
src/models/withAuth/index.ts - Permission mapping
src/models/withAuth/permissions.ts - Login service
src/services/login.ts - User info service
src/services/withAuth.ts
Console experience
- Console layout
src/layouts/ConsoleLayout/index.tsx - Page state cache
src/components/KeepAliveOutlet/index.tsx - Side menu
src/layouts/SideMenu/index.tsx - Breadcrumbs
src/layouts/Breadcrumb/useBreadcrumb.ts - Draggable tabs
src/layouts/Tabs/useTab.ts - Tab context menu
src/layouts/Tabs/ContextMenu/useContextMenu.ts
Application state and data
- Theme settings
src/models/theme/index.ts - Ant Design provider
src/components/AntdProvider/Provider.tsx - Base application state
src/models/base/index.ts - HTTP client
src/http/index.ts
Business page examples
- Search and table page
src/components/TablePage/index.tsx - Table page example
src/pages/tablePage/index.tsx - Home dashboard
src/pages/home/index.tsx - Dynamic routes example
src/pages/router/dynamic/index.tsx - Permission examples
src/pages/permission
Other components
- Browser user
- Backend API
Connections 28
- Browser user → Application startup: opens app
- Application startup → Routed app shell: mounts
src/main.tsx - Application startup → Ant Design provider: wraps app
src/main.tsx - Routed app shell → Route engine: reads routes
src/App.tsx - Route engine → Route configuration: loads config
src/router/index.ts - Route configuration → Console layout: routes through
src/router/config/index.tsx - Route configuration → Home dashboard: routes to
src/router/config/index.tsx - Route configuration → Table page example: routes to
src/router/config/index.tsx - Route configuration → Dynamic routes example: routes to
src/router/config/index.tsx - Route configuration → Permission examples: routes to
src/router/config/index.tsx - Console layout → Page state cache: renders
src/layouts/ConsoleLayout/index.tsx - Console layout → Side menu: renders
src/layouts/ConsoleLayout/index.tsx - Console layout → Draggable tabs: renders
src/layouts/ConsoleLayout/index.tsx - Console layout → Breadcrumbs: includes
- Draggable tabs → Tab context menu: uses menu hook
src/layouts/Tabs/useTab.ts - Application startup → Theme settings: sets initial style
src/main.tsx - Ant Design provider → Theme settings: reads theme
src/components/AntdProvider/Provider.tsx - Authentication and access → Token persistence: reads token
src/models/withAuth/index.ts - Authentication and access → User info service: requests user info
src/models/withAuth/index.ts - Authentication and access → Permission mapping: formats permissions
src/models/withAuth/index.ts - Authentication and access → Login service: requests logout
src/models/withAuth/index.ts - User info service → HTTP client: calls HTTP
src/services/withAuth.ts - HTTP client → Token persistence: reads token
src/http/index.ts - HTTP client → Backend API: sends requests
- Table page example → Search and table page: renders
src/pages/tablePage/index.tsx - Table page example → Route engine: navigates to detail
src/pages/tablePage/index.tsx - Search and table page → Backend API: loads list data
- Home dashboard → Authentication and access: reads auth state
src/pages/home/index.tsx