# hazardos1/csam- architecture

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

- Interactive diagram: https://gitdiagram.com/hazardos1/csam-
- Repository: https://github.com/hazardos1/csam-

## Overview

CS2 Account Manager is an Electron desktop app for managing a user's Steam accounts, encrypted credentials and authenticators, CS2 status scans, and launching accounts in Steam. The main workflow is to unlock or import accounts, manage their credentials/authenticator, scan account status through Steam and the CS2 Game Coordinator, then review results in the interface. The graph also includes authenticator creation/removal, confirmations, backup, and account launch. Relationships reflect the shown main-process dispatch and documented workflows; renderer-to-main IPC details and several unsampled subsystem internals are not fully visible, so those links are marked unverified.

Main entry points: [`src/main/main.js`](https://github.com/hazardos1/csam-/blob/main/src/main/main.js) (Electron coordinator), [`src/main/scanner.js`](https://github.com/hazardos1/csam-/blob/main/src/main/scanner.js) (Scan engine), [`src/renderer/renderer.js`](https://github.com/hazardos1/csam-/blob/main/src/renderer/renderer.js) (Account UI), [`src/main/authenticator.js`](https://github.com/hazardos1/csam-/blob/main/src/main/authenticator.js) (Authenticator flow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Desktop interface"]
  node_renderer["Account UI<br/>[renderer.js]"]
  node_translations["Translations<br/>[i18n.js]"]
  node_preload["IPC bridge<br/>[preload.js]"]
  node_main["Electron coordinator<br/>[main.js]"]
end

subgraph group_accounts["Account and vault"]
  node_vault[("Encrypted vault<br/>[vault.js]")]
  node_vault_crypto["Vault encryption<br/>[crypto.js]"]
  node_sda["SDA import/export<br/>[sda.js]"]
end

subgraph group_steam["Steam account operations"]
  node_authenticator["Authenticator flow<br/>[authenticator.js]"]
  node_totp["Steam Guard codes<br/>[main.js]"]
  node_confirmations["Mobile confirmations<br/>[confirmations.js]"]
  node_autofill["Confirmation autofill<br/>[autofill.js]"]
  node_launcher["Steam account launch<br/>[launcher.js]"]
  node_redact["Secret redaction<br/>[redact.js]"]
end

subgraph group_scanning["CS2 status scanning"]
  node_scanner["Scan engine<br/>[scanner.js]"]
  node_data["Status normalization<br/>[cs2data.js]"]
end

node_user(("Account owner"))
node_steam{{"Steam services"}}
node_gc{{"CS2 Game Coordinator"}}

node_user -->|"uses"| node_renderer
node_renderer -->|"localizes"| node_translations
node_renderer -.->|"invokes IPC"| node_preload
node_preload -.->|"forwards IPC"| node_main
node_main -->|"manages accounts"| node_vault
node_vault -->|"encrypts data"| node_vault_crypto
node_main -->|"imports and exports"| node_sda
node_main -->|"dispatches flow"| node_authenticator
node_authenticator -->|"requests authenticator"| node_steam
node_main -->|"handles responses"| node_confirmations
node_main -->|"dispatches"| node_autofill
node_main -->|"launches account"| node_launcher
node_main -->|"controls scans"| node_scanner
node_scanner -->|"logs in"| node_steam
node_scanner -->|"requests CS2 data"| node_gc
node_scanner -->|"normalizes results"| node_data
node_main -->|"generates codes"| node_totp
node_authenticator -->|"redacts logs"| node_redact
node_scanner -->|"redacts logs"| node_redact
node_confirmations -->|"redacts logs"| node_redact
node_main -->|"backs up vault"| node_vault
node_launcher -->|"starts client"| node_steam

click node_renderer "https://github.com/hazardos1/csam-/blob/main/src/renderer/renderer.js"
click node_translations "https://github.com/hazardos1/csam-/blob/main/src/renderer/i18n.js"
click node_preload "https://github.com/hazardos1/csam-/blob/main/src/main/preload.js"
click node_main "https://github.com/hazardos1/csam-/blob/main/src/main/main.js"
click node_vault "https://github.com/hazardos1/csam-/blob/main/src/main/vault.js"
click node_vault_crypto "https://github.com/hazardos1/csam-/blob/main/src/main/crypto.js"
click node_sda "https://github.com/hazardos1/csam-/blob/main/src/main/sda.js"
click node_authenticator "https://github.com/hazardos1/csam-/blob/main/src/main/authenticator.js"
click node_totp "https://github.com/hazardos1/csam-/blob/main/src/main/main.js"
click node_confirmations "https://github.com/hazardos1/csam-/blob/main/src/main/confirmations.js"
click node_autofill "https://github.com/hazardos1/csam-/blob/main/src/main/autofill.js"
click node_launcher "https://github.com/hazardos1/csam-/blob/main/src/main/launcher.js"
click node_redact "https://github.com/hazardos1/csam-/blob/main/src/main/redact.js"
click node_scanner "https://github.com/hazardos1/csam-/blob/main/src/main/scanner.js"
click node_data "https://github.com/hazardos1/csam-/blob/main/src/main/cs2data.js"

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_renderer,node_translations,node_preload,node_main toneBlue
class node_vault,node_vault_crypto,node_sda toneAmber
class node_authenticator,node_totp,node_confirmations,node_autofill,node_launcher,node_redact toneMint
class node_scanner,node_data toneRose
class node_user,node_steam,node_gc toneIndigo
```

## Components

### Desktop interface

- [Account UI](https://github.com/hazardos1/csam-/blob/main/src/renderer/renderer.js): `src/renderer/renderer.js`
- [Translations](https://github.com/hazardos1/csam-/blob/main/src/renderer/i18n.js): `src/renderer/i18n.js`
- [IPC bridge](https://github.com/hazardos1/csam-/blob/main/src/main/preload.js): `src/main/preload.js`
- [Electron coordinator](https://github.com/hazardos1/csam-/blob/main/src/main/main.js): `src/main/main.js`

### Account and vault

- [Encrypted vault](https://github.com/hazardos1/csam-/blob/main/src/main/vault.js): `src/main/vault.js`
- [Vault encryption](https://github.com/hazardos1/csam-/blob/main/src/main/crypto.js): `src/main/crypto.js`
- [SDA import/export](https://github.com/hazardos1/csam-/blob/main/src/main/sda.js): `src/main/sda.js`

### Steam account operations

- [Authenticator flow](https://github.com/hazardos1/csam-/blob/main/src/main/authenticator.js): `src/main/authenticator.js`
- [Steam Guard codes](https://github.com/hazardos1/csam-/blob/main/src/main/main.js): `src/main/main.js`
- [Mobile confirmations](https://github.com/hazardos1/csam-/blob/main/src/main/confirmations.js): `src/main/confirmations.js`
- [Confirmation autofill](https://github.com/hazardos1/csam-/blob/main/src/main/autofill.js): `src/main/autofill.js`
- [Steam account launch](https://github.com/hazardos1/csam-/blob/main/src/main/launcher.js): `src/main/launcher.js`
- [Secret redaction](https://github.com/hazardos1/csam-/blob/main/src/main/redact.js): `src/main/redact.js`

### CS2 status scanning

- [Scan engine](https://github.com/hazardos1/csam-/blob/main/src/main/scanner.js): `src/main/scanner.js`
- [Status normalization](https://github.com/hazardos1/csam-/blob/main/src/main/cs2data.js): `src/main/cs2data.js`

### Other components

- **Account owner**
- **Steam services**
- **CS2 Game Coordinator**

## Connections

- Account owner → Account UI: uses (evidence: `README.md`)
- Account UI → Translations: localizes (evidence: `README.md`)
- Account UI → IPC bridge: invokes IPC
- IPC bridge → Electron coordinator: forwards IPC
- Electron coordinator → Encrypted vault: manages accounts (evidence: `src/main/main.js`)
- Encrypted vault → Vault encryption: encrypts data (evidence: `src/main/vault.js`)
- Electron coordinator → SDA import/export: imports and exports (evidence: `src/main/main.js`)
- Electron coordinator → Authenticator flow: dispatches flow (evidence: `src/main/main.js`)
- Authenticator flow → Steam services: requests authenticator (evidence: `README.md`)
- Electron coordinator → Mobile confirmations: handles responses (evidence: `src/main/main.js`)
- Electron coordinator → Confirmation autofill: dispatches (evidence: `src/main/main.js`)
- Electron coordinator → Steam account launch: launches account (evidence: `src/main/main.js`)
- Electron coordinator → Scan engine: controls scans (evidence: `src/main/main.js`)
- Scan engine → Steam services: logs in (evidence: `README.md`)
- Scan engine → CS2 Game Coordinator: requests CS2 data (evidence: `README.md`)
- Scan engine → Status normalization: normalizes results (evidence: `src/main/scanner.js`)
- Electron coordinator → Steam Guard codes: generates codes (evidence: `src/main/main.js`)
- Authenticator flow → Secret redaction: redacts logs (evidence: `src/main/authenticator.js`)
- Scan engine → Secret redaction: redacts logs (evidence: `src/main/scanner.js`)
- Mobile confirmations → Secret redaction: redacts logs (evidence: `src/main/confirmations.js`)
- Electron coordinator → Encrypted vault: backs up vault (evidence: `README.md`)
- Steam account launch → Steam services: starts client (evidence: `src/main/launcher.js`)
