# hifihedgehog/padforge architecture

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

- Interactive diagram: https://gitdiagram.com/hifihedgehog/padforge
- Repository: https://github.com/hifihedgehog/padforge

## Overview

PadForge is a Windows controller-remapping application: users connect physical or browser-based inputs, configure mappings and profiles, then expose the result as virtual controllers for games. Its central runtime is InputManager, which coordinates input polling and mapping evaluation; the README documents mapping rows, macros, motion, and virtual-controller output. Other documented branches include device-specific input, phone-based web control, motion services, Workshop profiles, and controller previews. Some subsystem wiring is unsampled, so those relationships are omitted or marked unverified rather than inferred from names.

Main entry points: [`PadForge.App/Common/Input/InputManager.cs`](https://github.com/hifihedgehog/padforge/blob/main/PadForge.App/Common/Input/InputManager.cs) (InputManager), [`PadForge.Engine/Data/UserDevice.cs`](https://github.com/hifihedgehog/padforge/blob/main/PadForge.Engine/Data/UserDevice.cs) (User profiles), [`PadForge.App/App.xaml.cs`](https://github.com/hifihedgehog/padforge/blob/main/PadForge.App/App.xaml.cs) (PadForge app), [`PadForge.App/ViewModels/DashboardViewModel.cs`](https://github.com/hifihedgehog/padforge/blob/main/PadForge.App/ViewModels/DashboardViewModel.cs) (Dashboard and device UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["App experience"]
  node_app["PadForge app<br/>[App.xaml.cs]"]
  node_settings["Settings<br/>[SettingsManager.cs]"]
  node_dashboard["Dashboard and device UI"]
end

subgraph group_runtime["Input runtime"]
  node_inputmgr["InputManager<br/>[InputManager.cs]"]
  node_inputsvc["Input service<br/>[InputService.cs]"]
  node_mapping["Mapping evaluation<br/>[SourceCoercion.cs]"]
  node_inputstate["Input state model"]
  node_virtual["Virtual controllers"]
end

subgraph group_devices["Input devices"]
  node_physical["Connected controllers"]
  node_analog["Analog keyboards"]
  node_blissbox["Bliss-Box adapters"]
end

subgraph group_integrations["Services and integrations"]
  node_webserver["Web controller server"]
  node_webdevice["Browser gamepad device"]
  node_dsu["DSU motion server<br/>[DsuMotionServer.cs]"]
  node_telemetry["Racing telemetry<br/>[TelemetryHub.cs]"]
end

subgraph group_profiles["Profiles and previews"]
  node_profiles["User profiles<br/>[UserDevice.cs]"]
  node_workshop["Steam Workshop clients"]
  node_preview["Controller previews"]
end

node_user(("User"))
node_browser(("Phone browser"))
node_game(("Games"))

node_user -->|"configures"| node_app
node_app -.->|"uses settings"| node_settings
node_user -->|"connects devices"| node_physical
node_physical -->|"supplies input"| node_inputmgr
node_analog -->|"supplies key depth"| node_inputmgr
node_blissbox -->|"supplies adapter input"| node_inputmgr
node_browser -->|"connects remotely"| node_webserver
node_webserver -.->|"dispatches reports"| node_webdevice
node_webdevice -.->|"supplies gamepad input"| node_inputmgr
node_inputsvc -.->|"manages runtime"| node_inputmgr
node_inputmgr -->|"updates state"| node_inputstate
node_inputmgr -->|"evaluates mappings"| node_mapping
node_inputmgr -->|"drives outputs"| node_virtual
node_user -->|"configures mappings"| node_profiles
node_profiles -.->|"provides mapping sets"| node_inputmgr
node_inputmgr -->|"presents virtual pad"| node_game
node_inputmgr -->|"publishes motion"| node_dsu
node_telemetry -.->|"feeds racing data"| node_inputmgr
node_user -->|"opts into configs"| node_workshop
node_workshop -.->|"provides community configs"| node_profiles
node_dashboard -.->|"shows controller model"| node_preview
node_user -->|"views device state"| node_dashboard

click node_app "https://github.com/hifihedgehog/padforge/blob/main/PadForge.App/App.xaml.cs"
click node_settings "https://github.com/hifihedgehog/padforge/blob/main/PadForge.App/Common/SettingsManager.cs"
click node_dashboard "https://github.com/hifihedgehog/padforge/blob/main/PadForge.App/ViewModels/DashboardViewModel.cs"
click node_inputmgr "https://github.com/hifihedgehog/padforge/blob/main/PadForge.App/Common/Input/InputManager.cs"
click node_inputsvc "https://github.com/hifihedgehog/padforge/blob/main/PadForge.App/Services/InputService.cs"
click node_mapping "https://github.com/hifihedgehog/padforge/blob/main/PadForge.Engine/Common/Mapping/SourceCoercion.cs"
click node_inputstate "https://github.com/hifihedgehog/padforge/blob/main/PadForge.Engine/Common/CustomInputState.cs"
click node_virtual "https://github.com/hifihedgehog/padforge/blob/main/PadForge.Engine/Common/VirtualControllerTypes.cs"
click node_physical "https://github.com/hifihedgehog/padforge/blob/main/PadForge.Engine/Common/SdlDeviceWrapper.cs"
click node_analog "https://github.com/hifihedgehog/padforge/blob/main/PadForge.App/Common/Input/AnalogKeyboardRuntime.cs"
click node_blissbox "https://github.com/hifihedgehog/padforge/blob/main/PadForge.Engine/Common/BlissBox/BlissBoxControllers.cs"
click node_webserver "https://github.com/hifihedgehog/padforge/blob/main/PadForge.App/Services/WebControllerServer.cs"
click node_webdevice "https://github.com/hifihedgehog/padforge/blob/main/PadForge.Engine/Common/WebControllerDevice.cs"
click node_dsu "https://github.com/hifihedgehog/padforge/blob/main/PadForge.App/Services/DsuMotionServer.cs"
click node_telemetry "https://github.com/hifihedgehog/padforge/blob/main/PadForge.App/Common/Telemetry/TelemetryHub.cs"
click node_profiles "https://github.com/hifihedgehog/padforge/blob/main/PadForge.Engine/Data/UserDevice.cs"
click node_workshop "https://github.com/hifihedgehog/padforge/blob/main/PadForge.SteamWorkshop/Api/SteamWorkshopClient.cs"
click node_preview "https://github.com/hifihedgehog/padforge/blob/main/PadForge.App/Models3D/ControllerModelBase.cs"

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_app,node_settings,node_dashboard,node_user,node_browser toneBlue
class node_inputmgr,node_inputsvc,node_mapping,node_inputstate,node_virtual toneAmber
class node_physical,node_analog,node_blissbox toneMint
class node_webserver,node_webdevice,node_dsu,node_telemetry toneRose
class node_profiles,node_workshop,node_preview,node_game toneIndigo
```

## Components

### App experience

- [PadForge app](https://github.com/hifihedgehog/padforge/blob/main/PadForge.App/App.xaml.cs): `PadForge.App/App.xaml.cs`
- [Settings](https://github.com/hifihedgehog/padforge/blob/main/PadForge.App/Common/SettingsManager.cs): `PadForge.App/Common/SettingsManager.cs`
- [Dashboard and device UI](https://github.com/hifihedgehog/padforge/blob/main/PadForge.App/ViewModels/DashboardViewModel.cs): `PadForge.App/ViewModels/DashboardViewModel.cs`

### Input runtime

- [InputManager](https://github.com/hifihedgehog/padforge/blob/main/PadForge.App/Common/Input/InputManager.cs): `PadForge.App/Common/Input/InputManager.cs`
- [Input service](https://github.com/hifihedgehog/padforge/blob/main/PadForge.App/Services/InputService.cs): `PadForge.App/Services/InputService.cs`
- [Mapping evaluation](https://github.com/hifihedgehog/padforge/blob/main/PadForge.Engine/Common/Mapping/SourceCoercion.cs): `PadForge.Engine/Common/Mapping/SourceCoercion.cs`
- [Input state model](https://github.com/hifihedgehog/padforge/blob/main/PadForge.Engine/Common/CustomInputState.cs): `PadForge.Engine/Common/CustomInputState.cs`
- [Virtual controllers](https://github.com/hifihedgehog/padforge/blob/main/PadForge.Engine/Common/VirtualControllerTypes.cs): `PadForge.Engine/Common/VirtualControllerTypes.cs`

### Input devices

- [Connected controllers](https://github.com/hifihedgehog/padforge/blob/main/PadForge.Engine/Common/SdlDeviceWrapper.cs): `PadForge.Engine/Common/SdlDeviceWrapper.cs`
- [Analog keyboards](https://github.com/hifihedgehog/padforge/blob/main/PadForge.App/Common/Input/AnalogKeyboardRuntime.cs): `PadForge.App/Common/Input/AnalogKeyboardRuntime.cs`
- [Bliss-Box adapters](https://github.com/hifihedgehog/padforge/blob/main/PadForge.Engine/Common/BlissBox/BlissBoxControllers.cs): `PadForge.Engine/Common/BlissBox/BlissBoxControllers.cs`

### Services and integrations

- [Web controller server](https://github.com/hifihedgehog/padforge/blob/main/PadForge.App/Services/WebControllerServer.cs): `PadForge.App/Services/WebControllerServer.cs`
- [Browser gamepad device](https://github.com/hifihedgehog/padforge/blob/main/PadForge.Engine/Common/WebControllerDevice.cs): `PadForge.Engine/Common/WebControllerDevice.cs`
- [DSU motion server](https://github.com/hifihedgehog/padforge/blob/main/PadForge.App/Services/DsuMotionServer.cs): `PadForge.App/Services/DsuMotionServer.cs`
- [Racing telemetry](https://github.com/hifihedgehog/padforge/blob/main/PadForge.App/Common/Telemetry/TelemetryHub.cs): `PadForge.App/Common/Telemetry/TelemetryHub.cs`

### Profiles and previews

- [User profiles](https://github.com/hifihedgehog/padforge/blob/main/PadForge.Engine/Data/UserDevice.cs): `PadForge.Engine/Data/UserDevice.cs`
- [Steam Workshop clients](https://github.com/hifihedgehog/padforge/blob/main/PadForge.SteamWorkshop/Api/SteamWorkshopClient.cs): `PadForge.SteamWorkshop/Api/SteamWorkshopClient.cs`
- [Controller previews](https://github.com/hifihedgehog/padforge/blob/main/PadForge.App/Models3D/ControllerModelBase.cs): `PadForge.App/Models3D/ControllerModelBase.cs`

### Other components

- **User**
- **Phone browser**
- **Games**

## Connections

- User → PadForge app: configures (evidence: `README.md`)
- PadForge app → Settings: uses settings
- User → Connected controllers: connects devices (evidence: `README.md`)
- Connected controllers → InputManager: supplies input (evidence: `README.md`)
- Analog keyboards → InputManager: supplies key depth (evidence: `README.md`)
- Bliss-Box adapters → InputManager: supplies adapter input (evidence: `README.md`)
- Phone browser → Web controller server: connects remotely (evidence: `README.md`)
- Web controller server → Browser gamepad device: dispatches reports
- Browser gamepad device → InputManager: supplies gamepad input
- Input service → InputManager: manages runtime
- InputManager → Input state model: updates state (evidence: `PadForge.App/Common/Input/InputManager.cs`)
- InputManager → Mapping evaluation: evaluates mappings (evidence: `PadForge.App/Common/Input/InputManager.cs`)
- InputManager → Virtual controllers: drives outputs (evidence: `README.md`)
- User → User profiles: configures mappings (evidence: `README.md`)
- User profiles → InputManager: provides mapping sets (evidence: `PadForge.App/Common/Input/InputManager.cs`)
- InputManager → Games: presents virtual pad (evidence: `README.md`)
- InputManager → DSU motion server: publishes motion (evidence: `PadForge.App/Common/Input/InputManager.cs`)
- Racing telemetry → InputManager: feeds racing data
- User → Steam Workshop clients: opts into configs
- Steam Workshop clients → User profiles: provides community configs
- Dashboard and device UI → Controller previews: shows controller model
- User → Dashboard and device UI: views device state (evidence: `README.md`)
