# user-wurun/useryanzheng architecture

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

- Interactive diagram: https://gitdiagram.com/user-wurun/useryanzheng
- Repository: https://github.com/user-wurun/useryanzheng

## Overview

This is a small desktop identity-verification app: users can scan a displayed QR code, enter a TOTP code, use a USB key, or verify through a local Flask page; successful checks launch Edge and exit the app. The runtime is concentrated in client.py. The README describes these capabilities, but the source has a wiring issue: the TOTP callback references config although it is local to QR generation. The config contents were not provided, so its configured values are unknown.

Main entry points: [`client.py`](https://github.com/user-wurun/useryanzheng/blob/main/client.py) (Tkinter window), [`config.ini`](https://github.com/user-wurun/useryanzheng/blob/main/config.ini) (Settings file)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop interface"]
  node_gui["Tkinter window<br/>[client.py]"]
  node_qr["QR generation<br/>[client.py]"]
  node_config["Settings file<br/>[config.ini]"]
end

subgraph group_verification["Verification paths"]
  node_totp["TOTP check<br/>[client.py]"]
  node_usb["USB key check<br/>[client.py]"]
  node_success["Success handler<br/>[client.py]"]
end

subgraph group_web["Web flow"]
  node_flask["Flask server<br/>[client.py]"]
  node_landing["Verification page<br/>[client.py]"]
end

node_user(("User"))
node_scanner(("QR scanner"))
node_browser(("Web browser"))
node_edge["Microsoft Edge"]

node_user -->|"uses"| node_gui
node_gui -->|"generates"| node_qr
node_qr -->|"reads URL"| node_config
node_qr -->|"displays QR"| node_gui
node_scanner -->|"scans"| node_qr
node_user -->|"enters code"| node_totp
node_gui -->|"checks code"| node_totp
node_user -->|"inserts key"| node_usb
node_gui -->|"checks key"| node_usb
node_gui -->|"starts server"| node_flask
node_browser -->|"requests page"| node_flask
node_flask -->|"serves"| node_landing
node_landing -->|"returns page"| node_browser
node_browser -->|"requests verification"| node_flask
node_flask -->|"dispatches"| node_success
node_totp -->|"on valid code"| node_success
node_usb -->|"on key found"| node_success
node_success -->|"launches"| node_edge

click node_gui "https://github.com/user-wurun/useryanzheng/blob/main/client.py"
click node_qr "https://github.com/user-wurun/useryanzheng/blob/main/client.py"
click node_config "https://github.com/user-wurun/useryanzheng/blob/main/config.ini"
click node_totp "https://github.com/user-wurun/useryanzheng/blob/main/client.py"
click node_usb "https://github.com/user-wurun/useryanzheng/blob/main/client.py"
click node_flask "https://github.com/user-wurun/useryanzheng/blob/main/client.py"
click node_landing "https://github.com/user-wurun/useryanzheng/blob/main/client.py"
click node_success "https://github.com/user-wurun/useryanzheng/blob/main/client.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_qr,node_config,node_user,node_browser toneBlue
class node_totp,node_usb,node_success toneAmber
class node_flask,node_landing toneMint
class node_scanner,node_edge toneIndigo
```

## Components

### Desktop interface

- [Tkinter window](https://github.com/user-wurun/useryanzheng/blob/main/client.py): `client.py`
- [QR generation](https://github.com/user-wurun/useryanzheng/blob/main/client.py): `client.py`
- [Settings file](https://github.com/user-wurun/useryanzheng/blob/main/config.ini): `config.ini`

### Verification paths

- [TOTP check](https://github.com/user-wurun/useryanzheng/blob/main/client.py): `client.py`
- [USB key check](https://github.com/user-wurun/useryanzheng/blob/main/client.py): `client.py`
- [Success handler](https://github.com/user-wurun/useryanzheng/blob/main/client.py): `client.py`

### Web flow

- [Flask server](https://github.com/user-wurun/useryanzheng/blob/main/client.py): `client.py`
- [Verification page](https://github.com/user-wurun/useryanzheng/blob/main/client.py): `client.py`

### Other components

- **User**
- **QR scanner**
- **Web browser**
- **Microsoft Edge**

## Connections

- User → Tkinter window: uses
- Tkinter window → QR generation: generates
- QR generation → Settings file: reads URL
- QR generation → Tkinter window: displays QR
- QR scanner → QR generation: scans
- User → TOTP check: enters code
- Tkinter window → TOTP check: checks code
- User → USB key check: inserts key
- Tkinter window → USB key check: checks key
- Tkinter window → Flask server: starts server
- Web browser → Flask server: requests page
- Flask server → Verification page: serves
- Verification page → Web browser: returns page
- Web browser → Flask server: requests verification
- Flask server → Success handler: dispatches
- TOTP check → Success handler: on valid code
- USB key check → Success handler: on key found
- Success handler → Microsoft Edge: launches
