SmartAdmin Documentation
repository·master·Indexed 25 days ago
https://github.com/1024-lab/smart-adminA 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.
What's inside SmartAdmin
- 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).
Use the uni-data-picker component
masterThe
uni-data-pickercomponent 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.Use the uni-icons component
masterTheuni-iconscomponent is used to display icons within a uni-app project. In your templates, you can use the component via the code block nameuIcons.SmartAdmin Architecture and Best Practices
masterSmartAdmin follows specific architectural patterns and coding standards:
Frontend Patterns:
- Constant Maintenance: Uses
vue-enumto avoid magic numbers. - Multi-environment Support: Provides 5 distinct environment configurations:
local,dev,test,pre-release, andprod. - Layout: Uses a highly structured layout implementation.
Backend Patterns:
- Four-Layer Architecture: Organized into
controller,service,manager, anddaolayers. - 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-reloadfor dynamic code execution without restarting the application. - Response Codes: Features a unique request response code maintenance system.
- Constant Maintenance: Uses
SmartAdmin Technical Stack
masterThe 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.
Use uni-sass for global styling and layout
masterTheuni-sassmodule is a set of global styles provided byuni-ui. It allows you to perform simple page layout operations—such as managing colors, margins, and border radii—using a combination of simple class names andsassvariables.Use the uni-load-more component
masterTheuni-load-morecomponent (code block:uLoadMore) is used in lists to implement scroll-based loading. It provides visual feedback by displaying various loading states (e.g., loading, finished, or no more data) to the user during data fetching operations.Select and download database SQL scripts
masterSmartAdmin 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.
Initialize the MySQL database for SmartAdmin
masterIf you are performing a fresh deployment of SmartAdmin using MySQL, execute the SQL statements contained in thesmart_admin_v3.sqlfile to set up the required database schema.Install and upgrade to mescroll uni_modules
masterThe
mescroll-unicomponent 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_modulesstandard. This allowsmescroll-bodyandmescroll-emptyto follow theeasycomspecification, meaning you do not need to register them globally inmain.jsor manually import them in individual pages.Upgrading from versions prior to 1.3.5:
- Delete the old
@/components/mescroll-unicomponent. - Remove any
mescrollcomponent registrations frommain.js. - Import the latest
mescrollcomponent from the DCloud plugin market (1.3.5+uni_modulesversion). - Perform a global search for
@/components/mescroll-uni/and replace it with@/uni_modules/mescroll-uni/components/mescroll-uni/. - Since
mescroll-emptyfollowseasycom, you can remove any manual import code for it in pages where it is used.
- Delete the old
Update the MySQL database schema
masterTo update your existing SmartAdmin MySQL database during a version upgrade, execute the SQL scripts located in thesql-update-logdirectory. You must execute these scripts in ascending order based on their file version (from smallest to largest) to ensure data integrity and correct schema evolution.Use the Employee Management View
masterThe Employee Management view provides a split-pane interface for managing organizational employees. It consists of a
DepartmentTreecomponent on the left for navigation and anEmployeeListcomponent on the right that displays employees based on the selected department.Key features:
- Department Navigation: Uses
DepartmentTreeto select departments. - Dynamic Employee Listing: The
EmployeeListcomponent automatically updates its content via thedepartmentIdprop whenever a new department is selected in the tree. - Breadcrumb Support: Provides breadcrumb data derived from the selected department tree node.
- Department Navigation: Uses