ELADMIN Administration Management System

repository·master·Indexed 12 days ago

https://github.com/elunez/eladmin

A full-stack administration management system built with Spring Boot 2.7.18 and Vue.js. It features a decoupled architecture providing tools for user and permission management, one-click CRUD code generation, interface rate limiting, and system monitoring. The system integrates Spring Data JPA, JWT, Spring Security, Redis, and Quartz for task scheduling, and supports Amazon S3 compatible object storage and Alipay integration.

Tokens
1.3K
Snippets
3
Records
6
Agent score
48%

What's inside ELADMIN

  1. Overview of ELADMIN

    master

    ELADMIN is a decoupled (front-end and back-end) administration management system. It is built using a modern technology stack designed for high efficiency and rapid development.

    Core Technology Stack:

    • Backend: Spring Boot 2.7.18, Spring Data JPA, JWT, Spring Security, Redis.
    • Frontend: Vue.js.

    Key Features:

    • Code Generation: One-click generation of both front-end and back-end CRUD code.
    • Permission Management: Supports interface-level functional permissions and data permissions with custom annotations.
    • Data Dictionary: Easy management of system states and fixed data.
    • Rate Limiting: Built-in interface rate limiting to prevent malicious requests.
    • Monitoring: Includes online user management, server performance monitoring, and SQL monitoring (via Druid).
    • Storage & Payments: Supports Amazon S3 compatible object storage (e.g., Qiniu, Alibaba Cloud) and Alipay integration.
    • Task Scheduling: Integrated Quartz for scheduled tasks with visible execution logs.
  2. Understand the ELADMIN Project Structure

    master

    The project is organized into functional modules to facilitate maintenance and extension:

    Backend Modules

    • eladmin-common: Contains public utilities, common configurations (Web, Redis, Redisson, Async Thread Pools), custom annotations, aspects, base Entity/DTO classes, and unified exception handling.
    • eladmin-system: The core module and the application entry point. It contains the sysrunner (for data processing on startup) and various system modules like login authorization, monitoring, and task scheduling.
    • eladmin-logging: A dedicated module for system logging. Other modules should include this to record logs.
    • eladmin-tools: Third-party integration tools including Email, Amazon S3 compatible storage, Alipay, and Local Storage.
    • eladmin-generator: The code generation engine used to produce CRUD code for both front-end and back-end.
  3. Reference: eladmin-common Utilities

    master

    The eladmin-common module provides several utility classes used throughout the system:

    UtilityDescription
    BigDecimaUtilsFinancial/Amount calculation tools
    RequestHolderRequest handling tools
    SecurityUtilsSecurity and authentication utilities
    StringUtilsString manipulation tools
    SpringBeanHolderSpring Bean access tools
    RedisUtilsRedis operations
    EncryptUtilsEncryption and decryption
    FileUtilFile system operations
  4. The App entity model

    master

    The App class is a JPA entity representing an application within the maintenance module. It maps to the mnt_app database table and extends BaseEntity to include standard audit fields (like creation/update timestamps).

    Use this model to manage application-specific deployment metadata, including network ports, file paths for uploads, deployments, and backups, as well as shell scripts for lifecycle management.

    @Entity
    @Getter
    @Setter
    @Table(name="mnt_app")
    public class App extends BaseEntity implements Serializable {
        @Id
        @Column(name = "app_id")
        @GeneratedValue(strategy = GenerationType.IDENTITY)
        private Long id;
    
        private String name;
        private int port;
        private String uploadPath;
        private String deployPath;
        private String backupPath;
        private String startScript;
        private String deployScript;
    }
  5. Copy properties to an App instance

    master

    The App class provides a copy(App source) method to perform a partial update or clone. It uses BeanUtil.copyProperties with CopyOptions.create().setIgnoreNullValue(true), meaning only non-null fields from the source object will be applied to the current instance. This is useful for updating existing records with data from a DTO while preserving existing values for omitted fields.

    // Example: Updating an existing app with new values from a source object
    App existingApp = appRepository.findById(1L).orElseThrow();
    App updateData = new App();
    updateData.setName("New App Name");
    // updateData.setPort(0); // This would be ignored because it's null/default if not set
    
    existingApp.copy(updateData);
    appRepository.save(existingApp);