# zxwk1998/vue-admin-better architecture

> Architecture diagram of the GitHub repository zxwk1998/vue-admin-better, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/zxwk1998/vue-admin-better
- Repository: https://github.com/zxwk1998/vue-admin-better

## Overview

##### Project Type and Purpose
This is a Vue.js-based admin dashboard framework (vue-admin-better) with both free and paid versions, focusing on providing a comprehensive administrative interface with RBAC permissions and multiple features.

##### Main System Components

Frontend Architecture:
**┌─────────────────────────────────────────────────────────────┐**
- Vue Admin Better                         │
- ┬───────────────────────────┬─────────────────┤
- Core Layer  │    Feature Modules        │  Layout Layer   │
- (Foundation)  │    (Functionality)        │  (UI Structure) │
- ┴───────────────────────────┴─────────────────┘

##### Detailed Component Breakdown

**┌─────────────────────────────────────────────────────────────────────┐**
- Frontend Architecture                      │
- ┬─────────────────────────┬─────────────────────────┤
- Core Layer    │    Feature Modules      │     Layout Layer        │
- ┼─────────────────────────┼─────────────────────────┤
- Vue.js        │ - Authentication        │ - VabSideBar           │
- Vuex Store    │ - RBAC Permissions      │ - VabTopBar            │
- Vue Router    │ - Error Logging         │ - VabTabsBar           │
- Axios Client  │ - User Management       │ - VabQueryForm         │
- Utils         │ - Role Management       │ - VabErrorLog          │
- ┴─────────────────────────┴─────────────────────────┘

##### Data Flow and Integration Points

**┌──────────────┐    ┌───────────────┐    ┌──────────────┐**
- API Layer   │◄───┤ Auth Service  │◄───┤  Frontend UI │
- (src/api)   │    │ (JWT + RBAC)  │    │  Components  │
- ┬───────┘    └───────────────┘    └──────────────┘
- ▲                    ▲

- ▼                    │                    │
**┌──────────────┐    ┌──────┴────────┐    ┌─────┴────────┐**
- Mock Data   │    │  Vuex Store   │    │   Layouts    │
- Services    │────►  Management   │────►   System     │
- ┘    └───────────────┘    └──────────────┘

