# rn-ops/crypty architecture

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

- Interactive diagram: https://gitdiagram.com/rn-ops/crypty
- Repository: https://github.com/rn-ops/crypty

## Overview

Crypty is a desktop digital-forensics and sanitization prototype: an operator signs in, enters a workspace, selects media, and uses recovery, sanitization, and reporting views. The documented recovery path runs from the UI through a Python/native boundary into filesystem detectors; README describes NTFS reconstruction as planned/incomplete, so this graph does not imply complete recovery. The Flask service separately provides credential/face authentication, role checks, and audit logging. Several UI and native relationships are based on README or SOURCE INDEX references; unsampled details are not inferred.

Main entry points: [`ui/dashboard/main_window.py`](https://github.com/rn-ops/crypty/blob/main/ui/dashboard/main_window.py) (Workspace router), [`core/src/native_bridge.cpp`](https://github.com/rn-ops/crypty/blob/main/core/src/native_bridge.cpp) (Native bridge), [`auth/api/app.py`](https://github.com/rn-ops/crypty/blob/main/auth/api/app.py) (Auth API), [`core/native_backend.py`](https://github.com/rn-ops/crypty/blob/main/core/native_backend.py) (Python native adapter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop workspace"]
  node_desktop_app["Desktop entry<br/>[main.py]"]
  node_login_ui["Sign-in UI<br/>[auth_window.py]"]
  node_auth_client["Auth client<br/>[auth_client.py]"]
  node_workspace["Workspace router<br/>[main_window.py]"]
  node_device_view["Device view<br/>[devices.py]"]
  node_device_manager["Device selection<br/>[device_manager.py]"]
  node_recovery_view["Recovery view<br/>[recovery.py]"]
  node_sanitize_view["Sanitization view<br/>[sanitization.py]"]
  node_reports_view["Reports view<br/>[reports.py]"]
end

subgraph group_engine["Forensics engine"]
  node_native_backend["Python native adapter<br/>[native_backend.py]"]
  node_workflow["Workflow state<br/>[workflow.cpp]"]
  node_native_bridge["Native bridge<br/>[native_bridge.cpp]"]
  node_ntfs["NTFS scan/recovery<br/>[ntfs_detector.cpp]"]
  node_fat32["FAT32 scan/recovery<br/>[fat32_detector.cpp]"]
  node_exfat["exFAT detection<br/>[exfat_detector.cpp]"]
end

subgraph group_identity["Identity and audit"]
  node_auth_service["Auth API<br/>[app.py]"]
  node_face_auth["Face authentication<br/>[face_auth.py]"]
  node_auth_utils["Password and tokens<br/>[auth_utils.py]"]
  node_rbac["Role access control<br/>[rbac.py]"]
  node_audit["Audit chain<br/>[audit.py]"]
  node_auth_db[("Identity database<br/>[db.py]")]
end

subgraph group_evidence["Reports and demo"]
  node_reporting["Native report serialization<br/>[report.cpp]"]
  node_demo_data["Demo evidence data<br/>[demo_data.py]"]
end

node_operator(("Investigator"))
node_media(("Selected media"))
node_auth_service_actor(("Auth service host"))

node_operator -->|"launches"| node_desktop_app
node_desktop_app -->|"opens"| node_login_ui
node_desktop_app -->|"creates"| node_auth_client
node_login_ui -->|"authenticates"| node_auth_client
node_auth_client -->|"HTTP login"| node_auth_service_actor
node_auth_service_actor -->|"routes request"| node_auth_service
node_auth_service -->|"checks credentials"| node_auth_utils
node_auth_service -->|"checks face"| node_face_auth
node_auth_service -->|"guards routes"| node_rbac
node_auth_service -->|"records actions"| node_audit
node_auth_service -->|"reads and writes"| node_auth_db
node_audit -->|"stores log chain"| node_auth_db
node_login_ui -->|"emits session"| node_workspace
node_workspace -->|"routes view"| node_device_view
node_workspace -->|"selects devices"| node_device_manager
node_device_manager -.->|"lists media"| node_media
node_workspace -->|"routes view"| node_recovery_view
node_workspace -->|"routes view"| node_sanitize_view
node_workspace -->|"routes view"| node_reports_view
node_recovery_view -.->|"requests recovery"| node_native_backend
node_sanitize_view -.->|"requests sanitization"| node_native_backend
node_workspace -->|"configures backend"| node_native_backend
node_native_backend -.->|"calls native API"| node_native_bridge
node_native_bridge -->|"uses workflow"| node_workflow
node_native_bridge -->|"dispatches scan"| node_ntfs
node_native_bridge -->|"dispatches scan"| node_fat32
node_native_bridge -->|"dispatches scan"| node_exfat
node_native_bridge -->|"serializes report"| node_reporting
node_reports_view -->|"reads summaries"| node_demo_data
node_workspace -->|"loads dashboard data"| node_demo_data

click node_desktop_app "https://github.com/rn-ops/crypty/blob/main/app/main.py"
click node_login_ui "https://github.com/rn-ops/crypty/blob/main/ui/auth/auth_window.py"
click node_auth_client "https://github.com/rn-ops/crypty/blob/main/auth_client.py"
click node_workspace "https://github.com/rn-ops/crypty/blob/main/ui/dashboard/main_window.py"
click node_device_view "https://github.com/rn-ops/crypty/blob/main/ui/dashboard/devices.py"
click node_device_manager "https://github.com/rn-ops/crypty/blob/main/core/device_manager.py"
click node_recovery_view "https://github.com/rn-ops/crypty/blob/main/ui/dashboard/recovery.py"
click node_sanitize_view "https://github.com/rn-ops/crypty/blob/main/ui/dashboard/sanitization.py"
click node_reports_view "https://github.com/rn-ops/crypty/blob/main/ui/dashboard/reports.py"
click node_native_backend "https://github.com/rn-ops/crypty/blob/main/core/native_backend.py"
click node_workflow "https://github.com/rn-ops/crypty/blob/main/core/src/workflow.cpp"
click node_native_bridge "https://github.com/rn-ops/crypty/blob/main/core/src/native_bridge.cpp"
click node_ntfs "https://github.com/rn-ops/crypty/blob/main/core/recovery/ntfs_detector.cpp"
click node_fat32 "https://github.com/rn-ops/crypty/blob/main/core/recovery/fat32_detector.cpp"
click node_exfat "https://github.com/rn-ops/crypty/blob/main/core/recovery/exfat_detector.cpp"
click node_auth_service "https://github.com/rn-ops/crypty/blob/main/auth/api/app.py"
click node_face_auth "https://github.com/rn-ops/crypty/blob/main/auth/api/face_auth.py"
click node_auth_utils "https://github.com/rn-ops/crypty/blob/main/auth/api/auth_utils.py"
click node_rbac "https://github.com/rn-ops/crypty/blob/main/auth/api/rbac.py"
click node_audit "https://github.com/rn-ops/crypty/blob/main/auth/api/audit.py"
click node_auth_db "https://github.com/rn-ops/crypty/blob/main/auth/api/database/db.py"
click node_reporting "https://github.com/rn-ops/crypty/blob/main/reporting/report.cpp"
click node_demo_data "https://github.com/rn-ops/crypty/blob/main/data/demo_data.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_desktop_app,node_login_ui,node_auth_client,node_workspace,node_device_view,node_device_manager,node_recovery_view,node_sanitize_view,node_reports_view toneBlue
class node_native_backend,node_workflow,node_native_bridge,node_ntfs,node_fat32,node_exfat toneAmber
class node_auth_service,node_face_auth,node_auth_utils,node_rbac,node_audit,node_auth_db toneMint
class node_reporting,node_demo_data toneRose
class node_operator,node_media,node_auth_service_actor toneIndigo
```

## Components

### Desktop workspace

- [Desktop entry](https://github.com/rn-ops/crypty/blob/main/app/main.py): `app/main.py`
- [Sign-in UI](https://github.com/rn-ops/crypty/blob/main/ui/auth/auth_window.py): `ui/auth/auth_window.py`
- [Auth client](https://github.com/rn-ops/crypty/blob/main/auth_client.py): `auth_client.py`
- [Workspace router](https://github.com/rn-ops/crypty/blob/main/ui/dashboard/main_window.py): `ui/dashboard/main_window.py`
- [Device view](https://github.com/rn-ops/crypty/blob/main/ui/dashboard/devices.py): `ui/dashboard/devices.py`
- [Device selection](https://github.com/rn-ops/crypty/blob/main/core/device_manager.py): `core/device_manager.py`
- [Recovery view](https://github.com/rn-ops/crypty/blob/main/ui/dashboard/recovery.py): `ui/dashboard/recovery.py`
- [Sanitization view](https://github.com/rn-ops/crypty/blob/main/ui/dashboard/sanitization.py): `ui/dashboard/sanitization.py`
- [Reports view](https://github.com/rn-ops/crypty/blob/main/ui/dashboard/reports.py): `ui/dashboard/reports.py`

### Forensics engine

- [Python native adapter](https://github.com/rn-ops/crypty/blob/main/core/native_backend.py): `core/native_backend.py`
- [Workflow state](https://github.com/rn-ops/crypty/blob/main/core/src/workflow.cpp): `core/src/workflow.cpp`
- [Native bridge](https://github.com/rn-ops/crypty/blob/main/core/src/native_bridge.cpp): `core/src/native_bridge.cpp`
- [NTFS scan/recovery](https://github.com/rn-ops/crypty/blob/main/core/recovery/ntfs_detector.cpp): `core/recovery/ntfs_detector.cpp`
- [FAT32 scan/recovery](https://github.com/rn-ops/crypty/blob/main/core/recovery/fat32_detector.cpp): `core/recovery/fat32_detector.cpp`
- [exFAT detection](https://github.com/rn-ops/crypty/blob/main/core/recovery/exfat_detector.cpp): `core/recovery/exfat_detector.cpp`

### Identity and audit

- [Auth API](https://github.com/rn-ops/crypty/blob/main/auth/api/app.py): `auth/api/app.py`
- [Face authentication](https://github.com/rn-ops/crypty/blob/main/auth/api/face_auth.py): `auth/api/face_auth.py`
- [Password and tokens](https://github.com/rn-ops/crypty/blob/main/auth/api/auth_utils.py): `auth/api/auth_utils.py`
- [Role access control](https://github.com/rn-ops/crypty/blob/main/auth/api/rbac.py): `auth/api/rbac.py`
- [Audit chain](https://github.com/rn-ops/crypty/blob/main/auth/api/audit.py): `auth/api/audit.py`
- [Identity database](https://github.com/rn-ops/crypty/blob/main/auth/api/database/db.py): `auth/api/database/db.py`

### Reports and demo

- [Native report serialization](https://github.com/rn-ops/crypty/blob/main/reporting/report.cpp): `reporting/report.cpp`
- [Demo evidence data](https://github.com/rn-ops/crypty/blob/main/data/demo_data.py): `data/demo_data.py`

### Other components

- **Investigator**
- **Selected media**
- **Auth service host**

## Connections

- Investigator → Desktop entry: launches (evidence: `app/main.py`)
- Desktop entry → Sign-in UI: opens (evidence: `app/main.py`)
- Desktop entry → Auth client: creates (evidence: `app/main.py`)
- Sign-in UI → Auth client: authenticates (evidence: `ui/auth/auth_window.py`)
- Auth client → Auth service host: HTTP login (evidence: `auth_client.py`)
- Auth service host → Auth API: routes request (evidence: `auth/api/app.py`)
- Auth API → Password and tokens: checks credentials (evidence: `auth/api/app.py`)
- Auth API → Face authentication: checks face (evidence: `auth/api/app.py`)
- Auth API → Role access control: guards routes (evidence: `auth/api/app.py`)
- Auth API → Audit chain: records actions (evidence: `auth/api/app.py`)
- Auth API → Identity database: reads and writes (evidence: `auth/api/app.py`)
- Audit chain → Identity database: stores log chain (evidence: `auth/api/audit.py`)
- Sign-in UI → Workspace router: emits session (evidence: `app/main.py`)
- Workspace router → Device view: routes view (evidence: `ui/dashboard/main_window.py`)
- Workspace router → Device selection: selects devices (evidence: `ui/dashboard/main_window.py`)
- Device selection → Selected media: lists media
- Workspace router → Recovery view: routes view (evidence: `ui/dashboard/main_window.py`)
- Workspace router → Sanitization view: routes view (evidence: `ui/dashboard/main_window.py`)
- Workspace router → Reports view: routes view (evidence: `ui/dashboard/main_window.py`)
- Recovery view → Python native adapter: requests recovery
- Sanitization view → Python native adapter: requests sanitization
- Workspace router → Python native adapter: configures backend (evidence: `ui/dashboard/main_window.py`)
- Python native adapter → Native bridge: calls native API (evidence: `README.md`)
- Native bridge → Workflow state: uses workflow (evidence: `core/src/native_bridge.cpp`)
- Native bridge → NTFS scan/recovery: dispatches scan (evidence: `core/src/native_bridge.cpp`)
- Native bridge → FAT32 scan/recovery: dispatches scan (evidence: `core/src/native_bridge.cpp`)
- Native bridge → exFAT detection: dispatches scan (evidence: `core/src/native_bridge.cpp`)
- Native bridge → Native report serialization: serializes report (evidence: `core/src/native_bridge.cpp`)
- Reports view → Demo evidence data: reads summaries (evidence: `ui/dashboard/reports.py`)
- Workspace router → Demo evidence data: loads dashboard data (evidence: `ui/dashboard/main_window.py`)
