# luke0630/minecraftservermanager architecture

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

- Interactive diagram: https://gitdiagram.com/luke0630/minecraftservermanager
- Repository: https://github.com/luke0630/minecraftservermanager

## Overview

##### Main Components
- Core Manager Module: Represented by the classes in the "org.manager" package (including CallBack, Data, and Utility classes). These classes encapsulate the core business logic required to monitor the Minecraft servers.
- Web Application (Backend): Under "WebApp/Backend," this component includes APIController, Application, and configuration classes (like WebConfig). This layer provides the RESTful API endpoints and handles web server responsibilities.
- Frontend Application: Found under "WebApp/Fronted" with Vue components (App.vue, ServerList.vue, HelloWorld.vue, etc.), configuration files (babel.config.js, vue.config.js), and public assets. It serves as the user interface that renders the server status and additional information.
- WebSocket Servers: Located in the "WebSocket" folder (e.g., APIWebsocketServer and LunchWebSocketServer), these classes provide real-time communication channels for push notifications or live updates.
- Configuration & Static Resources: The "src/main/resources" folder provides configuration (config.yml for server lists and port numbers) and static files (CSS, JS, HTML) that are served as part of the frontend.
- External Integration: The README mentions integration with the "PlaceholderAPI" via StatusReporter, meaning that external Minecraft plugins also interact with this software.

##### Relationships and Interactions
- The Main module (initiated via Main.java) boots up the application, loading configuration files (e.g., config.yml) and initializing the various components (backend server, WebSocket servers, and so on).
- The Backend Web Application exposes REST APIs. It interacts with the Core Manager module to retrieve the server monitoring data that is then consumed by the Frontend.
- The Frontend Vue application consumes these REST APIs and might also establish WebSocket connections to get live updates.
- Communication flows:
- Data flow from the Minecraft servers into the Core Manager (via Message/Data classes) and then to the API controllers.
- API Controllers provide data to the Frontend, shown as status information and lists.
- WebSocket components push live updates to the Frontend.
- Integration with external plugins (like StatusReporter) ensures that data is pushed from Minecraft servers into this management system.

##### Architectural Patterns and Design Principles
- Layered Architecture: The project separates concerns by dividing into Core Logic, API/Backend Services, and a Frontend User Interface.
- MVC/MVVM Elements: The WebApp/Backend follows MVC principles (API controllers, configuration classes), and the Frontend (Vue components) uses an MVVM-like approach.
- Asynchronous Communication: Utilization of WebSockets to provide real-time updates in addition to standard REST communication.
- Configuration Driven: The use of external YAML configuration (config.yml) for server lists and port numbering emphasizes flexibility and ease of customization.

##### Relevant Technologies and Frameworks
- Java and Maven for dependency management and project building.
- Spring-like (or similar) Java web framework for the Backend (inferred from the existence of WebConfig and APIController) even if not explicitly mentioned.
- Vue.js and Node.js (via package.json, babel.config.js, etc.) for the Frontend components.
- WebSocket protocol for real-time data push (implemented in dedicated classes within the WebSocket package).

## Diagram (Mermaid)