##### Implementation Details
- Authentication flow with JWT
- RBAC permission control system
- Dynamic routing mechanism
- Error logging system
- Theme switching capability
- Responsive layout system

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        Browser["Browser"]
    end

    subgraph "Frontend Application"
        subgraph "Core Framework"
            Vue["Vue.js Base"]
            ElementUI["Element UI"]
            MainEntry["Main Entry"]:::file
            Router["Router Config"]:::file
            AppConfig["App Config"]:::file
            Plugins["Plugin Manager"]:::file
        end

        subgraph "Layout Components"
            SideBar["VabSideBar"]:::file
            TopBar["VabTopBar"]:::file
            TabsBar["VabTabsBar"]:::file
            AppMain["VabAppMain"]:::file
        end

        subgraph "Authentication & Authorization"
            JWT["JWT Handler"]:::file
            RBAC["RBAC System"]:::file
            PermConfig["Permission Config"]:::file
        end

        subgraph "State Management"
            UserStore["User Store"]:::file
            RoutesStore["Routes Store"]:::file
            SettingsStore["Settings Store"]:::file
            ErrorLogStore["Error Log Store"]:::file
            TabsStore["Tabs Bar Store"]:::file
        end

        subgraph "API Layer"
            RequestInt["Request Interceptors"]:::file
            APIEndpoints["API Endpoints"]:::dir
            MockService["Mock Service"]:::file
            MockControllers["Mock Controllers"]:::dir
        end

        subgraph "Theme & UI"
            ThemeConfig["Theme Config"]:::file
            ThemeComponents["Theme Bar"]:::file
            StyleVars["Style Variables"]:::file
        end

        subgraph "Security"
            Encryption["Encryption Utils"]:::file
            Validation["Validation Utils"]:::file
        end
    end

    %% Relationships
    Browser --> Vue
    Vue --> ElementUI
    Vue --> Router
    Router --> PermConfig
    PermConfig --> RBAC
    
    %% State Management Relations
    UserStore --> RequestInt
    RoutesStore --> Router
    
    %% Layout Relations
    SideBar --> AppMain
    TopBar --> AppMain
    TabsBar --> AppMain
    
    %% Security Flow
    RequestInt --> JWT
    JWT --> Encryption
    
    %% API Flow
    RequestInt --> MockService
    MockService --> MockControllers
    
    %% Theme Flow
    ThemeConfig --> ThemeComponents
    StyleVars --> ThemeComponents

    %% Click Events
    click SideBar "https://github.com/zxwk1998/vue-admin-better/blob/master/src/layouts/components/VabNavBar/index.vue"
    click TopBar "https://github.com/zxwk1998/vue-admin-better/blob/master/layouts/VabTopBar/index.vue"
    click TabsBar "https://github.com/zxwk1998/vue-admin-better/blob/master/layouts/VabTabsBar/index.vue"
    click AppMain "https://github.com/zxwk1998/vue-admin-better/blob/master/src/layouts/components/VabAppMain/index.vue"
    click JWT "https://github.com/zxwk1998/vue-admin-better/blob/master/src/utils/accessToken.js"
    click RBAC "https://github.com/zxwk1998/vue-admin-better/blob/master/layouts/Permissions/permissions.js"
    click PermConfig "https://github.com/zxwk1998/vue-admin-better/blob/master/src/config/permission.js"
    click UserStore "https://github.com/zxwk1998/vue-admin-better/blob/master/src/store/modules/user.js"
    click RoutesStore "https://github.com/zxwk1998/vue-admin-better/blob/master/src/store/modules/routes.js"
    click SettingsStore "https://github.com/zxwk1998/vue-admin-better/blob/master/src/store/modules/settings.js"
    click ErrorLogStore "https://github.com/zxwk1998/vue-admin-better/blob/master/src/store/modules/errorLog.js"
    click TabsStore "https://github.com/zxwk1998/vue-admin-better/blob/master/src/store/modules/tabsBar.js"
    click RequestInt "https://github.com/zxwk1998/vue-admin-better/blob/master/src/utils/request.js"
    click APIEndpoints "https://github.com/zxwk1998/vue-admin-better/tree/master/src/api/"
    click MockService "https://github.com/zxwk1998/vue-admin-better/blob/master/mock/index.js"
    click MockControllers "https://github.com/zxwk1998/vue-admin-better/tree/master/mock/controller/"
    click ThemeConfig "https://github.com/zxwk1998/vue-admin-better/blob/master/src/config/theme.config.js"
    click ThemeComponents "https://github.com/zxwk1998/vue-admin-better/blob/master/src/layouts/components/VabThemeBar/index.vue"
    click StyleVars "https://github.com/zxwk1998/vue-admin-better/blob/master/src/styles/variables.scss"
    click MainEntry "https://github.com/zxwk1998/vue-admin-better/blob/master/src/main.js"
    click Router "https://github.com/zxwk1998/vue-admin-better/blob/master/src/router/index.js"
    click AppConfig "https://github.com/zxwk1998/vue-admin-better/blob/master/src/config/index.js"
    click Plugins "https://github.com/zxwk1998/vue-admin-better/blob/master/src/plugins/index.js"
    click Encryption "https://github.com/zxwk1998/vue-admin-better/blob/master/src/utils/encrypt.js"
    click Validation "https://github.com/zxwk1998/vue-admin-better/blob/master/src/utils/validate.js"

    classDef default fill:#f9f9f9,stroke:#333,stroke-width:1px
    classDef file fill:#e1f7fa,stroke:#333,stroke-width:1px
    classDef dir fill:#fae1e1,stroke:#333,stroke-width:1px

    %% Legend
    subgraph Legend
        L1["Component"]:::default
        L2["File Component"]:::file
        L3["Directory"]:::dir
    end
```
