# elunez/eladmin-mp architecture

> Architecture diagram of the GitHub repository elunez/eladmin-mp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/elunez/eladmin-mp
- Repository: https://github.com/elunez/eladmin-mp

## Overview

##### Main Components
a. Frontend (eladmin-web):
- Built using Vue.
- Contains application-wide assets, custom components (e.g., tables, charts, form elements), and views for dashboards, generators, monitoring, system configuration, etc.
- Manages UI routes, state management (using Vuex), and utilizes various configurable UI elements.

b. Backend Modules:
- eladmin-system: The core module; it is the entry point and handles critical business logic including login, authorization, system configuration, monitoring, and operational management.
- eladmin-common: Common utilities, base classes, and configuration definitions (including Mybatis-Plus, Redis, Swagger, and security-related aspects).
- eladmin-logging: Handles system and exception logging; provides centralized logging functionality.
- eladmin-tools: Integrates third-party services such as email, local and cloud storage (Qiniu), and Alipay payment; focuses on external integrations.
- eladmin-generator: A code generation module to quickly produce front and back CRUD interfaces.

c. Supporting Infrastructure:
- Database: Evidenced by the SQL scripts (eladmin.sql, quartz.sql) for system data and scheduled tasks.
- Caching: Uses Redis (with custom Redis configuration in common module).
- External Services: Integration with third-party services like email services, Qiniu (cloud storage), and Alipay.
- Security: JWT, Spring Security, and custom annotations for access control.

##### Relationships and Interactions
a. The Vue-based frontend (eladmin-web) communicates with the backend via RESTful API endpoints. It consumes JSON data from various modules (system, logging, tools, generator).
b. The eladmin-system module orchestrates the business logic and acts as the primary API provider.
c. The eladmin-common module underpins shared configurations and utilities used by nearly all backend modules, ensuring consistency (e.g., exception handling, encryption, logging support).
d. The logging module (eladmin-logging) captures and processes log messages from all backend interactions, feeding data back possibly to a monitoring dashboard in the frontend.
e. The tools and generator modules serve as support services for external integrations and developer operations, respectively.
f. The database serves as persistent storage with ORM configured via Mybatis-Plus, and there is integration with Redis for caching.

##### Architectural Patterns and Design Principles
a. Separation of Concerns: The system is modular – each component (or module) has a defined responsibility (e.g., logging, system core, code generation).
b. Frontend-Backend Separation: Clear demarcation between Vue (client interface) and Spring Boot (server-side API).
c. Micro-modularity within the backend: Even though it’s packaged as a monolithic application, the use of separate modules (common, system, logging, tools, generator) hints at a layered architecture.
d. Use of annotations and AOP (aspect-oriented programming): This is seen with custom security annotations, logging aspects, and exception handling.

##### Final Recommendations
- Every label is clear and every connection is justified with directional flows and interaction notes.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Layer
    subgraph "Frontend Layer"
        FE["Frontend (Vue)"]:::frontend
    end

    %% Backend Layer
    subgraph "Backend Layer"
        API["API Gateway (eladmin-system)"]:::backendCore
        COMMON["Common Utilities (eladmin-common)"]:::backendUtil
        LOG["Logging (eladmin-logging)"]:::backendUtil
        TOOLS["Integration Tools (eladmin-tools)"]:::backendUtil
        GEN["Code Generator (eladmin-generator)"]:::backendUtil
    end

    %% Infrastructure Layer
    subgraph "Infrastructure"
        subgraph "Database"
            DB["SQL Database"]:::external
            SCRIPT1["SQL Script: eladmin.sql"]:::external
            SCRIPT2["SQL Script: quartz.sql"]:::external
        end
        REDIS["Redis Cache"]:::external
        EXT["Third-Party Services\n(Email,Qiniu,Alipay)"]:::external
    end

    %% Connections
    FE -->|"REST"| API
    API -->|"uses"| COMMON
    API -->|"logs"| LOG
    API -->|"invokes"| TOOLS
    API -->|"generates"| GEN
    API -->|"persists"| DB
    API -->|"caches"| REDIS
    TOOLS -->|"integrates"| EXT

    %% Click Events
    click FE "https://github.com/elunez/eladmin-mp/tree/master/eladmin-web"
    click API "https://github.com/elunez/eladmin-mp/tree/master/eladmin/eladmin-system"
    click COMMON "https://github.com/elunez/eladmin-mp/tree/master/eladmin/eladmin-common"
    click LOG "https://github.com/elunez/eladmin-mp/tree/master/eladmin/eladmin-logging"
    click TOOLS "https://github.com/elunez/eladmin-mp/tree/master/eladmin/eladmin-tools"
    click GEN "https://github.com/elunez/eladmin-mp/tree/master/eladmin/eladmin-generator"
    click SCRIPT1 "https://github.com/elunez/eladmin-mp/blob/master/sql/eladmin.sql"
    click SCRIPT2 "https://github.com/elunez/eladmin-mp/blob/master/sql/quartz.sql"

    %% Styles
    classDef frontend fill:#cce5ff,stroke:#004085,stroke-width:2px;
    classDef backendCore fill:#d4edda,stroke:#155724,stroke-width:2px;
    classDef backendUtil fill:#ffeeba,stroke:#856404,stroke-width:2px;
    classDef external fill:#f8d7da,stroke:#721c24,stroke-width:2px;
```
