# gcpaas/dataroom architecture

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

- Interactive diagram: https://gitdiagram.com/gcpaas/dataroom
- Repository: https://github.com/gcpaas/dataroom

## Overview

##### Components Identification
- Frontend/UI Layer: Represented by the “data-room-ui” folder and its extensive “packages” subdirectory. This part houses the UI components, dashboards, designer modules (big screen design, demo pages), and utilities (configuration files, npm scripts, assets).
- Backend/API Layer: Composed of the “DataRoom/dataroom-core” and “DataRoom/dataroom-server” directories. This layer contains the core business logic, REST controllers, service interfaces and their implementations, exception handling, and configuration classes. It also includes modules such as:
– Basic module: Handling pages and previews.
– Biz, chart, file, map, template, type, and permission modules.
– Utility and configuration packages for FTP, SFTP, Minio, and other integrations.
- Data Sources/Connector Modules: Show external data connections (e.g., SQL data, ElasticSearch, HTTP, JS/Groovy scripts) that are handled via dedicated modules and configuration beans (notice the different config packages and bean classes for FTP, SFTP, and Minio).
- External & Third-Party Services: Represent the integration points such as external authentication (e.g., Shiro, Security integration as mentioned) and the external resource libraries (for logos, images, etc.) that can be hosted separately.

##### Relationships and Data Flow
- Frontend interacts with the Backend’s REST APIs (from DataRoom/dataroom-server), sending requests for operations such as big screen management, design saving/updating, preview requests, and data fetches.
- The back end orchestrates various modules (from the core package) to process file uploads, manage datasets, schedule tasks (like preview clear tasks), and forward commands to underlying data sources.
- Persistence: The service layer communicates with the database (e.g., MySQL, Oracle) using MyBatisPlus and employs exception handling and custom permissions to protect data.
- External integration points such as file storage (FTP/SFTP/Minio) and data source adapters provide connectors between data-level operations and the business logic.
- Deployment: Docker configuration and script files indicate containerization for deployment.

##### Architectural Patterns and Design Principles
- MVC Pattern in the back end: Controllers (REST endpoints) → Services → DAOs.
- Modularization: The back end is divided by functionality into modules (basic, chart, file, map, template, type, permission, etc.), each encapsulating its own logic.
- Separation of Concerns: Clear division between visual UI components (Vue modules in “data-room-ui”), business logic (core modules), and infrastructure (data access and configuration).
- Extensibility: The heavy use of “packages” in the UI implies that new visual components or dashboards can be plugged in easily.

##### Additional Key Details
- Multi-layered integration (UI components, business logic, persistence, external interfaces).
- How the file structure reflects a “plugin-like” architecture in the UI (see the extensive “packages” folder with many independent component directories).
- Scheduling tasks (like PreviewClearTask) and configuration management (DataRoomConfig, Cors configurations, SwaggerBootstrapConfig).

– Include intermediary data flows through RESTful APIs.
– For a more detailed design, break down the backend layer into multiple modules (each representing a functionality area such as chart, file, map, etc.) and show how they interact with the persistence layer and external data sources.
– Incorporate deployment artifacts (Dockerfile, scripts) as part of the infrastructure layer.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Layer
    subgraph "Frontend Layer"
        F1["Frontend – DataRoom UI"]:::frontend
        F2["UI Packages"]:::frontend
    end

    %% Backend Layer
    subgraph "Backend Layer"
        B1["Backend - DataRoom Core"]:::backend
        B2["Backend - DataRoom Server"]:::backend
    end

    %% Persistence & Data Integration
    subgraph "Persistence & Data Integration"
        P1["Business Modules (Basic,Chart,File,Map,Template,Type)"]:::persistence
        P2["Database (MySQL/Oracle)"]:::persistence
    end

    %% Data Sources/Connector Modules
    subgraph "Data Sources & Connector Modules"
        DS["FTP/SFTP/Minio Connectors"]:::connector
    end

    %% External & Third-Party Services
    subgraph "External & Third-Party Services"
        E1["Permissions & External Auth"]:::external
    end

    %% Deployment Environment
    subgraph "Deployment Environment"
        D1["Dockerfile"]:::deployment
        D2["dockerBuild.sh"]:::deployment
        D3["Doc Docker"]:::deployment
    end

    %% Relationships
    F1 -->|"REST_API"| B2
    F1 -->|"contains"| F2
    B2 -->|"Delegates"| B1
    B1 -->|"UsesModules"| P1
    P1 -->|"DAO_Calls"| P2
    B1 -->|"Integrates"| DS
    B1 -->|"Handles"| E1
    B2 -->|"ContainerizedAs"| D1
    B2 -->|"ContainerizedAs"| D2
    B2 -->|"ContainerizedAs"| D3

    %% Click Events
    click F1 "https://github.com/gcpaas/dataroom/tree/master/data-room-ui/"
    click F2 "https://github.com/gcpaas/dataroom/tree/master/data-room-ui/packages"
    click B1 "https://github.com/gcpaas/dataroom/tree/master/DataRoom/dataroom-core/"
    click B2 "https://github.com/gcpaas/dataroom/tree/master/DataRoom/dataroom-server/"
    click P1 "https://github.com/gcpaas/dataroom/tree/master/DataRoom/dataroom-core/src/main/java/com/gccloud/dataroom/core/module"
    click DS "https://github.com/gcpaas/dataroom/tree/master/DataRoom/dataroom-core/src/main/java/com/gccloud/dataroom/core/config/bean"
    click E1 "https://github.com/gcpaas/dataroom/tree/master/DataRoom/dataroom-core/src/main/java/com/gccloud/dataroom/core/permission"
    click D1 "https://github.com/gcpaas/dataroom/tree/master/Dockerfile"
    click D2 "https://github.com/gcpaas/dataroom/blob/master/dockerBuild.sh"
    click D3 "https://github.com/gcpaas/dataroom/tree/master/doc/docker/"

    %% Styles
    classDef frontend fill:#cce5ff,stroke:#004085,stroke-width:2px;
    classDef backend fill:#d4edda,stroke:#155724,stroke-width:2px;
    classDef persistence fill:#f8d7da,stroke:#721c24,stroke-width:2px;
    classDef connector fill:#fff3cd,stroke:#856404,stroke-width:2px;
    classDef external fill:#e2e3e5,stroke:#6c757d,stroke-width:2px;
    classDef deployment fill:#d1ecf1,stroke:#0c5460,stroke-width:2px;
```
