# bala712115/launcher-mc architecture

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

- Interactive diagram: https://gitdiagram.com/bala712115/launcher-mc
- Repository: https://github.com/bala712115/launcher-mc

## Overview

Mon Launcher Minecraft is an Electron launcher for Minecraft Java 1.21.1 with Fabric. Users choose offline or Microsoft authentication, set memory, and launch; the main process prepares the game profile and starts Minecraft while streaming logs to the interface. The README also documents automatic copying of JAR mods from assets. The sampled excerpts show the launch, authentication, IPC, and download responsibilities; the README supplies some capability details where implementation excerpts are incomplete.

Main entry points: [`src/main.js`](https://github.com/bala712115/launcher-mc/blob/main/src/main.js) (Electron coordinator), [`src/preload.js`](https://github.com/bala712115/launcher-mc/blob/main/src/preload.js) (Secure IPC bridge), [`src/renderer.js`](https://github.com/bala712115/launcher-mc/blob/main/src/renderer.js) (Controls and logs), [`src/microsoftAuth.js`](https://github.com/bala712115/launcher-mc/blob/main/src/microsoftAuth.js) (Microsoft sign-in)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Launcher interface"]
  node_window["Launcher window<br/>[index.html]"]
  node_ui["Controls and logs<br/>[renderer.js]"]
  node_bridge["Secure IPC bridge<br/>[preload.js]"]
end

subgraph group_runtime["Game preparation"]
  node_main["Electron coordinator<br/>[main.js]"]
  node_vanilla["Vanilla profile<br/>[main.js]"]
  node_gameassets["Game assets<br/>[main.js]"]
  node_fabric["Fabric loader<br/>[main.js]"]
  node_modinput["Mod JAR inputs"]
  node_modinstall["Mod installation<br/>[main.js]"]
  node_arguments["Launch arguments<br/>[main.js]"]
end

subgraph group_identity["Account identity"]
  node_authflow["Microsoft sign-in<br/>[microsoftAuth.js]"]
  node_accountservices{{"Microsoft and Xbox services"}}
  node_gameapi{{"Minecraft account services"}}
end

subgraph group_game["Game runtime"]
  node_profile[("Minecraft profile<br/>[main.js]")]
  node_java["Java Minecraft process"]
end

node_player(("Player"))

node_player -->|"uses"| node_ui
node_window -->|"presents"| node_ui
node_ui -->|"invokes and subscribes"| node_bridge
node_bridge -->|"dispatches IPC"| node_main
node_main -->|"requests sign-in"| node_authflow
node_authflow -->|"authenticates"| node_accountservices
node_authflow -->|"exchanges tokens"| node_gameapi
node_main -->|"fetches profile"| node_vanilla
node_main -->|"downloads assets"| node_gameassets
node_main -->|"installs loader"| node_fabric
node_modinput -->|"supplies JARs"| node_modinstall
node_main -->|"copies mods"| node_modinstall
node_main -->|"resolves arguments"| node_arguments
node_main -->|"prepares files"| node_profile
node_vanilla -->|"writes profile"| node_profile
node_gameassets -->|"writes assets"| node_profile
node_fabric -->|"writes libraries"| node_profile
node_modinstall -->|"copies to mods"| node_profile
node_main -->|"spawns process"| node_java
node_arguments -->|"configures launch"| node_java
node_java -->|"streams logs"| node_main
node_main -->|"sends log events"| node_bridge
node_bridge -->|"delivers events"| node_ui

click node_window "https://github.com/bala712115/launcher-mc/blob/main/src/index.html"
click node_ui "https://github.com/bala712115/launcher-mc/blob/main/src/renderer.js"
click node_bridge "https://github.com/bala712115/launcher-mc/blob/main/src/preload.js"
click node_main "https://github.com/bala712115/launcher-mc/blob/main/src/main.js"
click node_vanilla "https://github.com/bala712115/launcher-mc/blob/main/src/main.js"
click node_gameassets "https://github.com/bala712115/launcher-mc/blob/main/src/main.js"
click node_fabric "https://github.com/bala712115/launcher-mc/blob/main/src/main.js"
click node_modinput "https://github.com/bala712115/launcher-mc/tree/main/assets"
click node_modinstall "https://github.com/bala712115/launcher-mc/blob/main/src/main.js"
click node_arguments "https://github.com/bala712115/launcher-mc/blob/main/src/main.js"
click node_profile "https://github.com/bala712115/launcher-mc/blob/main/src/main.js"
click node_authflow "https://github.com/bala712115/launcher-mc/blob/main/src/microsoftAuth.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_window,node_ui,node_bridge toneBlue
class node_main,node_vanilla,node_gameassets,node_fabric,node_modinput,node_modinstall,node_arguments toneAmber
class node_authflow,node_accountservices,node_gameapi toneMint
class node_profile,node_java toneRose
class node_player toneIndigo
```

## Components

### Launcher interface

- [Launcher window](https://github.com/bala712115/launcher-mc/blob/main/src/index.html): `src/index.html`
- [Controls and logs](https://github.com/bala712115/launcher-mc/blob/main/src/renderer.js): `src/renderer.js`
- [Secure IPC bridge](https://github.com/bala712115/launcher-mc/blob/main/src/preload.js): `src/preload.js`

### Game preparation

- [Electron coordinator](https://github.com/bala712115/launcher-mc/blob/main/src/main.js): `src/main.js`
- [Vanilla profile](https://github.com/bala712115/launcher-mc/blob/main/src/main.js): `src/main.js`
- [Game assets](https://github.com/bala712115/launcher-mc/blob/main/src/main.js): `src/main.js`
- [Fabric loader](https://github.com/bala712115/launcher-mc/blob/main/src/main.js): `src/main.js`
- [Mod JAR inputs](https://github.com/bala712115/launcher-mc/tree/main/assets): `assets`
- [Mod installation](https://github.com/bala712115/launcher-mc/blob/main/src/main.js): `src/main.js`
- [Launch arguments](https://github.com/bala712115/launcher-mc/blob/main/src/main.js): `src/main.js`

### Account identity

- [Microsoft sign-in](https://github.com/bala712115/launcher-mc/blob/main/src/microsoftAuth.js): `src/microsoftAuth.js`
- **Microsoft and Xbox services**
- **Minecraft account services**

### Game runtime

- [Minecraft profile](https://github.com/bala712115/launcher-mc/blob/main/src/main.js): `src/main.js`
- **Java Minecraft process**

### Other components

- **Player**

## Connections

- Player → Controls and logs: uses (evidence: `README.md`)
- Launcher window → Controls and logs: presents (evidence: `README.md`)
- Controls and logs → Secure IPC bridge: invokes and subscribes (evidence: `src/renderer.js`)
- Secure IPC bridge → Electron coordinator: dispatches IPC (evidence: `src/preload.js`)
- Electron coordinator → Microsoft sign-in: requests sign-in (evidence: `src/main.js`)
- Microsoft sign-in → Microsoft and Xbox services: authenticates (evidence: `src/microsoftAuth.js`)
- Microsoft sign-in → Minecraft account services: exchanges tokens (evidence: `src/microsoftAuth.js`)
- Electron coordinator → Vanilla profile: fetches profile (evidence: `src/main.js`)
- Electron coordinator → Game assets: downloads assets (evidence: `src/main.js`)
- Electron coordinator → Fabric loader: installs loader (evidence: `src/main.js`)
- Mod JAR inputs → Mod installation: supplies JARs (evidence: `README.md`)
- Electron coordinator → Mod installation: copies mods (evidence: `README.md`)
- Electron coordinator → Launch arguments: resolves arguments (evidence: `src/main.js`)
- Electron coordinator → Minecraft profile: prepares files (evidence: `src/main.js`)
- Vanilla profile → Minecraft profile: writes profile (evidence: `src/main.js`)
- Game assets → Minecraft profile: writes assets (evidence: `src/main.js`)
- Fabric loader → Minecraft profile: writes libraries (evidence: `src/main.js`)
- Mod installation → Minecraft profile: copies to mods (evidence: `README.md`)
- Electron coordinator → Java Minecraft process: spawns process (evidence: `src/main.js`)
- Launch arguments → Java Minecraft process: configures launch (evidence: `src/main.js`)
- Java Minecraft process → Electron coordinator: streams logs (evidence: `src/main.js`)
- Electron coordinator → Secure IPC bridge: sends log events (evidence: `src/main.js`)
- Secure IPC bridge → Controls and logs: delivers events (evidence: `src/preload.js`)
