How lakernote/easy-admin works
Main Components
• Frontend Application: Located under the “web/admin” directory. It contains HTML files, CSS, JavaScript, and various static assets. This part handles the user interface (login pages, system views, charts, etc.) and interacts with the backend via REST APIs.
• Backend Service: The bulk of the Java source is stored in “src/main/java/com/laker/admin”. This includes multiple modules (e.g., “sys”, “ext”, “task”, “chat”, “flow”) and configurations. The backend is built as a Spring Boot application and uses a modular package structure. Key subcomponents include:
• Core application entry (EasyAdminApplication.java)
• Configuration classes (Spring configurations, thread pool, JWT or cache config, web MVC configuration, etc.)
• Feature modules (user management, department management, code generation, workflow, logging, task scheduling)
• AOP components (for metrics, rate limiting, trace, repeated submission prevention)
• Data access layers using Mybatis‑Plus (mappers and XML mapper files in “resources/mapper”)
• Database: The “sql” folder contains MySQL initialization scripts (e.g., easy-admin.sql) that set up the schema.
• Workflow Engine: Integration of Snakerflow (workflow related files/resources).
• Monitoring & API Documentation: Knife4j configuration and actuator endpoints, plus Javamelody integration for application monitoring.
• Auxiliary Components: Utility features such as locking (Redis and JDBC implementations), caching (Redis and in-memory), file storage (Local and Aliyun implementations), and code generation (CodeGenerator.java as an entry point for code generation).
• Deployment & DevOps: Dockerfile, docker-compose.yml, Jenkinsfile, assembly scripts (packaging into a ZIP), and Maven configuration (pom.xml) indicate how the app is built and deployed.
Relationships and Interactions
• The Frontend interacts with the Backend through REST APIs. Depending on the deployment mode, the web assets may be served directly from the Spring Boot jar or through a separate web server (like Nginx).
• The Backend processes business logic (such as authentication using sa‑token, permission control using RBAC, workflow management with Snakerflow, and data permissions via Mybatis‑Plus interceptors).
• AOP is used broadly in the backend to provide cross-cutting concerns (rate limiting, logging, tracing).
• The Database (MySQL) is accessed via Mybatis‑Plus; read and write operations flow from the backend service.
• External libraries (e.g., hutool for utilities, Knife4j for API docs) are integrated into the service layer.
• Deployment components (Docker, Jenkins pipelines) handle build, package, and deploy operations.
Architectural Patterns and Design Principles
• Modular Design: The project is broken into distinct modules (sys, ext, task, flow, chat) each addressing a specific function in the admin system.
• MVC Pattern: The backend uses Controllers (within modules like sys/controller) to handle HTTP requests, Service layers for business logic, and Mappers for data access.
• Separation of Concerns: With a clear separation between configuration, core framework logic (AOP, caching, locking), and feature modules.
• AOP for Cross-Cutting Concerns: Rate limiting, logging/tracing, and request validation are implemented as aspects.
• Flexible Deployment: The project supports single-package “fat jar” deployment as well as containerized deployment using Docker.
Technologies, Frameworks, or Libraries
• Spring Boot for the overall framework.
• Mybatis‑Plus for ORM and data access.
• Druid for database connection pooling.
• Knife4j for API documentation.
• sa‑token for authentication and authorization.
• Javamelody for monitoring.
• Snakerflow as the workflow engine.
• LayUI (plus Pear‑Admin and related front-end components) for the user interface.
• Maven for project management/build system.
• Docker and Jenkins for deployment and CI/CD.
Extra Details
• That the backend is built using Spring Boot running on an embedded Tomcat server.
• Optionally denote the use of AOP aspects (like RateLimitAspect, TraceAspect) in a distinct notation (such as annotations or side labels on the backend block).