# alrrstd/aircard-windows architecture

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

- Interactive diagram: https://gitdiagram.com/alrrstd/aircard-windows
- Repository: https://github.com/alrrstd/aircard-windows

## Overview

AirCard is a Windows desktop and interactive-CLI tool for customizing Apple Wallet card artwork on a connected iPhone. The main workflow is to detect or select a card, prepare artwork, then write card assets and invalidate caches; the Apple Cash studio adds 3D-metal asset generation and flashing. The README also documents card restoration and holographic effects. Source excerpts show the core flash and sync mechanisms, but not every GUI action or restoration implementation, so those relationships are documented at the product level where needed.

Main entry points: [`aircard/core_flasher.py`](https://github.com/alrrstd/aircard-windows/blob/main/aircard/core_flasher.py) (Card asset flasher), [`app.py`](https://github.com/alrrstd/aircard-windows/blob/main/app.py) (Desktop studio), [`aircard/cli.py`](https://github.com/alrrstd/aircard-windows/blob/main/aircard/cli.py) (Interactive CLI), [`aircard/apple_cash.py`](https://github.com/alrrstd/aircard-windows/blob/main/aircard/apple_cash.py) (Apple Cash 3D assets)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User interfaces"]
  node_gui["Desktop studio<br/>[app.py]"]
  node_cli["Interactive CLI<br/>[cli.py]"]
  node_cli_entry["CLI launcher<br/>[main.py]"]
end

subgraph group_cards["Card discovery"]
  node_scanner["Live card scanner<br/>[scanner.py]"]
  node_catalog[("Saved card catalog<br/>[scanner.py]")]
  node_config["Card and asset config<br/>[config.py]"]
end

subgraph group_artwork["Artwork studio"]
  node_image["Skin image processing<br/>[image_util.py]"]
  node_cash_studio["Apple Cash 3D assets<br/>[apple_cash.py]"]
end

subgraph group_device_ops["Device and flashing"]
  node_device["Device and lockdown<br/>[device.py]"]
  node_flasher["Card asset flasher<br/>[core_flasher.py]"]
  node_airtraffic["AirTraffic sync bridge<br/>[airtraffic.py]"]
end

node_user(("User"))
node_iphone(("Connected iPhone"))
node_apple_dlls["Apple device DLLs"]
node_apple_wallet["Apple Wallet"]
node_factory_assets["Apple factory assets"]

node_user -->|"uses"| node_gui
node_user -->|"launches"| node_cli_entry
node_cli_entry -->|"calls"| node_cli
node_gui -->|"scans cards"| node_scanner
node_gui -->|"manages cards"| node_catalog
node_cli -->|"scans cards"| node_scanner
node_cli -->|"reads and saves"| node_catalog
node_scanner -->|"persists metadata"| node_catalog
node_scanner -->|"uses paths and patterns"| node_config
node_scanner -->|"opens lockdown"| node_device
node_gui -->|"prepares artwork"| node_image
node_cli -->|"prepares artwork"| node_image
node_gui -->|"flashes card skin"| node_flasher
node_cli -->|"flashes card skin"| node_flasher
node_gui -->|"creates and flashes 3D assets"| node_cash_studio
node_cash_studio -->|"uses cache invalidation"| node_flasher
node_cash_studio -->|"opens lockdown"| node_device
node_cash_studio -->|"uses transparent PNG"| node_image
node_flasher -->|"opens lockdown"| node_device
node_flasher -->|"syncs assets"| node_airtraffic
node_flasher -->|"uses transparent PNG"| node_image
node_flasher -->|"uses asset lists"| node_config
node_airtraffic -->|"finds DLL directory"| node_config
node_device -->|"connects over USB"| node_iphone
node_flasher -->|"writes card files"| node_iphone
node_airtraffic -->|"syncs assets"| node_iphone
node_airtraffic -->|"calls native bridge"| node_apple_dlls
node_cash_studio -->|"downloads official logos"| node_factory_assets
node_user -->|"selects card in Wallet"| node_iphone
node_gui -.->|"applies holographic effects"| node_image
node_gui -.->|"restores factory artwork"| node_flasher

click node_gui "https://github.com/alrrstd/aircard-windows/blob/main/app.py"
click node_cli "https://github.com/alrrstd/aircard-windows/blob/main/aircard/cli.py"
click node_cli_entry "https://github.com/alrrstd/aircard-windows/blob/main/main.py"
click node_scanner "https://github.com/alrrstd/aircard-windows/blob/main/aircard/scanner.py"
click node_catalog "https://github.com/alrrstd/aircard-windows/blob/main/aircard/scanner.py"
click node_config "https://github.com/alrrstd/aircard-windows/blob/main/aircard/config.py"
click node_image "https://github.com/alrrstd/aircard-windows/blob/main/aircard/image_util.py"
click node_cash_studio "https://github.com/alrrstd/aircard-windows/blob/main/aircard/apple_cash.py"
click node_device "https://github.com/alrrstd/aircard-windows/blob/main/aircard/device.py"
click node_flasher "https://github.com/alrrstd/aircard-windows/blob/main/aircard/core_flasher.py"
click node_airtraffic "https://github.com/alrrstd/aircard-windows/blob/main/aircard/airtraffic.py"

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_gui,node_cli,node_cli_entry,node_user toneBlue
class node_scanner,node_catalog,node_config toneAmber
class node_image,node_cash_studio toneMint
class node_device,node_flasher,node_airtraffic toneRose
class node_iphone,node_apple_dlls,node_apple_wallet,node_factory_assets toneIndigo
```

## Components

### User interfaces

- [Desktop studio](https://github.com/alrrstd/aircard-windows/blob/main/app.py): `app.py`
- [Interactive CLI](https://github.com/alrrstd/aircard-windows/blob/main/aircard/cli.py): `aircard/cli.py`
- [CLI launcher](https://github.com/alrrstd/aircard-windows/blob/main/main.py): `main.py`

### Card discovery

- [Live card scanner](https://github.com/alrrstd/aircard-windows/blob/main/aircard/scanner.py): `aircard/scanner.py`
- [Saved card catalog](https://github.com/alrrstd/aircard-windows/blob/main/aircard/scanner.py): `aircard/scanner.py`
- [Card and asset config](https://github.com/alrrstd/aircard-windows/blob/main/aircard/config.py): `aircard/config.py`

### Artwork studio

- [Skin image processing](https://github.com/alrrstd/aircard-windows/blob/main/aircard/image_util.py): `aircard/image_util.py`
- [Apple Cash 3D assets](https://github.com/alrrstd/aircard-windows/blob/main/aircard/apple_cash.py): `aircard/apple_cash.py`

### Device and flashing

- [Device and lockdown](https://github.com/alrrstd/aircard-windows/blob/main/aircard/device.py): `aircard/device.py`
- [Card asset flasher](https://github.com/alrrstd/aircard-windows/blob/main/aircard/core_flasher.py): `aircard/core_flasher.py`
- [AirTraffic sync bridge](https://github.com/alrrstd/aircard-windows/blob/main/aircard/airtraffic.py): `aircard/airtraffic.py`

### Other components

- **User**
- **Connected iPhone**
- **Apple device DLLs**
- **Apple Wallet**
- **Apple factory assets**

## Connections

- User → Desktop studio: uses (evidence: `README.md`)
- User → CLI launcher: launches (evidence: `README.md`)
- CLI launcher → Interactive CLI: calls (evidence: `main.py`)
- Desktop studio → Live card scanner: scans cards (evidence: `app.py`)
- Desktop studio → Saved card catalog: manages cards (evidence: `app.py`)
- Interactive CLI → Live card scanner: scans cards (evidence: `aircard/cli.py`)
- Interactive CLI → Saved card catalog: reads and saves (evidence: `aircard/cli.py`)
- Live card scanner → Saved card catalog: persists metadata (evidence: `aircard/scanner.py`)
- Live card scanner → Card and asset config: uses paths and patterns (evidence: `aircard/scanner.py`)
- Live card scanner → Device and lockdown: opens lockdown (evidence: `aircard/scanner.py`)
- Desktop studio → Skin image processing: prepares artwork (evidence: `app.py`)
- Interactive CLI → Skin image processing: prepares artwork (evidence: `aircard/cli.py`)
- Desktop studio → Card asset flasher: flashes card skin (evidence: `app.py`)
- Interactive CLI → Card asset flasher: flashes card skin (evidence: `aircard/cli.py`)
- Desktop studio → Apple Cash 3D assets: creates and flashes 3D assets (evidence: `app.py`)
- Apple Cash 3D assets → Card asset flasher: uses cache invalidation (evidence: `aircard/apple_cash.py`)
- Apple Cash 3D assets → Device and lockdown: opens lockdown (evidence: `aircard/apple_cash.py`)
- Apple Cash 3D assets → Skin image processing: uses transparent PNG (evidence: `aircard/apple_cash.py`)
- Card asset flasher → Device and lockdown: opens lockdown (evidence: `aircard/core_flasher.py`)
- Card asset flasher → AirTraffic sync bridge: syncs assets (evidence: `aircard/core_flasher.py`)
- Card asset flasher → Skin image processing: uses transparent PNG (evidence: `aircard/core_flasher.py`)
- Card asset flasher → Card and asset config: uses asset lists (evidence: `aircard/core_flasher.py`)
- AirTraffic sync bridge → Card and asset config: finds DLL directory (evidence: `aircard/airtraffic.py`)
- Device and lockdown → Connected iPhone: connects over USB (evidence: `aircard/device.py`)
- Card asset flasher → Connected iPhone: writes card files (evidence: `aircard/core_flasher.py`)
- AirTraffic sync bridge → Connected iPhone: syncs assets (evidence: `README.md`)
- AirTraffic sync bridge → Apple device DLLs: calls native bridge (evidence: `aircard/airtraffic.py`)
- Apple Cash 3D assets → Apple factory assets: downloads official logos (evidence: `aircard/apple_cash.py`)
- User → Connected iPhone: selects card in Wallet (evidence: `README.md`)
- Desktop studio → Skin image processing: applies holographic effects (evidence: `app.py`)
- Desktop studio → Card asset flasher: restores factory artwork (evidence: `README.md`)
