# new-sashok724/launcher architecture

> Architecture diagram of the GitHub repository new-sashok724/launcher, 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/new-sashok724/launcher
- Repository: https://github.com/new-sashok724/launcher

## Overview

##### Main Components to Highlight
- Server Module – LaunchServer:
- The server side includes several sub-components:
∙ Configuration & Resources: All configuration files and default profiles (under LaunchServer/resources/launchserver/defaults & bungee.yml) which drive the server’s runtime behavior.
∙ Authentication Subsystem: Organized under LaunchServer/source/auth with various authentication handlers (e.g., FileAuthHandler, MySQLAuthHandler) and providers (Mojang, Digest, etc.). This clearly shows extensibility and support for multiple auth strategies.
∙ Command & Request Handling: The directory tree under LaunchServer/source/command (with basic, auth, legacy, hash commands) and the corresponding handler in LaunchServer/source/command/handler indicate an interactive or CLI-based command center for server operations.
∙ Response System: Found under LaunchServer/source/response, these components handle communication, connection management, and possibly event responses.
∙ Binary Management: Under LaunchServer/source/binary, you have classes for launching executables or JAR files showing integration with binary execution.
∙ Plugin Integration: The plugin interfaces (with subdirectories for Bukkit and Bungee) indicate hooks for Minecraft server software integration.
∙ Serialization & Configuration: The LaunchServer/source/serialize directory shows custom readers/writers and config entries, highlighting how settings and possibly networking data is managed.

- Client Module – Launcher:
- The client side encapsulated in “Launcher” also has distinct sub-components:
∙ User Interface / Dialog System: Under Launcher/runtime/dialog you see various FXML, JS, and CSS files for UI (e.g., offline, overlay for debug, settings, update). This represents the front-end dialog components with clearly defined style/theme segregation.
∙ Engine & Initialization: The runtime engine (Launcher/runtime/engine) and init.js show the startup sequence and API configuration.
∙ Client Launcher Implementations: Classes in Launcher/source/client (like ClientLauncher, ClientProfile, ServerPinger) indicate how the launcher initiates connections and profiles.
∙ Authlib Integration: The Launcher/source-authlib directory reveals integration with authentication libraries for Minecraft (Yggdrasil, Legacy support), bridging the client with authentication services.
∙ Additional Helpers and Utilities: In Launcher/source/hasher, Launcher/source/helper, and others to observe tasks like file watching or security mechanisms.

##### Relationships and Interactions
- Optionally, denote external compatibility layers (in “compat”) which patch or adapt integration with third-party systems (e.g., BungeeCord, LaunchWrapper).

##### Architectural Patterns and Design Principles
- Modularity: The separation between the “LaunchServer” and “Launcher” directories demonstrates a modular design – with each module responsible for a specific part of the system.
- Extensibility: The variety of authentication handlers/providers, multiple command modules, and the plugin integration reflect a design oriented toward extensibility.
- Separation of Concerns: The distinct grouping of configuration, business logic, UI, and integration code emphasizes proper separation of concerns.
- Client–Server Communication: Clearly depicting the handshake between the client’s user interface layer and the server’s backend processing (including networking, authentication, and updating).

##### Technologies and Frameworks to Note
- Java (with evident use in source code organization in both modules).
- For the UI components in the Launcher, JavaFX (implied by FXML files) or JS-based UI components.
- Integration with Minecraft authentication (“Yggdrasil” classes) and support for multiple Minecraft server versions (as seen within various profile config files).

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "LaunchServer (Server Module)"
        A1["Default Config"]:::server
        A2["Bungee Config"]:::server
        A3["Authentication Subsystem"]:::server
        A4["Command & Request Handling"]:::server
        A5["Response System"]:::server
        A6["Binary Management"]:::server
        A7["Plugin Integration"]:::server
        A8["Serialization & Configuration"]:::server
    end

    subgraph "Launcher (Client Module)"
        B1["UI Dialog System"]:::client
        B2["Engine & Initialization"]:::client
        B2a["Init Script"]:::client
        B3["Client Launcher Implementations"]:::client
        B4["Authlib Integration"]:::client
        B5["Additional Helpers & Utilities"]:::client
        B5a["Helper Utilities"]:::client
    end

    %% Server internal connections
    A1 -->|"config_to_auth"| A3
    A1 -->|"config_to_command"| A4
    A8 -->|"serialize_to_auth"| A3
    A8 -->|"serialize_to_command"| A4
    A3 -->|"auth_response"| A5
    A4 -->|"command_response"| A5
    A7 -->|"plugin_hook_command"| A4
    A7 -->|"plugin_hook_binary"| A6
    A5 -->|"response_feedback"| A4

    %% Client internal connections
    B2 -->|"init_ui"| B1
    B2 -->|"init_launcher"| B3
    B2 -->|"init_helpers"| B5
    B2 -->|"init_script"| B2a
    B3 -->|"use_authlib"| B4
    B5 -->|"helper_support"| B5a

    %% External Client-to-Server connection
    B2 -->|"client_request_auth"| A3

    %% Click Events for Server Components
    click A1 "https://github.com/new-sashok724/launcher/tree/master/LaunchServer/resources/launchserver/defaults"
    click A2 "https://github.com/new-sashok724/launcher/blob/master/LaunchServer/resources/bungee.yml"
    click A3 "https://github.com/new-sashok724/launcher/tree/master/LaunchServer/source/auth/"
    click A4 "https://github.com/new-sashok724/launcher/tree/master/LaunchServer/source/command/"
    click A5 "https://github.com/new-sashok724/launcher/tree/master/LaunchServer/source/response/"
    click A6 "https://github.com/new-sashok724/launcher/tree/master/LaunchServer/source/binary/"
    click A7 "https://github.com/new-sashok724/launcher/tree/master/LaunchServer/source/plugin/"
    click A8 "https://github.com/new-sashok724/launcher/tree/master/LaunchServer/source/serialize/"

    %% Click Events for Client Components
    click B1 "https://github.com/new-sashok724/launcher/tree/master/Launcher/runtime/dialog/"
    click B2 "https://github.com/new-sashok724/launcher/tree/master/Launcher/runtime/engine/"
    click B2a "https://github.com/new-sashok724/launcher/blob/master/Launcher/runtime/init.js"
    click B3 "https://github.com/new-sashok724/launcher/tree/master/Launcher/source/client/"
    click B4 "https://github.com/new-sashok724/launcher/tree/master/Launcher/source-authlib/"
    click B5 "https://github.com/new-sashok724/launcher/tree/master/Launcher/source/hasher/"
    click B5a "https://github.com/new-sashok724/launcher/tree/master/Launcher/source/helper/"

    %% Styles
    classDef server fill:#FFDDCC,stroke:#D2691E,stroke-width:2px;
    classDef client fill:#D0E6A5,stroke:#228B22,stroke-width:2px;
```
