How running-elephant/datart works
Main Components
• Backend Services: Split into several modules:
– Core Business Logic: Found inside the “core” directory, which contains many base classes, utilities, data provider logic, cluster management, entity definitions, and database migrations.
– Server API Controllers & Services: In the “server” directory, you have controllers, DTOs, service layers, and REST endpoints. This module handles client communication, business logic, job scheduling (like email, schema sync, schedule jobs) and integration with plugins.
– Security Module: The “security” directory encapsulates security aspects such as authentication (OAuth2, JWT, and Shiro-based implementations), permission management, and encryption utilities.
– Data Providers & Plugins: The “data-providers” module (with subfolders such as “jdbc-data-provider”, “http-data-provider”, etc.) shows that external data source integration is achieved via pluggable providers following a standardized interface. Also include “file-data-provider” as an example plugin.
• Database & Persistence: Although not explicitly shown as a database directory, the numerous “migration” scripts, MyBatis configurations, and “application.yml” indicate that a relational database is used for persistence.
• External Systems & Integration: You might also include integration points such as external authentication (oauth2, third-party clients like DingTalk and WeChart) and plugin registration endpoints, as shown in the “security” and “server” areas.
• Jobs & Batch Processes: Part of the server module includes scheduled tasks (jobs) for email sending, schema sync, etc.
Relationships and Interactions
• The Frontend SPA communicates with the Backend’s RESTful API endpoints for operations such as authentication, dashboard/chart retrieval, chart configurations, data fetches, and data updates.
• The Server layer coordinates with the Core Logic and Plugin/Data Provider modules. The Core business logic parses requests, executes business rules, and formats responses.
• The Security module (comprising of Shiro, JWT utilities, OAuth2 clients, etc.) interposes on requests to enforce authentication and authorization. This module integrates with both the frontend (for JWT tokens and login forms) and backend controllers.
• Data Providers act as pluggable connectors that transform raw data from external data sources into a format that the Core logic understands. They interface with external databases or HTTP sources.
• Scheduled Jobs and tasks run on the server to perform asynchronous operations such as sending notifications or synchronizing schema changes.
• The persistence layer (database) stores metadata such as user profiles, dashboards, charts, organizational settings, permissions, etc. The backend uses MyBatis for database access, as evident from mapper files and migration scripts.
Architectural Patterns & Design Principles
• Layered and Modular Architecture: The design clearly separates presentation (frontend SPA) from business logic (server/core) and from data integration (data providers). It also abstracts security, making it extensible.
• Plugin / Extensibility: There is a standardized SDK/interface for data providers and chart plugins, reinforcing the project’s “开放” (openness) and “可塑” (integrability) philosophy.
• Service-Oriented or RESTful API design: The presence of controllers, DTOs, and defined API endpoints support loosely coupled interactions between frontend and backend.
• Standardized Processes: As noted in the README, the platform adheres to a Source > View > Chart > Visualization flow for managed development of visualization apps.