# netniv/stfc-mod architecture

> Architecture diagram of the GitHub repository netniv/stfc-mod, 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/netniv/stfc-mod
- Repository: https://github.com/netniv/stfc-mod

## Overview

This repository provides a Star Trek Fleet Command community mod, with Windows and macOS injection entry points, plus a macOS launcher/updater. The main runtime path injects the mod and applies game patches; configuration and documented gameplay/UI features form supporting branches. The launcher presents update actions through a view model backed by Xsolla update logic. Feature coverage uses README-documented capabilities and tree paths; most individual patch implementations were not sampled, so their internal call relationships are not asserted.

Main entry points: [`mods/src/patches/patches.cc`](https://github.com/netniv/stfc-mod/blob/main/mods/src/patches/patches.cc) (Patch Application), [`win-proxy-dll/src/main.cc`](https://github.com/netniv/stfc-mod/blob/main/win-proxy-dll/src/main.cc) (Windows Proxy), [`macos-loader/src/main.cc`](https://github.com/netniv/stfc-mod/blob/main/macos-loader/src/main.cc) (macOS Loader), [`macos-dylib/src/main.cc`](https://github.com/netniv/stfc-mod/blob/main/macos-dylib/src/main.cc) (macOS Mod Library)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Launch and Injection"]
  node_windows["Windows Proxy<br/>[main.cc]"]
  node_macloader["macOS Loader<br/>[main.cc]"]
  node_macdylib["macOS Mod Library<br/>[main.cc]"]
end

subgraph group_launcher["macOS Updater"]
  node_launcherui["Updater Views<br/>[ActionView.swift]"]
  node_viewmodel["Updater View Model"]
  node_xsolla["Game Update Logic<br/>[XsollaLib.swift]"]
end

subgraph group_runtime["Mod Runtime"]
  node_patches["Patch Application<br/>[patches.cc]"]
  node_config["Mod Configuration<br/>[config.h]"]
  node_notifications["Toast Notifications"]
end

subgraph group_features["Gameplay Features"]
  node_fleet["Fleet Actions<br/>[FleetsManager.h]"]
  node_queue["Action Queue"]
  node_deployment["Fleet Deployment"]
  node_chat["Chat Preview"]
  node_ui["UI and Navigation Tweaks"]
  node_combat["Combat and Fleet Tweaks"]
end

node_user(("Player"))

node_user -.->|"launches game"| node_windows
node_windows -->|"applies patches"| node_patches
node_user -.->|"launches game"| node_macloader
node_macloader -->|"preloads library"| node_macdylib
node_macdylib -->|"applies patches"| node_patches
node_user -.->|"requests update"| node_launcherui
node_launcherui -->|"uses view model"| node_viewmodel
node_viewmodel -->|"calls update logic"| node_xsolla
node_config -.->|"configures features"| node_patches
node_patches -.->|"enables tweaks"| node_ui
node_patches -.->|"enables tweaks"| node_combat
node_fleet -->|"requests tow"| node_deployment
node_queue -->|"uses fleet data"| node_fleet
node_notifications -->|"reads settings"| node_config

click node_windows "https://github.com/netniv/stfc-mod/blob/main/win-proxy-dll/src/main.cc"
click node_macloader "https://github.com/netniv/stfc-mod/blob/main/macos-loader/src/main.cc"
click node_macdylib "https://github.com/netniv/stfc-mod/blob/main/macos-dylib/src/main.cc"
click node_patches "https://github.com/netniv/stfc-mod/blob/main/mods/src/patches/patches.cc"
click node_config "https://github.com/netniv/stfc-mod/blob/main/mods/src/config.h"
click node_notifications "https://github.com/netniv/stfc-mod/blob/main/mods/src/patches/notification_service.cc"
click node_fleet "https://github.com/netniv/stfc-mod/blob/main/mods/src/prime/FleetsManager.h"
click node_queue "https://github.com/netniv/stfc-mod/blob/main/mods/src/prime/ActionQueueManager.h"
click node_deployment "https://github.com/netniv/stfc-mod/blob/main/mods/src/prime/DeploymentManager.h"
click node_chat "https://github.com/netniv/stfc-mod/blob/main/mods/src/prime/ChatPreviewController.h"
click node_ui "https://github.com/netniv/stfc-mod/tree/main/mods/src/patches/parts"
click node_combat "https://github.com/netniv/stfc-mod/tree/main/mods/src/patches/parts"
click node_launcherui "https://github.com/netniv/stfc-mod/blob/main/macos-launcher/src/ActionView.swift"
click node_viewmodel "https://github.com/netniv/stfc-mod/blob/main/macos-launcher/src/ViewModel/GameUpdaterViewModel.swift"
click node_xsolla "https://github.com/netniv/stfc-mod/blob/main/macos-launcher/src/XsollaLib.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_windows,node_macloader,node_macdylib toneBlue
class node_launcherui,node_viewmodel,node_xsolla toneAmber
class node_patches,node_config,node_notifications toneMint
class node_fleet,node_queue,node_deployment,node_chat,node_ui,node_combat toneRose
class node_user toneIndigo
```

## Components

### Launch and Injection

- [Windows Proxy](https://github.com/netniv/stfc-mod/blob/main/win-proxy-dll/src/main.cc): `win-proxy-dll/src/main.cc`
- [macOS Loader](https://github.com/netniv/stfc-mod/blob/main/macos-loader/src/main.cc): `macos-loader/src/main.cc`
- [macOS Mod Library](https://github.com/netniv/stfc-mod/blob/main/macos-dylib/src/main.cc): `macos-dylib/src/main.cc`

### macOS Updater

- [Updater Views](https://github.com/netniv/stfc-mod/blob/main/macos-launcher/src/ActionView.swift): `macos-launcher/src/ActionView.swift`
- [Updater View Model](https://github.com/netniv/stfc-mod/blob/main/macos-launcher/src/ViewModel/GameUpdaterViewModel.swift): `macos-launcher/src/ViewModel/GameUpdaterViewModel.swift`
- [Game Update Logic](https://github.com/netniv/stfc-mod/blob/main/macos-launcher/src/XsollaLib.swift): `macos-launcher/src/XsollaLib.swift`

### Mod Runtime

- [Patch Application](https://github.com/netniv/stfc-mod/blob/main/mods/src/patches/patches.cc): `mods/src/patches/patches.cc`
- [Mod Configuration](https://github.com/netniv/stfc-mod/blob/main/mods/src/config.h): `mods/src/config.h`
- [Toast Notifications](https://github.com/netniv/stfc-mod/blob/main/mods/src/patches/notification_service.cc): `mods/src/patches/notification_service.cc`

### Gameplay Features

- [Fleet Actions](https://github.com/netniv/stfc-mod/blob/main/mods/src/prime/FleetsManager.h): `mods/src/prime/FleetsManager.h`
- [Action Queue](https://github.com/netniv/stfc-mod/blob/main/mods/src/prime/ActionQueueManager.h): `mods/src/prime/ActionQueueManager.h`
- [Fleet Deployment](https://github.com/netniv/stfc-mod/blob/main/mods/src/prime/DeploymentManager.h): `mods/src/prime/DeploymentManager.h`
- [Chat Preview](https://github.com/netniv/stfc-mod/blob/main/mods/src/prime/ChatPreviewController.h): `mods/src/prime/ChatPreviewController.h`
- [UI and Navigation Tweaks](https://github.com/netniv/stfc-mod/tree/main/mods/src/patches/parts): `mods/src/patches/parts`
- [Combat and Fleet Tweaks](https://github.com/netniv/stfc-mod/tree/main/mods/src/patches/parts): `mods/src/patches/parts`

### Other components

- **Player**

## Connections

- Player → Windows Proxy: launches game (evidence: `README.md`)
- Windows Proxy → Patch Application: applies patches (evidence: `win-proxy-dll/src/main.cc`)
- Player → macOS Loader: launches game (evidence: `README.md`)
- macOS Loader → macOS Mod Library: preloads library (evidence: `macos-loader/src/main.cc`)
- macOS Mod Library → Patch Application: applies patches (evidence: `macos-dylib/src/main.cc`)
- Player → Updater Views: requests update (evidence: `README.md`)
- Updater Views → Updater View Model: uses view model (evidence: `macos-launcher/src/ActionView.swift`)
- Updater View Model → Game Update Logic: calls update logic (evidence: `macos-launcher/src/ViewModel/GameUpdaterViewModel.swift`)
- Mod Configuration → Patch Application: configures features (evidence: `README.md`)
- Patch Application → UI and Navigation Tweaks: enables tweaks (evidence: `README.md`)
- Patch Application → Combat and Fleet Tweaks: enables tweaks (evidence: `README.md`)
- Fleet Actions → Fleet Deployment: requests tow (evidence: `mods/src/prime/FleetsManager.h`)
- Action Queue → Fleet Actions: uses fleet data (evidence: `mods/src/prime/ActionQueueManager.h`)
- Toast Notifications → Mod Configuration: reads settings (evidence: `mods/src/patches/notification_service.cc`)
