# mariofritzer/craftkit architecture

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

- Interactive diagram: https://gitdiagram.com/mariofritzer/craftkit
- Repository: https://github.com/mariofritzer/craftkit

## Overview

CraftKit is a local Minecraft Java Edition package manager, presented through a browser-based UI and backed by a Go HTTP service. The main workflow is to choose an instance and content, resolve compatibility and dependencies into a plan, fetch packages, and apply them to the instance; instances are also registered as profiles in the official launcher. The graph includes documented discovery, server matching, modpack, update, and maintenance features. Some subsystem links are based on README behavior because their source was not sampled.

Main entry points: [`server.go`](https://github.com/mariofritzer/craftkit/blob/main/server.go) (HTTP API), [`instances.go`](https://github.com/mariofritzer/craftkit/blob/main/instances.go) (Instance manager), [`provider.go`](https://github.com/mariofritzer/craftkit/blob/main/provider.go) (Mod providers), [`resolver.go`](https://github.com/mariofritzer/craftkit/blob/main/resolver.go) (Dependency planner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_ui["CraftKit UI<br/>[app.js]"]
end

subgraph group_service["Application service"]
  node_api["HTTP API<br/>[server.go]"]
  node_updateservice["Self-updater<br/>[update.go]"]
end

subgraph group_content["Content management"]
  node_resolver["Dependency planner<br/>[resolver.go]"]
  node_scan["Jar scanning<br/>[scan.go]"]
  node_updates["Update planning<br/>[updates.go]"]
  node_servermatch["Server matching<br/>[servermatch.go]"]
  node_packimport["Modpack import<br/>[packimport.go]"]
  node_export["Modpack export<br/>[export.go]"]
end

subgraph group_instances["Instances and state"]
  node_instance["Instance manager<br/>[instances.go]"]
  node_instancefiles[("Instance files")]
  node_discovery["Profile discovery<br/>[discover.go]"]
  node_crash["Crash help<br/>[crash.go]"]
  node_worlds["World backups<br/>[worlds.go]"]
  node_sets["Mod sets<br/>[sets.go]"]
  node_config[("Local settings<br/>[config.go]")]
end

subgraph group_integrations["External integrations"]
  node_providers["Mod providers<br/>[provider.go]"]
  node_serverping["Server status ping<br/>[serverping.go]"]
end

node_user(("Minecraft player"))
node_modrinth{{"Modrinth"}}
node_curseforge{{"CurseForge"}}
node_launcher["Official launcher"]
node_minecraftserver{{"Minecraft server"}}
node_mojang{{"Mojang"}}
node_loaders{{"Loader services"}}
node_adoptium{{"Eclipse Adoptium"}}

node_user -->|"uses"| node_ui
node_ui -->|"API requests"| node_api
node_api -->|"plans installs"| node_resolver
node_resolver -->|"queries versions"| node_providers
node_providers -->|"queries and downloads"| node_modrinth
node_providers -.->|"queries and downloads"| node_curseforge
node_api -->|"manages instances"| node_instance
node_instance -->|"reads and writes"| node_instancefiles
node_instance -->|"registers profiles"| node_launcher
node_api -->|"discovers profiles"| node_discovery
node_discovery -->|"reads profiles"| node_launcher
node_api -->|"scans installed jars"| node_scan
node_scan -->|"reads jars"| node_instancefiles
node_api -->|"previews updates"| node_updates
node_updates -->|"resolves updates"| node_resolver
node_api -->|"requests server status"| node_serverping
node_serverping -->|"pings"| node_minecraftserver
node_api -->|"matches server setup"| node_servermatch
node_servermatch -->|"uses server details"| node_serverping
node_servermatch -->|"plans compatible mods"| node_resolver
node_api -->|"imports modpacks"| node_packimport
node_packimport -->|"looks up package files"| node_providers
node_packimport -->|"installs pack contents"| node_instancefiles
node_api -->|"exports modpacks"| node_export
node_export -->|"reads installed contents"| node_instancefiles
node_api -->|"checks for updates"| node_updateservice
node_updateservice -->|"reads update settings"| node_config
node_api -->|"analyzes crash reports"| node_crash
node_crash -->|"reads logs and mods"| node_instancefiles
node_api -->|"backs up worlds"| node_worlds
node_worlds -->|"reads and writes worlds"| node_instancefiles
node_api -->|"manages mod sets"| node_sets
node_sets -->|"reads and writes sets"| node_config
node_api -->|"loads and saves settings"| node_config
node_instance -->|"gets game versions"| node_mojang
node_instance -->|"installs loaders"| node_loaders
node_instance -.->|"finds Java if needed"| node_adoptium

click node_ui "https://github.com/mariofritzer/craftkit/blob/main/web/app.js"
click node_api "https://github.com/mariofritzer/craftkit/blob/main/server.go"
click node_resolver "https://github.com/mariofritzer/craftkit/blob/main/resolver.go"
click node_providers "https://github.com/mariofritzer/craftkit/blob/main/provider.go"
click node_instance "https://github.com/mariofritzer/craftkit/blob/main/instances.go"
click node_discovery "https://github.com/mariofritzer/craftkit/blob/main/discover.go"
click node_scan "https://github.com/mariofritzer/craftkit/blob/main/scan.go"
click node_updates "https://github.com/mariofritzer/craftkit/blob/main/updates.go"
click node_servermatch "https://github.com/mariofritzer/craftkit/blob/main/servermatch.go"
click node_serverping "https://github.com/mariofritzer/craftkit/blob/main/serverping.go"
click node_packimport "https://github.com/mariofritzer/craftkit/blob/main/packimport.go"
click node_export "https://github.com/mariofritzer/craftkit/blob/main/export.go"
click node_updateservice "https://github.com/mariofritzer/craftkit/blob/main/update.go"
click node_crash "https://github.com/mariofritzer/craftkit/blob/main/crash.go"
click node_worlds "https://github.com/mariofritzer/craftkit/blob/main/worlds.go"
click node_sets "https://github.com/mariofritzer/craftkit/blob/main/sets.go"
click node_config "https://github.com/mariofritzer/craftkit/blob/main/config.go"

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_ui toneBlue
class node_api,node_updateservice toneAmber
class node_resolver,node_scan,node_updates,node_servermatch,node_packimport,node_export,node_minecraftserver toneMint
class node_instance,node_instancefiles,node_discovery,node_crash,node_worlds,node_sets,node_config toneRose
class node_providers,node_serverping,node_user,node_modrinth,node_curseforge,node_launcher,node_mojang,node_loaders,node_adoptium toneIndigo
```

## Components

### User interface

- [CraftKit UI](https://github.com/mariofritzer/craftkit/blob/main/web/app.js): `web/app.js`

### Application service

- [HTTP API](https://github.com/mariofritzer/craftkit/blob/main/server.go): `server.go`
- [Self-updater](https://github.com/mariofritzer/craftkit/blob/main/update.go): `update.go`

### Content management

- [Dependency planner](https://github.com/mariofritzer/craftkit/blob/main/resolver.go): `resolver.go`
- [Jar scanning](https://github.com/mariofritzer/craftkit/blob/main/scan.go): `scan.go`
- [Update planning](https://github.com/mariofritzer/craftkit/blob/main/updates.go): `updates.go`
- [Server matching](https://github.com/mariofritzer/craftkit/blob/main/servermatch.go): `servermatch.go`
- [Modpack import](https://github.com/mariofritzer/craftkit/blob/main/packimport.go): `packimport.go`
- [Modpack export](https://github.com/mariofritzer/craftkit/blob/main/export.go): `export.go`

### Instances and state

- [Instance manager](https://github.com/mariofritzer/craftkit/blob/main/instances.go): `instances.go`
- **Instance files**
- [Profile discovery](https://github.com/mariofritzer/craftkit/blob/main/discover.go): `discover.go`
- [Crash help](https://github.com/mariofritzer/craftkit/blob/main/crash.go): `crash.go`
- [World backups](https://github.com/mariofritzer/craftkit/blob/main/worlds.go): `worlds.go`
- [Mod sets](https://github.com/mariofritzer/craftkit/blob/main/sets.go): `sets.go`
- [Local settings](https://github.com/mariofritzer/craftkit/blob/main/config.go): `config.go`

### External integrations

- [Mod providers](https://github.com/mariofritzer/craftkit/blob/main/provider.go): `provider.go`
- [Server status ping](https://github.com/mariofritzer/craftkit/blob/main/serverping.go): `serverping.go`

### Other components

- **Minecraft player**
- **Modrinth**
- **CurseForge**
- **Official launcher**
- **Minecraft server**
- **Mojang**
- **Loader services**
- **Eclipse Adoptium**

## Connections

- Minecraft player → CraftKit UI: uses
- CraftKit UI → HTTP API: API requests
- HTTP API → Dependency planner: plans installs
- Dependency planner → Mod providers: queries versions
- Mod providers → Modrinth: queries and downloads
- Mod providers → CurseForge: queries and downloads
- HTTP API → Instance manager: manages instances
- Instance manager → Instance files: reads and writes
- Instance manager → Official launcher: registers profiles
- HTTP API → Profile discovery: discovers profiles
- Profile discovery → Official launcher: reads profiles
- HTTP API → Jar scanning: scans installed jars
- Jar scanning → Instance files: reads jars
- HTTP API → Update planning: previews updates
- Update planning → Dependency planner: resolves updates
- HTTP API → Server status ping: requests server status
- Server status ping → Minecraft server: pings
- HTTP API → Server matching: matches server setup
- Server matching → Server status ping: uses server details
- Server matching → Dependency planner: plans compatible mods
- HTTP API → Modpack import: imports modpacks
- Modpack import → Mod providers: looks up package files
- Modpack import → Instance files: installs pack contents
- HTTP API → Modpack export: exports modpacks
- Modpack export → Instance files: reads installed contents
- HTTP API → Self-updater: checks for updates
- Self-updater → Local settings: reads update settings
- HTTP API → Crash help: analyzes crash reports
- Crash help → Instance files: reads logs and mods
- HTTP API → World backups: backs up worlds
- World backups → Instance files: reads and writes worlds
- HTTP API → Mod sets: manages mod sets
- Mod sets → Local settings: reads and writes sets
- HTTP API → Local settings: loads and saves settings
- Instance manager → Mojang: gets game versions
- Instance manager → Loader services: installs loaders
- Instance manager → Eclipse Adoptium: finds Java if needed
