How gorilla-devs/gdlauncher-carbon works
Project Type and Purpose
• GDLauncher is a full-stack, multi-component desktop application (with accompanying website) built to manage Minecraft installations, mod loaders, mods, and modpacks.
• The application is built using Rust for the core native backend and SolidJS (with Electron/Vite) for the UI. There is also a marketing/documentation website powered by Astro.
• The project is organized as a monorepo with separate parts for the desktop app, website, multiple Rust crates (backend modules), shared packages (UI components, configs, internationalization), and scripts/configurations for CI/CD and development.
Main Components
a. Desktop Application (Electron):
• Desktop app folder under apps/desktop with multiple subdirectories:
• Main process and preload (apps/desktop/packages/main, apps/desktop/packages/preload)
• Main window UI (apps/desktop/packages/mainWindow) implemented in SolidJS/React.
• Testing, build scripts, configuration files (vite.config, electron-builder, etc.).
• This part handles the user interface and interacts with native functionalities (auto-updates, mod installations, instance management, Java management, etc.).
b. Website (Marketing Site):
• Located under apps/website. Built with Astro.
• It serves content such as blog posts, documentation, download links, and community links.
• It interacts with static assets (images, fonts, public files) and uses custom components.
c. Backend/Native Core (Rust Crates):
• The “crates” directory contains several Rust crates such as:
• carbon_app – the core backend handling API endpoints, business logic (accounts, metrics, instance management, mod platforms etc.)
• Additional crates like carbon_compression, carbon_frontend, carbon_net, carbon_parsing, carbon_platforms, carbon_repos, carbon_rt_path – each addressing specialized functionalities.
• They interact with databases via Prisma (as evidenced by the prisma migrations in crates/carbon_repos) and potentially with external APIs (e.g., CurseForge, Modrinth).
• Communication between the UI (Electron app) and this native core is established through a combination of direct native calls or bindings (rspc bindings) and auto-generation of types.
d. Shared Packages and Libraries:
• Packages directory holds modules like:
• packages/ui – common UI components used by the desktop app.
• packages/i18n – internationalization support.
• packages/config – configuration and theme settings.
• packages/core_module – possibly a shared logic library.
• These libraries are used across both the desktop app and possibly other parts of the project.
Relationships and Interactions
• The desktop application (frontend) communicates with the Rust core (backend) via established API channels (rspc bindings or native integration) to fetch game version data, mod information, and perform instance management.
• The backend (within crates folder) aggregates data from external sources (CurseForge, Modrinth) and handles tasks like mod downloads, Java installation management, and metrics logging.
• The website component is separate from the desktop flow but shares the same overall repository and branding. It serves as a static/public information and download portal.
• Shared packages (configuration, UI components, i18n) are used by both desktop and web applications ensuring consistency.
Architectural Patterns to Highlight
• Separation of Concerns: Clearly dividing the UI (Electron/React components) from the native backend logic (Rust crates).
• Modular design: Both the desktop app and backend are split into many modular components and libraries, making it easier to extend or modify behavior.
• Client–Server Communication (even if on the same machine): The frontend communicates with the native backend via dedicated channels.
• Monorepo Structure: Use of shared packages among Electron, website, and Rust modules, all driven by pnpm/turbo.json for consistent versioning and building.