How tjmcraft/tjmc-launcher works
Main Components
• Host (Main Process):
• Located in the “src/main” directory.
• Key files include Host.js, Launcher.js, MainWindow.js, Updater.js along with several “managers” (e.g., AuthManager, ConfigManager, InstallationsManager, InstanceManager, VersionManager) and game-related subcomponents (Minecraft.js, JavaManager.js).
• Responsible for bootstrapping the application, managing native integrations, handling file system operations, launching game processes, and updating the app.
• Render (UI/Renderer Process):
• Found in the “src/render” directory.
• Implements the UI using Preact. Organized into components (e.g., App.tsx, components for authentication, main view components, modals, etc.), state management layers (Store, Reducers, Selectors), and a variety of utility modules.
• Uses IPC libraries (under “src/render/Libs/IPCHostConnect”) to communicate with the main process.
• External Libraries & Tools:
• Libraries such as Electron, electron-builder, fs-extra, and several networking and crypto libraries aid the Host process.
• Frontend uses Babel, Webpack, preact, and an assortment of styling and utility plugins.
• Build and Deployment Artifacts:
• CI/CD and repository tools can be inferred from the “.github” workflows and configuration files indicating automated build and release processes.
Relationships and Interactions
• Inter-Process Communication (IPC):
• The Renderer interacts with the Host via specific IPC modules (IPCHostConnect) to execute backend operations.
• Module Dependencies:
• Within the main process, “managers” and game-related modules interact to handle user authentication, configuration setups, installation management, etc.
• On the render side, the UI components access data from the centralized store, managed via a Redux-like pattern (using Actions, Reducers, and Selectors).
Architectural Patterns and Design Principles
• Separation of Concerns:
• Clear split between the Host (responsible for system-level tasks and updates) and Render (presentation and user interaction logic).
• IPC Communication:
• Emphasis on clearly defined communication channels between the processes, representing event-driven or message-passing patterns.
• Modular and Scalable Design:
• Multiple managers and utility modules indicate componentization, which can be represented as separate blocks that contribute to the overall functionality.
• Build and Deployment:
• The use of platform-specific build scripts (as seen in package.json and GitHub workflows) indicates CI/CD integration that should be noted (even if in a “deployment pipeline” note).