# ryt0n18/keybio architecture

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

- Interactive diagram: https://gitdiagram.com/ryt0n18/keybio
- Repository: https://github.com/ryt0n18/keybio

## Overview

KeyBio is a local keystroke-biometrics desktop application. Its main workflow captures typing samples, extracts text-independent features, compares them with enrolled profiles, and presents an identity or verification result; users can also enroll profiles, review activity, and configure access checks. The graph preserves documented reporting, adaptation, liveness, evaluation, localization, and update capabilities. Some page implementations were not excerpted, so their internal calls are omitted where the index does not establish them.

Main entry points: [`ksb/service.py`](https://github.com/ryt0n18/keybio/blob/main/ksb/service.py) (Biometric service), [`ksb/gui/pages/identify.py`](https://github.com/ryt0n18/keybio/blob/main/ksb/gui/pages/identify.py) (Identify and verify), [`ksb/gui/pages/settings.py`](https://github.com/ryt0n18/keybio/blob/main/ksb/gui/pages/settings.py) (Settings view), [`ksb/gui/pages/users.py`](https://github.com/ryt0n18/keybio/blob/main/ksb/gui/pages/users.py) (User profiles view)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Desktop interaction"]
  node_app["App shell<br/>[app.py]"]
  node_typing["Typing capture UI<br/>[typing_widget.py]"]
  node_enroll["Enrollment<br/>[enroll.py]"]
  node_identify["Identify and verify<br/>[identify.py]"]
  node_access["Access checks<br/>[access.py]"]
end

subgraph group_biometrics["Biometric pipeline"]
  node_capture["Keystroke recorder<br/>[capture.py]"]
  node_features["Feature extraction<br/>[features.py]"]
  node_liveness["Liveness checks<br/>[liveness.py]"]
  node_matcher["Profile matcher<br/>[matcher.py]"]
end

subgraph group_profiles["Profiles and records"]
  node_service["Biometric service<br/>[service.py]"]
  node_storage[("Local profile store<br/>[storage.py]")]
  node_crypto["Data encryption<br/>[crypto.py]"]
end

subgraph group_insights["Review and insights"]
  node_history["History view<br/>[history.py]"]
  node_users["User profiles view<br/>[users.py]"]
  node_dashboard["Dashboard<br/>[dashboard.py]"]
  node_evaluation["System evaluation<br/>[evaluation.py]"]
  node_report["PDF reports<br/>[report.py]"]
end

subgraph group_platform["Settings and platform"]
  node_settings["Settings view<br/>[settings.py]"]
  node_i18n["Localization<br/>[i18n.py]"]
  node_texts["Typing texts<br/>[texts.py]"]
  node_keyboard["On-screen keyboard<br/>[keyboard.py]"]
  node_updater["Update client<br/>[updater.py]"]
  node_update_service["Update service<br/>[updates.py]"]
end

node_person(("User"))
node_internet(("Update servers"))

node_person -->|"types sample"| node_typing
node_app -->|"routes access"| node_access
node_app -->|"creates service"| node_service
node_typing -->|"records keys"| node_capture
node_enroll -->|"enrolls samples"| node_service
node_identify -->|"captures sample"| node_capture
node_identify -->|"extracts features"| node_features
node_identify -->|"checks spoofing"| node_liveness
node_identify -->|"compares profiles"| node_matcher
node_identify -->|"requests operations"| node_service
node_access -->|"verifies identity"| node_service
node_capture -->|"provides sample"| node_features
node_service -->|"validates samples"| node_capture
node_service -->|"extracts features"| node_features
node_service -->|"identifies users"| node_matcher
node_service -->|"checks samples"| node_liveness
node_service -->|"reads and writes"| node_storage
node_storage -->|"encrypts data"| node_crypto
node_person -->|"registers profile"| node_enroll
node_person -->|"requests recognition"| node_identify
node_person -->|"reviews checks"| node_history
node_person -->|"manages profiles"| node_users
node_users -->|"loads profile data"| node_service
node_users -->|"imports and exports"| node_storage
node_users -->|"requests report"| node_report
node_dashboard -->|"loads activity"| node_service
node_dashboard -->|"evaluates system"| node_evaluation
node_identify -->|"generates report"| node_report
node_person -->|"configures app"| node_settings
node_settings -->|"updates preferences"| node_service
node_settings -->|"protects data"| node_crypto
node_settings -->|"checks updates"| node_updater
node_updater -->|"requests update"| node_update_service
node_update_service -.->|"fetches release"| node_internet
node_app -->|"sets language"| node_i18n
node_settings -->|"selects layout"| node_keyboard
node_typing -->|"shows key guide"| node_keyboard
node_enroll -.->|"chooses prompts"| node_texts

click node_app "https://github.com/ryt0n18/keybio/blob/main/ksb/gui/app.py"
click node_typing "https://github.com/ryt0n18/keybio/blob/main/ksb/gui/typing_widget.py"
click node_enroll "https://github.com/ryt0n18/keybio/blob/main/ksb/gui/pages/enroll.py"
click node_identify "https://github.com/ryt0n18/keybio/blob/main/ksb/gui/pages/identify.py"
click node_access "https://github.com/ryt0n18/keybio/blob/main/ksb/gui/access.py"
click node_capture "https://github.com/ryt0n18/keybio/blob/main/ksb/capture.py"
click node_features "https://github.com/ryt0n18/keybio/blob/main/ksb/features.py"
click node_liveness "https://github.com/ryt0n18/keybio/blob/main/ksb/liveness.py"
click node_matcher "https://github.com/ryt0n18/keybio/blob/main/ksb/matcher.py"
click node_service "https://github.com/ryt0n18/keybio/blob/main/ksb/service.py"
click node_storage "https://github.com/ryt0n18/keybio/blob/main/ksb/storage.py"
click node_crypto "https://github.com/ryt0n18/keybio/blob/main/ksb/crypto.py"
click node_history "https://github.com/ryt0n18/keybio/blob/main/ksb/gui/pages/history.py"
click node_users "https://github.com/ryt0n18/keybio/blob/main/ksb/gui/pages/users.py"
click node_dashboard "https://github.com/ryt0n18/keybio/blob/main/ksb/gui/pages/dashboard.py"
click node_evaluation "https://github.com/ryt0n18/keybio/blob/main/ksb/evaluation.py"
click node_report "https://github.com/ryt0n18/keybio/blob/main/ksb/gui/report.py"
click node_settings "https://github.com/ryt0n18/keybio/blob/main/ksb/gui/pages/settings.py"
click node_i18n "https://github.com/ryt0n18/keybio/blob/main/ksb/i18n.py"
click node_texts "https://github.com/ryt0n18/keybio/blob/main/ksb/texts.py"
click node_keyboard "https://github.com/ryt0n18/keybio/blob/main/ksb/gui/keyboard.py"
click node_updater "https://github.com/ryt0n18/keybio/blob/main/ksb/gui/updater.py"
click node_update_service "https://github.com/ryt0n18/keybio/blob/main/ksb/updates.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_app,node_typing,node_enroll,node_identify,node_access,node_person toneBlue
class node_capture,node_features,node_liveness,node_matcher toneAmber
class node_service,node_storage,node_crypto,node_internet toneMint
class node_history,node_users,node_dashboard,node_evaluation,node_report toneRose
class node_settings,node_i18n,node_texts,node_keyboard,node_updater,node_update_service toneIndigo
```

## Components

### Desktop interaction

- [App shell](https://github.com/ryt0n18/keybio/blob/main/ksb/gui/app.py): `ksb/gui/app.py`
- [Typing capture UI](https://github.com/ryt0n18/keybio/blob/main/ksb/gui/typing_widget.py): `ksb/gui/typing_widget.py`
- [Enrollment](https://github.com/ryt0n18/keybio/blob/main/ksb/gui/pages/enroll.py): `ksb/gui/pages/enroll.py`
- [Identify and verify](https://github.com/ryt0n18/keybio/blob/main/ksb/gui/pages/identify.py): `ksb/gui/pages/identify.py`
- [Access checks](https://github.com/ryt0n18/keybio/blob/main/ksb/gui/access.py): `ksb/gui/access.py`

### Biometric pipeline

- [Keystroke recorder](https://github.com/ryt0n18/keybio/blob/main/ksb/capture.py): `ksb/capture.py`
- [Feature extraction](https://github.com/ryt0n18/keybio/blob/main/ksb/features.py): `ksb/features.py`
- [Liveness checks](https://github.com/ryt0n18/keybio/blob/main/ksb/liveness.py): `ksb/liveness.py`
- [Profile matcher](https://github.com/ryt0n18/keybio/blob/main/ksb/matcher.py): `ksb/matcher.py`

### Profiles and records

- [Biometric service](https://github.com/ryt0n18/keybio/blob/main/ksb/service.py): `ksb/service.py`
- [Local profile store](https://github.com/ryt0n18/keybio/blob/main/ksb/storage.py): `ksb/storage.py`
- [Data encryption](https://github.com/ryt0n18/keybio/blob/main/ksb/crypto.py): `ksb/crypto.py`

### Review and insights

- [History view](https://github.com/ryt0n18/keybio/blob/main/ksb/gui/pages/history.py): `ksb/gui/pages/history.py`
- [User profiles view](https://github.com/ryt0n18/keybio/blob/main/ksb/gui/pages/users.py): `ksb/gui/pages/users.py`
- [Dashboard](https://github.com/ryt0n18/keybio/blob/main/ksb/gui/pages/dashboard.py): `ksb/gui/pages/dashboard.py`
- [System evaluation](https://github.com/ryt0n18/keybio/blob/main/ksb/evaluation.py): `ksb/evaluation.py`
- [PDF reports](https://github.com/ryt0n18/keybio/blob/main/ksb/gui/report.py): `ksb/gui/report.py`

### Settings and platform

- [Settings view](https://github.com/ryt0n18/keybio/blob/main/ksb/gui/pages/settings.py): `ksb/gui/pages/settings.py`
- [Localization](https://github.com/ryt0n18/keybio/blob/main/ksb/i18n.py): `ksb/i18n.py`
- [Typing texts](https://github.com/ryt0n18/keybio/blob/main/ksb/texts.py): `ksb/texts.py`
- [On-screen keyboard](https://github.com/ryt0n18/keybio/blob/main/ksb/gui/keyboard.py): `ksb/gui/keyboard.py`
- [Update client](https://github.com/ryt0n18/keybio/blob/main/ksb/gui/updater.py): `ksb/gui/updater.py`
- [Update service](https://github.com/ryt0n18/keybio/blob/main/ksb/updates.py): `ksb/updates.py`

### Other components

- **User**
- **Update servers**

## Connections

- User → Typing capture UI: types sample
- App shell → Access checks: routes access (evidence: `ksb/gui/app.py`)
- App shell → Biometric service: creates service (evidence: `ksb/gui/app.py`)
- Typing capture UI → Keystroke recorder: records keys (evidence: `ksb/gui/typing_widget.py`)
- Enrollment → Biometric service: enrolls samples
- Identify and verify → Keystroke recorder: captures sample (evidence: `ksb/gui/pages/identify.py`)
- Identify and verify → Feature extraction: extracts features (evidence: `ksb/gui/pages/identify.py`)
- Identify and verify → Liveness checks: checks spoofing (evidence: `ksb/gui/pages/identify.py`)
- Identify and verify → Profile matcher: compares profiles (evidence: `ksb/gui/pages/identify.py`)
- Identify and verify → Biometric service: requests operations (evidence: `ksb/gui/pages/identify.py`)
- Access checks → Biometric service: verifies identity (evidence: `ksb/gui/access.py`)
- Keystroke recorder → Feature extraction: provides sample (evidence: `ksb/features.py`)
- Biometric service → Keystroke recorder: validates samples (evidence: `ksb/service.py`)
- Biometric service → Feature extraction: extracts features (evidence: `ksb/service.py`)
- Biometric service → Profile matcher: identifies users (evidence: `ksb/service.py`)
- Biometric service → Liveness checks: checks samples (evidence: `ksb/service.py`)
- Biometric service → Local profile store: reads and writes (evidence: `ksb/service.py`)
- Local profile store → Data encryption: encrypts data (evidence: `ksb/storage.py`)
- User → Enrollment: registers profile
- User → Identify and verify: requests recognition
- User → History view: reviews checks
- User → User profiles view: manages profiles
- User profiles view → Biometric service: loads profile data (evidence: `ksb/gui/pages/users.py`)
- User profiles view → Local profile store: imports and exports (evidence: `ksb/gui/pages/users.py`)
- User profiles view → PDF reports: requests report (evidence: `ksb/gui/pages/users.py`)
- Dashboard → Biometric service: loads activity (evidence: `ksb/gui/pages/dashboard.py`)
- Dashboard → System evaluation: evaluates system (evidence: `ksb/gui/pages/dashboard.py`)
- Identify and verify → PDF reports: generates report (evidence: `ksb/gui/pages/identify.py`)
- User → Settings view: configures app
- Settings view → Biometric service: updates preferences (evidence: `ksb/gui/pages/settings.py`)
- Settings view → Data encryption: protects data (evidence: `ksb/gui/pages/settings.py`)
- Settings view → Update client: checks updates (evidence: `ksb/gui/pages/settings.py`)
- Update client → Update service: requests update (evidence: `ksb/gui/updater.py`)
- Update service → Update servers: fetches release
- App shell → Localization: sets language (evidence: `ksb/gui/app.py`)
- Settings view → On-screen keyboard: selects layout (evidence: `ksb/gui/pages/settings.py`)
- Typing capture UI → On-screen keyboard: shows key guide (evidence: `ksb/gui/typing_widget.py`)
- Enrollment → Typing texts: chooses prompts
