# maftymanicemu/dukex architecture

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

- Interactive diagram: https://gitdiagram.com/maftymanicemu/dukex
- Repository: https://github.com/maftymanicemu/dukex

## Overview

DukeX is a native iOS/macOS frontend for Original Xbox emulation, embedding xemu on iOS and integrating a desktop Xemu runtime on macOS. The principal workflow is library selection or game import, launch planning, optional JIT setup, emulation, and native display. Separate capabilities include controller/touch input, per-game configuration, diagnostics, and XB.Live/Insignia services. The README documents these capabilities and broad runtime relationships; sampled source does not expose the Swift runtime call graph, so unsampled implementation links are omitted or shown only where documented.

Main entry points: [`desktop/DukeX/DukeX/Features/Profile/ProfileView.swift`](https://github.com/maftymanicemu/dukex/blob/master/desktop/DukeX/DukeX/Features/Profile/ProfileView.swift) (Profile And Activity), [`desktop/DukeX/DukeX/Runtime/LaunchPlan/XemuLaunchPlan.swift`](https://github.com/maftymanicemu/dukex/blob/master/desktop/DukeX/DukeX/Runtime/LaunchPlan/XemuLaunchPlan.swift) (Launch Planning), [`desktop/DukeX/DukeX/Runtime/Core/EmulatorCoreRuntime.swift`](https://github.com/maftymanicemu/dukex/blob/master/desktop/DukeX/DukeX/Runtime/Core/EmulatorCoreRuntime.swift) (Emulator Core), [`desktop/DukeX/DukeX/Features/Games/GamesLibraryView.swift`](https://github.com/maftymanicemu/dukex/blob/master/desktop/DukeX/DukeX/Features/Games/GamesLibraryView.swift) (Game Library)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_library["Game Library"]
  node_libraryui["Game Library"]
  node_import["Game Import"]
  node_filestore[("Game File Store")]
  node_metadata[("Game Metadata")]
end

subgraph group_runtime["Launch And Runtime"]
  node_launchplan["Launch Planning"]
  node_jit["JIT Coordinator"]
  node_core["Emulator Core"]
  node_desktopruntime["Desktop Xemu Runtime"]
  node_settings["Runtime Settings<br/>[SettingsView.swift]"]
  node_gameconfig["Per-game Tuning"]
end

subgraph group_presentation["Input And Display"]
  node_controller["Controller Input"]
  node_touchcontrols["Touch Controls"]
  node_presenter["Native Display"]
  node_hud["Statistics HUD<br/>[StatsHUDView.swift]"]
end

subgraph group_online["Online Services"]
  node_profile["Profile And Activity<br/>[ProfileView.swift]"]
  node_social["Social Services"]
  node_presence["Live Presence"]
  node_cloudsaves[("Cloud Saves")]
end

subgraph group_app["App Experience"]
  node_themes["Themes And Skins"]
  node_activity["Activity Feed"]
end

node_user(("Player"))
node_playeraccounts(("XB.Live Account"))
node_stikdebug["StikDebug"]
node_insignia["Insignia Service"]

node_user -->|"browses"| node_libraryui
node_user -->|"imports games"| node_import
node_import -->|"stores files"| node_filestore
node_libraryui -->|"starts launch"| node_launchplan
node_launchplan -.->|"may prepare JIT"| node_jit
node_jit -.->|"hands off"| node_stikdebug
node_launchplan -->|"launches emulator"| node_core
node_launchplan -->|"uses desktop path"| node_desktopruntime
node_settings -.->|"configures runtime"| node_launchplan
node_gameconfig -->|"tunes game"| node_launchplan
node_controller -->|"sends input"| node_core
node_touchcontrols -->|"sends input"| node_core
node_core -->|"renders through"| node_presenter
node_core -->|"provides diagnostics"| node_hud
node_user -->|"opens profile"| node_profile
node_profile -->|"uses services"| node_social
node_profile -->|"shows presence"| node_presence
node_profile -.->|"supports sync"| node_cloudsaves
node_playeraccounts -.->|"authenticates"| node_profile
node_insignia -.->|"supplies live status"| node_presence
node_profile -->|"shows activity"| node_activity
node_user -->|"personalizes"| node_themes

click node_libraryui "https://github.com/maftymanicemu/dukex/blob/master/desktop/DukeX/DukeX/Features/Games/GamesLibraryView.swift"
click node_import "https://github.com/maftymanicemu/dukex/blob/master/desktop/DukeX/DukeX/Library/Import/DocumentImportPicker.swift"
click node_filestore "https://github.com/maftymanicemu/dukex/blob/master/desktop/DukeX/DukeX/Library/Store/EmulatorFileStore.swift"
click node_metadata "https://github.com/maftymanicemu/dukex/blob/master/desktop/DukeX/DukeX/Services/GameMetadata/GameMetadataStore.swift"
click node_launchplan "https://github.com/maftymanicemu/dukex/blob/master/desktop/DukeX/DukeX/Runtime/LaunchPlan/XemuLaunchPlan.swift"
click node_jit "https://github.com/maftymanicemu/dukex/blob/master/desktop/DukeX/DukeX/Runtime/JIT/AutoJITCoordinator.swift"
click node_core "https://github.com/maftymanicemu/dukex/blob/master/desktop/DukeX/DukeX/Runtime/Core/EmulatorCoreRuntime.swift"
click node_desktopruntime "https://github.com/maftymanicemu/dukex/blob/master/desktop/DukeX/DukeX/Desktop/XemuDesktopRuntime.swift"
click node_settings "https://github.com/maftymanicemu/dukex/blob/master/desktop/DukeX/DukeX/Features/Settings/SettingsView.swift"
click node_gameconfig "https://github.com/maftymanicemu/dukex/blob/master/desktop/DukeX/DukeX/Features/Games/Metadata/GameMetadataEditorView.swift"
click node_controller "https://github.com/maftymanicemu/dukex/blob/master/desktop/DukeX/DukeX/App/GameControllerBootstrap.swift"
click node_touchcontrols "https://github.com/maftymanicemu/dukex/blob/master/desktop/DukeX/DukeX/Presenter/ManicSkin/ManicSkinVirtualController.swift"
click node_hud "https://github.com/maftymanicemu/dukex/blob/master/desktop/DukeX/DukeX/Presenter/HUD/StatsHUDView.swift"
click node_profile "https://github.com/maftymanicemu/dukex/blob/master/desktop/DukeX/DukeX/Features/Profile/ProfileView.swift"
click node_social "https://github.com/maftymanicemu/dukex/blob/master/desktop/DukeX/DukeX/Services/Insignia/XBLiveSocialService.swift"
click node_presence "https://github.com/maftymanicemu/dukex/blob/master/desktop/DukeX/DukeX/Services/Insignia/XBLiveEmulatorPresenceService.swift"
click node_cloudsaves "https://github.com/maftymanicemu/dukex/blob/master/desktop/DukeX/DukeX/Services/CloudSaves/FATXHDDCloudSaveStore.swift"
click node_themes "https://github.com/maftymanicemu/dukex/blob/master/desktop/DukeX/DukeX/Features/Settings/Skins/SkinSettingsView.swift"
click node_activity "https://github.com/maftymanicemu/dukex/blob/master/desktop/DukeX/DukeX/Features/Activity/ActivityFeedView.swift"

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_libraryui,node_import,node_filestore,node_metadata toneBlue
class node_launchplan,node_jit,node_core,node_desktopruntime,node_settings,node_gameconfig toneAmber
class node_controller,node_touchcontrols,node_presenter,node_hud toneMint
class node_profile,node_social,node_presence,node_cloudsaves toneRose
class node_themes,node_activity,node_user,node_playeraccounts,node_stikdebug,node_insignia toneIndigo
```

## Components

### Game Library

- [Game Library](https://github.com/maftymanicemu/dukex/blob/master/desktop/DukeX/DukeX/Features/Games/GamesLibraryView.swift): `desktop/DukeX/DukeX/Features/Games/GamesLibraryView.swift`
- [Game Import](https://github.com/maftymanicemu/dukex/blob/master/desktop/DukeX/DukeX/Library/Import/DocumentImportPicker.swift): `desktop/DukeX/DukeX/Library/Import/DocumentImportPicker.swift`
- [Game File Store](https://github.com/maftymanicemu/dukex/blob/master/desktop/DukeX/DukeX/Library/Store/EmulatorFileStore.swift): `desktop/DukeX/DukeX/Library/Store/EmulatorFileStore.swift`
- [Game Metadata](https://github.com/maftymanicemu/dukex/blob/master/desktop/DukeX/DukeX/Services/GameMetadata/GameMetadataStore.swift): `desktop/DukeX/DukeX/Services/GameMetadata/GameMetadataStore.swift`

### Launch And Runtime

- [Launch Planning](https://github.com/maftymanicemu/dukex/blob/master/desktop/DukeX/DukeX/Runtime/LaunchPlan/XemuLaunchPlan.swift): `desktop/DukeX/DukeX/Runtime/LaunchPlan/XemuLaunchPlan.swift`
- [JIT Coordinator](https://github.com/maftymanicemu/dukex/blob/master/desktop/DukeX/DukeX/Runtime/JIT/AutoJITCoordinator.swift): `desktop/DukeX/DukeX/Runtime/JIT/AutoJITCoordinator.swift`
- [Emulator Core](https://github.com/maftymanicemu/dukex/blob/master/desktop/DukeX/DukeX/Runtime/Core/EmulatorCoreRuntime.swift): `desktop/DukeX/DukeX/Runtime/Core/EmulatorCoreRuntime.swift`
- [Desktop Xemu Runtime](https://github.com/maftymanicemu/dukex/blob/master/desktop/DukeX/DukeX/Desktop/XemuDesktopRuntime.swift): `desktop/DukeX/DukeX/Desktop/XemuDesktopRuntime.swift`
- [Runtime Settings](https://github.com/maftymanicemu/dukex/blob/master/desktop/DukeX/DukeX/Features/Settings/SettingsView.swift): `desktop/DukeX/DukeX/Features/Settings/SettingsView.swift`
- [Per-game Tuning](https://github.com/maftymanicemu/dukex/blob/master/desktop/DukeX/DukeX/Features/Games/Metadata/GameMetadataEditorView.swift): `desktop/DukeX/DukeX/Features/Games/Metadata/GameMetadataEditorView.swift`

### Input And Display

- [Controller Input](https://github.com/maftymanicemu/dukex/blob/master/desktop/DukeX/DukeX/App/GameControllerBootstrap.swift): `desktop/DukeX/DukeX/App/GameControllerBootstrap.swift`
- [Touch Controls](https://github.com/maftymanicemu/dukex/blob/master/desktop/DukeX/DukeX/Presenter/ManicSkin/ManicSkinVirtualController.swift): `desktop/DukeX/DukeX/Presenter/ManicSkin/ManicSkinVirtualController.swift`
- **Native Display**
- [Statistics HUD](https://github.com/maftymanicemu/dukex/blob/master/desktop/DukeX/DukeX/Presenter/HUD/StatsHUDView.swift): `desktop/DukeX/DukeX/Presenter/HUD/StatsHUDView.swift`

### Online Services

- [Profile And Activity](https://github.com/maftymanicemu/dukex/blob/master/desktop/DukeX/DukeX/Features/Profile/ProfileView.swift): `desktop/DukeX/DukeX/Features/Profile/ProfileView.swift`
- [Social Services](https://github.com/maftymanicemu/dukex/blob/master/desktop/DukeX/DukeX/Services/Insignia/XBLiveSocialService.swift): `desktop/DukeX/DukeX/Services/Insignia/XBLiveSocialService.swift`
- [Live Presence](https://github.com/maftymanicemu/dukex/blob/master/desktop/DukeX/DukeX/Services/Insignia/XBLiveEmulatorPresenceService.swift): `desktop/DukeX/DukeX/Services/Insignia/XBLiveEmulatorPresenceService.swift`
- [Cloud Saves](https://github.com/maftymanicemu/dukex/blob/master/desktop/DukeX/DukeX/Services/CloudSaves/FATXHDDCloudSaveStore.swift): `desktop/DukeX/DukeX/Services/CloudSaves/FATXHDDCloudSaveStore.swift`

### App Experience

- [Themes And Skins](https://github.com/maftymanicemu/dukex/blob/master/desktop/DukeX/DukeX/Features/Settings/Skins/SkinSettingsView.swift): `desktop/DukeX/DukeX/Features/Settings/Skins/SkinSettingsView.swift`
- [Activity Feed](https://github.com/maftymanicemu/dukex/blob/master/desktop/DukeX/DukeX/Features/Activity/ActivityFeedView.swift): `desktop/DukeX/DukeX/Features/Activity/ActivityFeedView.swift`

### Other components

- **Player**
- **XB.Live Account**
- **StikDebug**
- **Insignia Service**

## Connections

- Player → Game Library: browses
- Player → Game Import: imports games
- Game Import → Game File Store: stores files
- Game Library → Launch Planning: starts launch
- Launch Planning → JIT Coordinator: may prepare JIT
- JIT Coordinator → StikDebug: hands off
- Launch Planning → Emulator Core: launches emulator
- Launch Planning → Desktop Xemu Runtime: uses desktop path
- Runtime Settings → Launch Planning: configures runtime
- Per-game Tuning → Launch Planning: tunes game
- Controller Input → Emulator Core: sends input
- Touch Controls → Emulator Core: sends input
- Emulator Core → Native Display: renders through
- Emulator Core → Statistics HUD: provides diagnostics
- Player → Profile And Activity: opens profile
- Profile And Activity → Social Services: uses services
- Profile And Activity → Live Presence: shows presence
- Profile And Activity → Cloud Saves: supports sync
- XB.Live Account → Profile And Activity: authenticates
- Insignia Service → Live Presence: supplies live status
- Profile And Activity → Activity Feed: shows activity
- Player → Themes And Skins: personalizes