```mermaid
flowchart TD
    Main["Main.java"]:::main

    %% Configuration & Static Resources Subgraph
    subgraph "Configuration & Static Resources"
        ConfigYML["config.yml"]:::config
        StaticAssets["Static Assets"]:::config
    end

    %% Core Manager/Business Logic Subgraph
    subgraph "Core Manager/Business Logic"
        CoreMgr["Core Manager Module"]:::core
        Callback["Callback"]:::core
        Data["Data Handler"]:::core
        Utility["Utility"]:::core
    end

    %% Backend API Server Subgraph
    subgraph "Backend API Server"
        APIController["APIController"]:::backend
        Application["Application"]:::backend
        WebConfig["WebConfig"]:::backend
    end

    %% WebSocket Service Subgraph
    subgraph "WebSocket Service"
        APIWS["APIWebsocketServer"]:::websocket
        LunchWS["LunchWebSocketServer"]:::websocket
    end

    %% Frontend UI Subgraph
    subgraph "Frontend UI"
        AppVue["App.vue"]:::frontend
        ServerList["ServerList.vue"]:::frontend
        HelloWorld["HelloWorld.vue"]:::frontend
        BabelConfig["babel.config.js"]:::frontend
        VueConfig["vue.config.js"]:::frontend
    end

    %% External Integration
    External["StatusReporter (PlaceholderAPI)"]:::external

    %% Connections from Main
    Main -->|"loads"| ConfigYML
    Main -->|"loads"| StaticAssets
    Main -->|"initializes"| CoreMgr
    Main -->|"starts"| APIController
    Main -->|"starts"| Application
    Main -->|"starts"| WebConfig
    Main -->|"starts"| APIWS
    Main -->|"starts"| LunchWS

    %% Internal connections within Core Manager
    CoreMgr --> Callback
    CoreMgr --> Data
    CoreMgr --> Utility

    %% Communication between components
    APIController -->|"queries"| CoreMgr
    Application -->|"queries"| CoreMgr
    WebConfig -->|"configures"| CoreMgr

    APIController ---|"REST_call"| AppVue
    APIController ---|"REST_call"| ServerList
    APIController ---|"REST_call"| HelloWorld

    APIController ---|"REST_call"| BabelConfig
    APIController ---|"REST_call"| VueConfig

    APIWS -->|"pushes_updates"| AppVue
    APIWS -->|"pushes_updates"| ServerList
    LunchWS -->|"pushes_updates"| HelloWorld
    LunchWS -->|"pushes_updates"| BabelConfig
    LunchWS -->|"pushes_updates"| VueConfig

    External -->|"integrates"| CoreMgr

    %% Click Events for Core Manager Module and its files
    click CoreMgr "https://github.com/luke0630/minecraftservermanager/tree/main/src/main/java/org/manager"
    click Callback "https://github.com/luke0630/minecraftservermanager/blob/main/src/main/java/org/manager/CallBack.java"
    click Data "https://github.com/luke0630/minecraftservermanager/blob/main/src/main/java/org/manager/Data.java"
    click Utility "https://github.com/luke0630/minecraftservermanager/blob/main/src/main/java/org/manager/Utility.java"

    %% Click Events for Backend API Server files
    click APIController "https://github.com/luke0630/minecraftservermanager/blob/main/src/main/java/org/manager/WebApp/Backend/APIController.java"
    click Application "https://github.com/luke0630/minecraftservermanager/blob/main/src/main/java/org/manager/WebApp/Backend/Application.java"
    click WebConfig "https://github.com/luke0630/minecraftservermanager/blob/main/src/main/java/org/manager/WebApp/Backend/WebConfig.java"

    %% Click Events for WebSocket Servers files
    click APIWS "https://github.com/luke0630/minecraftservermanager/blob/main/src/main/java/org/manager/WebSocket/APIWebsocketServer.java"
    click LunchWS "https://github.com/luke0630/minecraftservermanager/blob/main/src/main/java/org/manager/WebSocket/LunchWebSocketServer.java"

    %% Click Events for Frontend UI files
    click AppVue "https://github.com/luke0630/minecraftservermanager/blob/main/src/main/java/org/manager/WebApp/Fronted/App.vue"
    click ServerList "https://github.com/luke0630/minecraftservermanager/blob/main/src/main/java/org/manager/WebApp/Fronted/ServerList.vue"
    click HelloWorld "https://github.com/luke0630/minecraftservermanager/blob/main/src/main/java/org/manager/WebApp/Fronted/HelloWorld.vue"
    click BabelConfig "https://github.com/luke0630/minecraftservermanager/blob/main/src/main/java/org/manager/WebApp/Fronted/babel.config.js"
    click VueConfig "https://github.com/luke0630/minecraftservermanager/blob/main/src/main/java/org/manager/WebApp/Fronted/vue.config.js"

    %% Click Events for Configuration files
    click ConfigYML "https://github.com/luke0630/minecraftservermanager/blob/main/src/main/resources/config.yml"
    click StaticAssets "https://github.com/luke0630/minecraftservermanager/tree/main/src/main/resources/static"

    %% Styling definitions
    classDef main fill:#f9d5bb,stroke:#333,stroke-width:2px;
    classDef config fill:#cce5ff,stroke:#333,stroke-width:2px;
    classDef core fill:#d4edda,stroke:#333,stroke-width:2px;
    classDef backend fill:#fff3cd,stroke:#333,stroke-width:2px;
    classDef frontend fill:#f8d7da,stroke:#333,stroke-width:2px;
    classDef websocket fill:#d1c4e9,stroke:#333,stroke-width:2px;
    classDef external fill:#e2e3e5,stroke:#333,stroke-width:2px;
```
