# birdlark/larkmidtable architecture

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

- Interactive diagram: https://gitdiagram.com/birdlark/larkmidtable
- Repository: https://github.com/birdlark/larkmidtable

## Overview

##### Major Components
- Frontend/UI Layer: This is represented by the “larkmidtable-ui” directory. It is a single-page application (likely built with Vue.js) that provides all the visual interfaces (dashboards, login pages, data visualizations, etc.).
- Backend/Web Layer: This is primarily encapsulated in “larkmidtable-web” which is divided into submodules. In particular:
– The “larkmt-admin” module (Java-based with Spring and MyBatis) handles administrative functions, APIs, authentication/authorization, controller logic, and integration with business services.
– The “larkmt-core” module implements core business logic, service orchestration, and common utilities.
– The “larkmt-rpc” module provides remote procedure call infrastructure for communication between services (using strategies like load balancing, serialization, etc.).
- Documentation: The “larkmidtable-doc” directory holds various guides (user manual, developer notes, plugin development, etc.) that support both system understanding and eventual integrations.
- External Systems and Connectors: As noted in the README’s “产品技术选型” (Product Technical Selection) section, external systems include data warehouse components (clickhouse/doris), message brokers (Kafka), integration tools (datax/flinkx), stream processing (flink, flinkcdc, seatunnel), monitoring (prometheus), additional UI visualization (datart), and more. Although these do not appear as file submodules, they are important parts of the overall ecosystem.

##### Determining Relationships and Data Flow
- The “larkmt-core” module encapsulates core business handlers (job execution, scheduling, authorization, etc.) and interacts with the data layer (via MyBatis mappers and configuration files in “larkmt-admin/src/main/resources”). Show these as database symbols or data stores.
- Finally, indicate the external data services and big data components (clickhouse, doris, Kafka, etc.) as separate blocks communicating with the backend through connectors.

##### Architectural Patterns and Design Principles
- Modular Architecture: The split into UI, admin, core, and RPC modules reflects clear separation of concerns.

##### What
- Each major component as identified:
– Frontend (larkmidtable-ui)
– Backend’s administrative API/service layer (larkmt-admin)
– Business logic and core services (larkmt-core)
– RPC communication layer (larkmt-rpc)
– External Systems (clickhouse/doris, Kafka, data integration tools, etc.)
- Clear labels and descriptive titles for each component.
– From the UI to the admin controllers.
– From the admin controllers to core business services.
– Between core services and the RPC layer (if distributed calls are involved).
– Outbound from core services to external systems (databases, messaging systems, etc.).
- Annotations identifying key configurations (e.g., “pom.xml” indicates Maven-managed builds, “application.yml” for configuration, and “mybatis-mapper” for ORM mappings).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Presentation Layer
    subgraph "Presentation Layer"
        UI["LarkMidTable UI (Vue.js)"]:::ui
    end

    %% Application Layer
    subgraph "Application Layer"
        ADMIN["LarkMT-Admin (Spring/MVC)"]:::backend
        CORE["LarkMT-Core (Business Logic)"]:::backend
        RPC["LarkMT-RPC (Remote Procedure Call)"]:::backend
    end

    %% External Systems
    subgraph "External Systems"
        DB["Data Warehouse (ClickHouse/Doris)"]:::external
        MSG["Messaging (Kafka)"]:::external
        DATAINTG["Data Integration (DataX/FlinkX)"]:::external
        STREAM["Stream Processing (Flink/Seatunnel)"]:::external
        MONITOR["Monitoring (Prometheus)"]:::external
        VISUAL["UI Visualization (Datart)"]:::external
    end

    %% Documentation
    Documentation["Documentation: LarkMidTable Docs"]:::doc

    %% Connections between Layers
    UI -->|"API_calls"| ADMIN
    ADMIN -->|"Controller_forwards_to_Core"| CORE
    ADMIN -->|"Controller_forwards_to_RPC"| RPC

    %% Connections from Core to External Systems
    CORE -->|"Data_access"| DB
    CORE -->|"Message_publishing"| MSG
    CORE -->|"Data_integration"| DATAINTG
    CORE -->|"Stream_trigger"| STREAM
    CORE -->|"Monitoring_update"| MONITOR
    CORE -->|"Visualization_data"| VISUAL

    %% Click Events for Mapped Components
    click UI "https://github.com/birdlark/larkmidtable/tree/dev/larkmidtable-ui"
    click ADMIN "https://github.com/birdlark/larkmidtable/tree/dev/larkmidtable-web/larkmt-admin"
    click CORE "https://github.com/birdlark/larkmidtable/tree/dev/larkmidtable-web/larkmt-core"
    click RPC "https://github.com/birdlark/larkmidtable/tree/dev/larkmidtable-web/larkmt-rpc"
    click Documentation "https://github.com/birdlark/larkmidtable/tree/dev/larkmidtable-doc"

    %% Styles
    classDef ui fill:#DFF0D8,stroke:#3C763D,stroke-width:2px;
    classDef backend fill:#D9EDF7,stroke:#31708F,stroke-width:2px;
    classDef external fill:#FCF8E3,stroke:#8A6D3B,stroke-width:2px;
    classDef doc fill:#F2DEDE,stroke:#A94442,stroke-width:2px;
```
