SmartAdmin Documentation

repository·master·Indexed 25 days ago

https://github.com/1024-lab/smart-admin

A high-performance, secure rapid development platform for enterprise applications. SmartAdmin provides full-stack solutions for web (Vue3, Vite5, Ant Design Vue 4.X) and mobile (uniapp), with a backend supporting Java 8/17 and SpringBoot 2/3. It is designed for cybersecurity compliance, meeting China's Level 3 Cybersecurity Protection (MLPS) and Data Security requirements, and supports a wide range of mainstream and domestic Chinese databases including MySQL, PostgreSQL, Dameng, Kingbase, OceanBase, and GaussDB.

Tokens
31.6K
Snippets
12
Records
211
Agent score
87%

What's inside SmartAdmin

  1. Overview of SmartAdmin

    master
    SmartAdmin is a high-quality rapid development platform designed for simplicity, efficiency, and security. It is built on a modern tech stack and is specifically designed to meet China's Level 3 Cybersecurity Protection (MLPS) and Data Security requirements. It supports both mainstream and domestic Chinese databases (such as Dameng, Kingbase, OceanBase, and GaussDB) and provides dual versions for both frontend (JavaScript/TypeScript) and backend (Java 8/17 with SpringBoot 2/3).
  2. Use the uni-data-picker component

    master

    The uni-data-picker component is a data selection component designed for single-column or multi-column cascading selection. It is ideal for use cases like address selection or category selection.

    Key features:

    • Supports unlimited columns (top tabs scroll horizontally if content exceeds screen width).
    • Supports both immediate data loading and lazy loading (e.g., loading district data only after a city is selected).
    • Compatible with local data, cloud-based static JSON, and uniCloud cloud database data.
    • Supports direct connection to uniCloud databases via JQL and integrates with DB Schema for automatic frontend page generation and server-side validation.

    Related components: uni-data-pickerview, uni-load-more.

  3. SmartAdmin Architecture and Best Practices

    master

    SmartAdmin follows specific architectural patterns and coding standards:

    Frontend Patterns:

    • Constant Maintenance: Uses vue-enum to avoid magic numbers.
    • Multi-environment Support: Provides 5 distinct environment configurations: local, dev, test, pre-release, and prod.
    • Layout: Uses a highly structured layout implementation.

    Backend Patterns:

    • Four-Layer Architecture: Organized into controller, service, manager, and dao layers.
    • Package Structure: High-quality Java package structure suitable for large, medium, and small projects.
    • Multi-environment: Maven-based environment configurations (dev, test, pre-release, prod).
    • System Hooks: Includes smart-reload for dynamic code execution without restarting the application.
    • Response Codes: Features a unique request response code maintenance system.
  4. SmartAdmin Technical Stack

    master

    The platform utilizes the following technologies:

    Frontend:

    • JavaScript/TypeScript
    • Vue3 + Vite5
    • Pinia
    • Ant Design Vue 4.X

    Mobile:

    • uniapp (Vue3 version) + uni-ui (Supports APP, Mini-programs, and H5)

    Backend:

    • Java 8/17
    • SpringBoot 2/3
    • Sa Token
    • Mybatis-plus
    • Supports mainstream (MySQL, PostgreSQL, SQL Server, Oracle) and domestic Chinese databases.
  5. Select and download database SQL scripts

    master

    SmartAdmin supports a wide range of databases, including international options like MySQL and PostgreSQL, as well as domestic Chinese databases like Dameng (DM8), KingBaseES, and GaussDB.

    • MySQL: The only free option available via Gitee. It supports Java 8 and Java 17.
    • Other Databases: Most other supported databases (PostgreSQL, SqlServer, Oracle, Dameng, KingBaseES, GaussDB, OpenGaussDB, ShenTong, VastData, OceanBase, and PolarDB) require purchase.
    • Compatibility: All listed databases support Java 8 and Java 17.
  6. Install and upgrade to mescroll uni_modules

    master

    The mescroll-uni component is a high-performance pull-to-refresh and load-more component for uni-app implemented via WXS and renderjs.

    Starting from version 1.3.5, it uses the uni_modules standard. This allows mescroll-body and mescroll-empty to follow the easycom specification, meaning you do not need to register them globally in main.js or manually import them in individual pages.

    Upgrading from versions prior to 1.3.5:

    1. Delete the old @/components/mescroll-uni component.
    2. Remove any mescroll component registrations from main.js.
    3. Import the latest mescroll component from the DCloud plugin market (1.3.5+ uni_modules version).
    4. Perform a global search for @/components/mescroll-uni/ and replace it with @/uni_modules/mescroll-uni/components/mescroll-uni/.
    5. Since mescroll-empty follows easycom, you can remove any manual import code for it in pages where it is used.
  7. Use the Employee Management View

    master

    The Employee Management view provides a split-pane interface for managing organizational employees. It consists of a DepartmentTree component on the left for navigation and an EmployeeList component on the right that displays employees based on the selected department.

    Key features:

    • Department Navigation: Uses DepartmentTree to select departments.
    • Dynamic Employee Listing: The EmployeeList component automatically updates its content via the departmentId prop whenever a new department is selected in the tree.
    • Breadcrumb Support: Provides breadcrumb data derived from the selected department tree node.