# fakearchie/nfatool architecture

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

- Interactive diagram: https://gitdiagram.com/fakearchie/nfatool
- Repository: https://github.com/fakearchie/nfatool

## Overview

nfa.pub Loader is a Windows desktop app for token-based Steam sign-in and managing nfa.pub CS2 accounts. Its main workflow is sign-in, retain accounts in history, and purchase or replace accounts through the nfa.pub API. Separate branches cover account status, loadouts, Workshop cleanup, settings, and updates. Edges reflect README statements and the supplied source index; unsampled implementation details are not assumed.

Main entry points: [`NfaLoader/Services/AppState.cs`](https://github.com/fakearchie/nfatool/blob/main/NfaLoader/Services/AppState.cs) (App state and navigation), [`NfaLoader/Pages/LoginPage.xaml.cs`](https://github.com/fakearchie/nfatool/blob/main/NfaLoader/Pages/LoginPage.xaml.cs) (Token sign-in), [`NfaLoader/Pages/HistoryPage.xaml.cs`](https://github.com/fakearchie/nfatool/blob/main/NfaLoader/Pages/HistoryPage.xaml.cs) (History and imports), [`NfaLoader/Pages/NfaReplaceFlow.cs`](https://github.com/fakearchie/nfatool/blob/main/NfaLoader/Pages/NfaReplaceFlow.cs) (Replacement flow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App shell"]
  node_shell["App state and navigation<br/>[AppState.cs]"]
  node_localization["Localization<br/>[Loc.cs]"]
end

subgraph group_accounts["Accounts"]
  node_login["Token sign-in<br/>[LoginPage.xaml.cs]"]
  node_history[("Account history")]
  node_historyui["History and imports"]
  node_accountmodel["Account records"]
end

subgraph group_steam["Steam and CS2"]
  node_steamlogin["Steam token login"]
  node_steamcm["Steam CM client<br/>[SteamCmClient.cs]"]
  node_premier["Premier score"]
  node_loadoutui["Loadout editor"]
  node_loadout["Loadout apply"]
  node_workshop["Workshop cleanup"]
  node_cloud["CS2 settings push<br/>[Cs2CloudService.cs]"]
end

subgraph group_commerce["nfa.pub commerce"]
  node_replace["Replacement flow<br/>[NfaReplaceFlow.cs]"]
  node_warranty["Replacement warranty<br/>[NfaWarranty.cs]"]
  node_nfa["nfa.pub API client<br/>[NfaPubClient.cs]"]
  node_nfaservice["Purchase and stock UI<br/>[LoginPage.xaml.cs]"]
end

subgraph group_support["Preferences and updates"]
  node_settingsui["Settings"]
  node_settings[("Settings storage<br/>[SettingsService.cs]")]
  node_updates["Update check"]
end

node_user(("User"))
node_steamservice["Steam"]
node_nfaserviceext["nfa.pub service"]
node_github["GitHub releases"]

node_user -->|"enters token"| node_login
node_login -->|"starts sign-in"| node_steamlogin
node_steamlogin -.->|"authenticates with"| node_steamservice
node_login -->|"records account"| node_history
node_historyui -->|"loads and updates"| node_history
node_history -->|"persists records"| node_accountmodel
node_user -->|"manages accounts"| node_historyui
node_historyui -->|"starts replacement"| node_replace
node_replace -->|"checks eligibility"| node_warranty
node_replace -->|"requests replacement"| node_nfa
node_nfa -->|"calls API"| node_nfaserviceext
node_user -->|"buys account"| node_nfaservice
node_nfaservice -->|"checks stock and buys"| node_nfa
node_user -->|"edits loadout"| node_loadoutui
node_loadoutui -.->|"applies preset"| node_loadout
node_loadout -->|"uses Steam CM"| node_steamcm
node_user -->|"clears subscriptions"| node_workshop
node_user -->|"refreshes account status"| node_premier
node_user -->|"configures app"| node_settingsui
node_settingsui -->|"loads and saves"| node_settings
node_settingsui -->|"configures cloud push"| node_cloud
node_shell -->|"loads preferences"| node_settings
node_shell -->|"initializes language"| node_localization
node_shell -->|"checks for updates"| node_updates
node_updates -->|"checks releases"| node_github

click node_shell "https://github.com/fakearchie/nfatool/blob/main/NfaLoader/Services/AppState.cs"
click node_login "https://github.com/fakearchie/nfatool/blob/main/NfaLoader/Pages/LoginPage.xaml.cs"
click node_steamlogin "https://github.com/fakearchie/nfatool/blob/main/NfaLoader/Services/SteamLoginService.cs"
click node_history "https://github.com/fakearchie/nfatool/blob/main/NfaLoader/Services/AccountHistoryService.cs"
click node_historyui "https://github.com/fakearchie/nfatool/blob/main/NfaLoader/Pages/HistoryPage.xaml.cs"
click node_accountmodel "https://github.com/fakearchie/nfatool/blob/main/NfaLoader/Models/SteamAccountHistoryItem.cs"
click node_replace "https://github.com/fakearchie/nfatool/blob/main/NfaLoader/Pages/NfaReplaceFlow.cs"
click node_warranty "https://github.com/fakearchie/nfatool/blob/main/NfaLoader/Services/NfaWarranty.cs"
click node_nfa "https://github.com/fakearchie/nfatool/blob/main/NfaLoader/Services/NfaPubClient.cs"
click node_nfaservice "https://github.com/fakearchie/nfatool/blob/main/NfaLoader/Pages/LoginPage.xaml.cs"
click node_steamcm "https://github.com/fakearchie/nfatool/blob/main/NfaLoader/Services/SteamCmClient.cs"
click node_premier "https://github.com/fakearchie/nfatool/blob/main/NfaLoader/Services/CsPremierScoreService.cs"
click node_loadoutui "https://github.com/fakearchie/nfatool/blob/main/NfaLoader/Pages/LoadoutPage.xaml.cs"
click node_loadout "https://github.com/fakearchie/nfatool/blob/main/NfaLoader/Services/CsLoadoutService.cs"
click node_workshop "https://github.com/fakearchie/nfatool/blob/main/NfaLoader/Services/SteamWorkshopService.cs"
click node_settingsui "https://github.com/fakearchie/nfatool/blob/main/NfaLoader/Pages/SettingsPage.xaml.cs"
click node_settings "https://github.com/fakearchie/nfatool/blob/main/NfaLoader/Services/SettingsService.cs"
click node_cloud "https://github.com/fakearchie/nfatool/blob/main/NfaLoader/Services/Cs2CloudService.cs"
click node_localization "https://github.com/fakearchie/nfatool/blob/main/NfaLoader/Localization/Loc.cs"
click node_updates "https://github.com/fakearchie/nfatool/blob/main/NfaLoader/Services/GitHubUpdateService.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_shell,node_localization,node_user toneBlue
class node_login,node_history,node_historyui,node_accountmodel toneAmber
class node_steamlogin,node_steamcm,node_premier,node_loadoutui,node_loadout,node_workshop,node_cloud toneMint
class node_replace,node_warranty,node_nfa,node_nfaservice toneRose
class node_settingsui,node_settings,node_updates,node_steamservice,node_nfaserviceext,node_github toneIndigo
```

## Components

### App shell

- [App state and navigation](https://github.com/fakearchie/nfatool/blob/main/NfaLoader/Services/AppState.cs): `NfaLoader/Services/AppState.cs`
- [Localization](https://github.com/fakearchie/nfatool/blob/main/NfaLoader/Localization/Loc.cs): `NfaLoader/Localization/Loc.cs`

### Accounts

- [Token sign-in](https://github.com/fakearchie/nfatool/blob/main/NfaLoader/Pages/LoginPage.xaml.cs): `NfaLoader/Pages/LoginPage.xaml.cs`
- [Account history](https://github.com/fakearchie/nfatool/blob/main/NfaLoader/Services/AccountHistoryService.cs): `NfaLoader/Services/AccountHistoryService.cs`
- [History and imports](https://github.com/fakearchie/nfatool/blob/main/NfaLoader/Pages/HistoryPage.xaml.cs): `NfaLoader/Pages/HistoryPage.xaml.cs`
- [Account records](https://github.com/fakearchie/nfatool/blob/main/NfaLoader/Models/SteamAccountHistoryItem.cs): `NfaLoader/Models/SteamAccountHistoryItem.cs`

### Steam and CS2

- [Steam token login](https://github.com/fakearchie/nfatool/blob/main/NfaLoader/Services/SteamLoginService.cs): `NfaLoader/Services/SteamLoginService.cs`
- [Steam CM client](https://github.com/fakearchie/nfatool/blob/main/NfaLoader/Services/SteamCmClient.cs): `NfaLoader/Services/SteamCmClient.cs`
- [Premier score](https://github.com/fakearchie/nfatool/blob/main/NfaLoader/Services/CsPremierScoreService.cs): `NfaLoader/Services/CsPremierScoreService.cs`
- [Loadout editor](https://github.com/fakearchie/nfatool/blob/main/NfaLoader/Pages/LoadoutPage.xaml.cs): `NfaLoader/Pages/LoadoutPage.xaml.cs`
- [Loadout apply](https://github.com/fakearchie/nfatool/blob/main/NfaLoader/Services/CsLoadoutService.cs): `NfaLoader/Services/CsLoadoutService.cs`
- [Workshop cleanup](https://github.com/fakearchie/nfatool/blob/main/NfaLoader/Services/SteamWorkshopService.cs): `NfaLoader/Services/SteamWorkshopService.cs`
- [CS2 settings push](https://github.com/fakearchie/nfatool/blob/main/NfaLoader/Services/Cs2CloudService.cs): `NfaLoader/Services/Cs2CloudService.cs`

### nfa.pub commerce

- [Replacement flow](https://github.com/fakearchie/nfatool/blob/main/NfaLoader/Pages/NfaReplaceFlow.cs): `NfaLoader/Pages/NfaReplaceFlow.cs`
- [Replacement warranty](https://github.com/fakearchie/nfatool/blob/main/NfaLoader/Services/NfaWarranty.cs): `NfaLoader/Services/NfaWarranty.cs`
- [nfa.pub API client](https://github.com/fakearchie/nfatool/blob/main/NfaLoader/Services/NfaPubClient.cs): `NfaLoader/Services/NfaPubClient.cs`
- [Purchase and stock UI](https://github.com/fakearchie/nfatool/blob/main/NfaLoader/Pages/LoginPage.xaml.cs): `NfaLoader/Pages/LoginPage.xaml.cs`

### Preferences and updates

- [Settings](https://github.com/fakearchie/nfatool/blob/main/NfaLoader/Pages/SettingsPage.xaml.cs): `NfaLoader/Pages/SettingsPage.xaml.cs`
- [Settings storage](https://github.com/fakearchie/nfatool/blob/main/NfaLoader/Services/SettingsService.cs): `NfaLoader/Services/SettingsService.cs`
- [Update check](https://github.com/fakearchie/nfatool/blob/main/NfaLoader/Services/GitHubUpdateService.cs): `NfaLoader/Services/GitHubUpdateService.cs`

### Other components

- **User**
- **Steam**
- **nfa.pub service**
- **GitHub releases**

## Connections

- User → Token sign-in: enters token
- Token sign-in → Steam token login: starts sign-in (evidence: `NfaLoader/Pages/LoginPage.xaml.cs`)
- Steam token login → Steam: authenticates with
- Token sign-in → Account history: records account (evidence: `NfaLoader/Pages/LoginPage.xaml.cs`)
- History and imports → Account history: loads and updates (evidence: `NfaLoader/Pages/HistoryPage.xaml.cs`)
- Account history → Account records: persists records (evidence: `NfaLoader/Services/AccountHistoryService.cs`)
- User → History and imports: manages accounts
- History and imports → Replacement flow: starts replacement (evidence: `NfaLoader/Pages/HistoryPage.xaml.cs`)
- Replacement flow → Replacement warranty: checks eligibility (evidence: `NfaLoader/Pages/NfaReplaceFlow.cs`)
- Replacement flow → nfa.pub API client: requests replacement (evidence: `NfaLoader/Pages/NfaReplaceFlow.cs`)
- nfa.pub API client → nfa.pub service: calls API
- User → Purchase and stock UI: buys account
- Purchase and stock UI → nfa.pub API client: checks stock and buys (evidence: `NfaLoader/Pages/LoginPage.xaml.cs`)
- User → Loadout editor: edits loadout
- Loadout editor → Loadout apply: applies preset
- Loadout apply → Steam CM client: uses Steam CM (evidence: `NfaLoader/Services/CsLoadoutService.cs`)
- User → Workshop cleanup: clears subscriptions
- User → Premier score: refreshes account status
- User → Settings: configures app
- Settings → Settings storage: loads and saves (evidence: `NfaLoader/Pages/SettingsPage.xaml.cs`)
- Settings → CS2 settings push: configures cloud push (evidence: `NfaLoader/Pages/SettingsPage.xaml.cs`)
- App state and navigation → Settings storage: loads preferences (evidence: `NfaLoader/App.xaml.cs`)
- App state and navigation → Localization: initializes language (evidence: `NfaLoader/App.xaml.cs`)
- App state and navigation → Update check: checks for updates (evidence: `NfaLoader/MainWindow.xaml.cs`)
- Update check → GitHub releases: checks releases (evidence: `NfaLoader/Services/GitHubUpdateService.cs`)
