Vue Vben Admin

repository·main·Indexed 12 days ago

https://github.com/vbenjs/vue-vben-admin

A comprehensive open-source middle and back-end admin template built with Vue 3, Vite, and TypeScript. Version 5.7.0 features dynamic permissions, internationalization, and a production-ready foundation. It includes @vben/backend-mock for realistic frontend development and a flexible Cache module utilizing the Strategy Pattern with drivers for LocalStorage, IndexedDB, and Memory storage.

Tokens
229K
Snippets
768
Records
1K
Agent score
98%

What's inside Vue Vben Admin

  1. Overview of Vue Vben Admin features

    main

    Vue Vben Admin is an upgraded open-source mid-to-back-office template built with modern web technologies. Key features include:

    • Modern Tech Stack: Built using Vue 3, Vite, and TypeScript.
    • Theming: Supports multiple color themes and custom theme configuration.
    • Internationalization (i18n): Includes a complete built-in internationalization solution.
    • Permissions: Features a robust built-in dynamic route permission generation system.
    • Browser Support: Supports modern browsers (Edge, Firefox, Chrome, Safari). Note that it does not support Internet Explorer. Tailwind CSS v4.0 requirements: Safari 16.4+, Chrome 111+, and Firefox 128+.
  2. Overview of Vben Admin features

    main

    Vben Admin is an enterprise-level management system framework built on a modern technology stack. Key features include:

    • Latest Technology Stack: Utilizes Vue3, Pinia, Vue Router, and TypeScript.
    • Rich Configurations: Provides a wealth of components, templates, and preference settings for middle and back-end systems.
    • Theme Customization: Supports easy switching between various themes via configuration.
    • Internationalization: Built-in support for multiple languages.
    • Access Control: Built-in solutions for various permission management methods.
    • Modern Build Tools: Powered by Vite for fast development and Nitro Mock for powerful mock services.
    • UI Framework Support: Core is built on Shadcn UI and TailwindCSS, but designed to support various UI frameworks.
    • Monorepo Architecture: Uses a standardized monorepo structure with pnpm and Turbo Repo for enterprise-level development standards.
  3. Overview of Vben Admin

    main

    Vben Admin is a professional mid-to-large scale enterprise-level back-office solution built on Vue 3.0, Vite, and TypeScript. It is designed to be used as a project starter template or a learning resource for modern frontend technologies.

    Key features include:

    • Comprehensive Tooling: Pre-configured components, utils, hooks, and dynamic menus.
    • Security: Robust permission verification system, including button-level access control.
    • Customization: Built-in internationalization (i18n), multi-theme support (including dark mode), and dynamic menu configuration based on permissions.
    • Data Mocking: High-performance local mock data solution based on Nitro.
    • Multi-UI Library Support: Unlike many templates, Vben Admin is not tied to a single framework; it supports Ant Design Vue, Ant Design Vue Next, Element Plus, Naive UI, and TDesign.
    • Engineering Excellence: Uses Pnpm Monorepo, Turborepo, and Changeset for efficient development and code quality enforcement via Oxfmt, Oxlint, ESLint, Stylelint, Publint, and CSpell.
  4. Overview of @vben/backend-mock

    main

    @vben/backend-mock is a data mocking service for Vben Admin. It provides simulated data to support frontend development without requiring a real database connection.

    Key characteristics:

    • Simulated Environment: All data is mocked; it does not connect to any database.
    • Real Backend Implementation: Unlike traditional mock.js tools, this uses a real backend service to overcome limitations like file uploads and complex logic simulation, allowing for a more realistic development environment.
    • Automatic Integration: The service is integrated into the Vite plugin and starts automatically with the application; you do not need to start it manually.
    • Production Note: Mock integration is not provided in production environments. For production, you should deploy your own service or connect to real data APIs.
  5. Overview of Vben Admin Components

    main

    Vben Admin provides a suite of framework components designed to simplify common UI tasks. These components are categorized into two main types:

    1. Layout Components: Top-level container components used in the page content area to provide unified layout styles and basic structural functionality.
    2. General Components: Frequently used UI elements such as Modals (弹窗), Drawers (抽屉), and Forms (表单).

    Most general components are implemented using Tailwind CSS, making them compatible with various UI component libraries. The framework is designed to be non-restrictive; you are encouraged to use native components or build your own if the provided abstractions do not meet your specific requirements.

  6. Switching between supported UI frameworks

    main

    Vben Admin provides built-in support for multiple UI frameworks. While the default demo site uses Ant Design Vue, you can choose from several pre-configured versions depending on your preference:

    • Ant Design Vue (Default)
    • Element Plus
    • Naive UI

    Users can select the version that best fits their project requirements by using the corresponding package/app provided in the monorepo.

  7. Extend internationalization (i18n) functionality

    main

    The locales directory is used to extend the internationalization capabilities of the application. This includes:

    1. Extending third-party libraries: Configuring multi-language support for libraries like dayjs or component libraries like antd.
    2. Application-specific translations: Managing the application's own i18n translation files.

    Each application within the monorepo may implement different internationalization requirements.

  8. Core technology stack of Vue Vben Admin

    main

    Vue Vben Admin is built on a modern frontend stack designed for high efficiency and maintainability. When building on top of this framework, you are working with:

    • Vue 3: The core reactive framework.
    • Vite: The build tool and development server.
    • TypeScript: For type-safe development.

    The framework aims to minimize boilerplate and allow developers to focus on business logic rather than infrastructure configuration.

  9. Use Vben Alert for lightweight interactions

    main

    The Alert component provides a set of lightweight, pure JavaScript-callable dialogs. It is designed for quick interactions such as simple alerts, confirmations, and prompts.

    When to use:

    • Use Alert for temporary confirmations, simple notifications, and lightweight user input.
    • Use Vben Modal for complex dialogs or heavy UI requirements.

    Note on HMR: Dialogs created dynamically via alert, confirm, or prompt do not support Hot Module Replacement (HMR). If you modify the code related to an open dialog, you must close the dialog and reopen it to see the changes.