# restufrmnsyh/saferelief architecture

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

- Interactive diagram: https://gitdiagram.com/restufrmnsyh/saferelief
- Repository: https://github.com/restufrmnsyh/saferelief

## Overview

SafeRelief is a desktop disaster-relief coordination app for admins and volunteers. Its main workflow is dongle, password and face authentication, followed by a role-specific workspace for victim records, encrypted chat, photo documentation, reports and aid-distribution tracking. The UI pages invoke authentication, storage and cryptographic services; SQLite access is centralized in the database layer. The README documents the major capabilities, while some feature-page implementations were not sampled, so their specific internal call paths are not asserted.

Main entry points: [`ui/main_window.py`](https://github.com/restufrmnsyh/saferelief/blob/main/ui/main_window.py) (Main window), [`database/secure_store.py`](https://github.com/restufrmnsyh/saferelief/blob/main/database/secure_store.py) (Secure data access), [`ui/login_page.py`](https://github.com/restufrmnsyh/saferelief/blob/main/ui/login_page.py) (Login screen), [`auth/volunteers.py`](https://github.com/restufrmnsyh/saferelief/blob/main/auth/volunteers.py) (Volunteer operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application and UI"]
  node_app["Application startup<br/>[app.py]"]
  node_window["Main window<br/>[main_window.py]"]
  node_login_ui["Login screen<br/>[login_page.py]"]
  node_workspace["Workspace shell<br/>[workspace.py]"]
end

subgraph group_identity["Identity and Access"]
  node_dongle["Dongle verification<br/>[dongle.py]"]
  node_password["Password authentication<br/>[login.py]"]
  node_face["Face authentication<br/>[face_auth.py]"]
  node_session["Session and keys<br/>[session.py]"]
  node_volunteers["Volunteer operations<br/>[volunteers.py]"]
end

subgraph group_operations["Relief Operations"]
  node_dashboard["Dashboard<br/>[dashboard_page.py]"]
  node_victims["Victim records<br/>[victims_page.py]"]
  node_chat["Encrypted chat<br/>[chat_page.py]"]
  node_photos["Photo documentation<br/>[photo_page.py]"]
  node_photo_metadata["Photo metadata<br/>[photo_metadata.py]"]
  node_files["Report files<br/>[files_page.py]"]
  node_downloads["Encrypted downloads"]
  node_aid["Aid distribution<br/>[aid_page.py]"]
  node_activity["Activity audit"]
  node_volunteer_ui["Volunteer management"]
end

subgraph group_security["Security and Persistence"]
  node_secure_store["Secure data access<br/>[secure_store.py]"]
  node_db[("SQLite access<br/>[db.py]")]
  node_key_mgmt["Key management<br/>[keys.py]"]
  node_aes["AES encryption<br/>[aes_module.py]"]
  node_chat_crypto["Chat encryption<br/>[super_encrypt.py]"]
  node_file_crypto["File encryption<br/>[chacha_module.py]"]
  node_stego["LSB steganography<br/>[stego_lsb.py]"]
  node_blockchain["Aid blockchain<br/>[blockchain.py]"]
  node_hashing["Password and hashes<br/>[hashing.py]"]
end

node_user(("Admin or volunteer"))

node_user -->|"starts app"| node_app
node_app -->|"opens window"| node_window
node_window -->|"routes login"| node_login_ui
node_login_ui -->|"checks dongle"| node_dongle
node_login_ui -->|"checks password"| node_password
node_login_ui -->|"checks face"| node_face
node_login_ui -->|"starts session"| node_session
node_session -->|"derives keys"| node_key_mgmt
node_password -->|"verifies password"| node_hashing
node_window -->|"shows workspace"| node_workspace
node_window -->|"opens page"| node_dashboard
node_window -->|"opens page"| node_victims
node_window -->|"opens page"| node_volunteer_ui
node_window -->|"opens page"| node_chat
node_window -->|"opens page"| node_photos
node_window -->|"opens page"| node_files
node_window -->|"opens page"| node_aid
node_window -->|"opens page"| node_activity
node_volunteer_ui -->|"manages accounts"| node_volunteers
node_volunteers -->|"provisions dongle"| node_dongle
node_volunteers -->|"stores face data"| node_face
node_victims -->|"accesses records"| node_secure_store
node_dashboard -->|"loads summary"| node_secure_store
node_secure_store -->|"queries database"| node_db
node_secure_store -->|"encrypts fields"| node_aes
node_chat -->|"encrypts messages"| node_chat_crypto
node_photos -->|"embeds metadata"| node_stego
node_photos -->|"uses metadata"| node_photo_metadata
node_files -->|"encrypts reports"| node_file_crypto
node_files -->|"opens downloads"| node_downloads
node_downloads -->|"decrypts reports"| node_file_crypto
node_aid -->|"records distributions"| node_secure_store
node_secure_store -->|"adds aid blocks"| node_blockchain
node_secure_store -->|"persists blocks"| node_db

click node_app "https://github.com/restufrmnsyh/saferelief/blob/main/app.py"
click node_window "https://github.com/restufrmnsyh/saferelief/blob/main/ui/main_window.py"
click node_login_ui "https://github.com/restufrmnsyh/saferelief/blob/main/ui/login_page.py"
click node_workspace "https://github.com/restufrmnsyh/saferelief/blob/main/ui/workspace.py"
click node_dashboard "https://github.com/restufrmnsyh/saferelief/blob/main/ui/dashboard_page.py"
click node_victims "https://github.com/restufrmnsyh/saferelief/blob/main/ui/victims_page.py"
click node_chat "https://github.com/restufrmnsyh/saferelief/blob/main/ui/chat_page.py"
click node_photos "https://github.com/restufrmnsyh/saferelief/blob/main/ui/photo_page.py"
click node_photo_metadata "https://github.com/restufrmnsyh/saferelief/blob/main/ui/photo_metadata.py"
click node_files "https://github.com/restufrmnsyh/saferelief/blob/main/ui/files_page.py"
click node_downloads "https://github.com/restufrmnsyh/saferelief/blob/main/ui/encrypted_downloads.py"
click node_aid "https://github.com/restufrmnsyh/saferelief/blob/main/ui/aid_page.py"
click node_activity "https://github.com/restufrmnsyh/saferelief/blob/main/ui/activity_log_page.py"
click node_volunteer_ui "https://github.com/restufrmnsyh/saferelief/blob/main/ui/volunteer_management_page.py"
click node_dongle "https://github.com/restufrmnsyh/saferelief/blob/main/auth/dongle.py"
click node_password "https://github.com/restufrmnsyh/saferelief/blob/main/auth/login.py"
click node_face "https://github.com/restufrmnsyh/saferelief/blob/main/auth/face_auth.py"
click node_session "https://github.com/restufrmnsyh/saferelief/blob/main/auth/session.py"
click node_volunteers "https://github.com/restufrmnsyh/saferelief/blob/main/auth/volunteers.py"
click node_secure_store "https://github.com/restufrmnsyh/saferelief/blob/main/database/secure_store.py"
click node_db "https://github.com/restufrmnsyh/saferelief/blob/main/database/db.py"
click node_key_mgmt "https://github.com/restufrmnsyh/saferelief/blob/main/crypto/keys.py"
click node_aes "https://github.com/restufrmnsyh/saferelief/blob/main/crypto/aes_module.py"
click node_chat_crypto "https://github.com/restufrmnsyh/saferelief/blob/main/crypto/super_encrypt.py"
click node_file_crypto "https://github.com/restufrmnsyh/saferelief/blob/main/crypto/chacha_module.py"
click node_stego "https://github.com/restufrmnsyh/saferelief/blob/main/crypto/stego_lsb.py"
click node_blockchain "https://github.com/restufrmnsyh/saferelief/blob/main/crypto/blockchain.py"
click node_hashing "https://github.com/restufrmnsyh/saferelief/blob/main/crypto/hashing.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_window,node_login_ui,node_workspace toneBlue
class node_dongle,node_password,node_face,node_session,node_volunteers toneAmber
class node_dashboard,node_victims,node_chat,node_photos,node_photo_metadata,node_files,node_downloads,node_aid,node_activity,node_volunteer_ui toneMint
class node_secure_store,node_db,node_key_mgmt,node_aes,node_chat_crypto,node_file_crypto,node_stego,node_blockchain,node_hashing toneRose
class node_user toneIndigo
```

## Components

### Application and UI

- [Application startup](https://github.com/restufrmnsyh/saferelief/blob/main/app.py): `app.py`
- [Main window](https://github.com/restufrmnsyh/saferelief/blob/main/ui/main_window.py): `ui/main_window.py`
- [Login screen](https://github.com/restufrmnsyh/saferelief/blob/main/ui/login_page.py): `ui/login_page.py`
- [Workspace shell](https://github.com/restufrmnsyh/saferelief/blob/main/ui/workspace.py): `ui/workspace.py`

### Identity and Access

- [Dongle verification](https://github.com/restufrmnsyh/saferelief/blob/main/auth/dongle.py): `auth/dongle.py`
- [Password authentication](https://github.com/restufrmnsyh/saferelief/blob/main/auth/login.py): `auth/login.py`
- [Face authentication](https://github.com/restufrmnsyh/saferelief/blob/main/auth/face_auth.py): `auth/face_auth.py`
- [Session and keys](https://github.com/restufrmnsyh/saferelief/blob/main/auth/session.py): `auth/session.py`
- [Volunteer operations](https://github.com/restufrmnsyh/saferelief/blob/main/auth/volunteers.py): `auth/volunteers.py`

### Relief Operations

- [Dashboard](https://github.com/restufrmnsyh/saferelief/blob/main/ui/dashboard_page.py): `ui/dashboard_page.py`
- [Victim records](https://github.com/restufrmnsyh/saferelief/blob/main/ui/victims_page.py): `ui/victims_page.py`
- [Encrypted chat](https://github.com/restufrmnsyh/saferelief/blob/main/ui/chat_page.py): `ui/chat_page.py`
- [Photo documentation](https://github.com/restufrmnsyh/saferelief/blob/main/ui/photo_page.py): `ui/photo_page.py`
- [Photo metadata](https://github.com/restufrmnsyh/saferelief/blob/main/ui/photo_metadata.py): `ui/photo_metadata.py`
- [Report files](https://github.com/restufrmnsyh/saferelief/blob/main/ui/files_page.py): `ui/files_page.py`
- [Encrypted downloads](https://github.com/restufrmnsyh/saferelief/blob/main/ui/encrypted_downloads.py): `ui/encrypted_downloads.py`
- [Aid distribution](https://github.com/restufrmnsyh/saferelief/blob/main/ui/aid_page.py): `ui/aid_page.py`
- [Activity audit](https://github.com/restufrmnsyh/saferelief/blob/main/ui/activity_log_page.py): `ui/activity_log_page.py`
- [Volunteer management](https://github.com/restufrmnsyh/saferelief/blob/main/ui/volunteer_management_page.py): `ui/volunteer_management_page.py`

### Security and Persistence

- [Secure data access](https://github.com/restufrmnsyh/saferelief/blob/main/database/secure_store.py): `database/secure_store.py`
- [SQLite access](https://github.com/restufrmnsyh/saferelief/blob/main/database/db.py): `database/db.py`
- [Key management](https://github.com/restufrmnsyh/saferelief/blob/main/crypto/keys.py): `crypto/keys.py`
- [AES encryption](https://github.com/restufrmnsyh/saferelief/blob/main/crypto/aes_module.py): `crypto/aes_module.py`
- [Chat encryption](https://github.com/restufrmnsyh/saferelief/blob/main/crypto/super_encrypt.py): `crypto/super_encrypt.py`
- [File encryption](https://github.com/restufrmnsyh/saferelief/blob/main/crypto/chacha_module.py): `crypto/chacha_module.py`
- [LSB steganography](https://github.com/restufrmnsyh/saferelief/blob/main/crypto/stego_lsb.py): `crypto/stego_lsb.py`
- [Aid blockchain](https://github.com/restufrmnsyh/saferelief/blob/main/crypto/blockchain.py): `crypto/blockchain.py`
- [Password and hashes](https://github.com/restufrmnsyh/saferelief/blob/main/crypto/hashing.py): `crypto/hashing.py`

### Other components

- **Admin or volunteer**

## Connections

- Admin or volunteer → Application startup: starts app (evidence: `README.md`)
- Application startup → Main window: opens window (evidence: `app.py`)
- Main window → Login screen: routes login (evidence: `ui/main_window.py`)
- Login screen → Dongle verification: checks dongle (evidence: `ui/login_page.py`)
- Login screen → Password authentication: checks password (evidence: `ui/login_page.py`)
- Login screen → Face authentication: checks face (evidence: `ui/login_page.py`)
- Login screen → Session and keys: starts session (evidence: `ui/login_page.py`)
- Session and keys → Key management: derives keys (evidence: `auth/session.py`)
- Password authentication → Password and hashes: verifies password (evidence: `auth/login.py`)
- Main window → Workspace shell: shows workspace (evidence: `ui/main_window.py`)
- Main window → Dashboard: opens page (evidence: `ui/main_window.py`)
- Main window → Victim records: opens page (evidence: `ui/main_window.py`)
- Main window → Volunteer management: opens page (evidence: `ui/main_window.py`)
- Main window → Encrypted chat: opens page (evidence: `ui/main_window.py`)
- Main window → Photo documentation: opens page (evidence: `ui/main_window.py`)
- Main window → Report files: opens page (evidence: `ui/main_window.py`)
- Main window → Aid distribution: opens page (evidence: `ui/main_window.py`)
- Main window → Activity audit: opens page (evidence: `ui/main_window.py`)
- Volunteer management → Volunteer operations: manages accounts (evidence: `ui/volunteer_management_page.py`)
- Volunteer operations → Dongle verification: provisions dongle (evidence: `auth/volunteers.py`)
- Volunteer operations → Face authentication: stores face data (evidence: `auth/volunteers.py`)
- Victim records → Secure data access: accesses records (evidence: `ui/victims_page.py`)
- Dashboard → Secure data access: loads summary (evidence: `ui/dashboard_page.py`)
- Secure data access → SQLite access: queries database (evidence: `database/secure_store.py`)
- Secure data access → AES encryption: encrypts fields (evidence: `database/secure_store.py`)
- Encrypted chat → Chat encryption: encrypts messages (evidence: `README.md`)
- Photo documentation → LSB steganography: embeds metadata (evidence: `ui/photo_page.py`)
- Photo documentation → Photo metadata: uses metadata (evidence: `ui/photo_page.py`)
- Report files → File encryption: encrypts reports (evidence: `ui/files_page.py`)
- Report files → Encrypted downloads: opens downloads (evidence: `ui/files_page.py`)
- Encrypted downloads → File encryption: decrypts reports (evidence: `ui/encrypted_downloads.py`)
- Aid distribution → Secure data access: records distributions (evidence: `README.md`)
- Secure data access → Aid blockchain: adds aid blocks (evidence: `database/secure_store.py`)
- Secure data access → SQLite access: persists blocks (evidence: `database/secure_store.py`)
