# gamingforce466-collab/digisign-15 architecture

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

- Interactive diagram: https://gitdiagram.com/gamingforce466-collab/digisign-15
- Repository: https://github.com/gamingforce466-collab/digisign-15

## Overview

DigiSign is a web application for creating RSA-PSS digital signatures on supported documents and verifying their integrity and embedded QR metadata. The principal workflow is key creation, document upload and signing, format-specific QR/metadata embedding, then verification; users can add multiple signers. Flask and Streamlit provide interfaces, while a shared workflow coordinates crypto, document-format dispatch, QR generation, and persisted records. README also documents benchmarking/export, demo data, and storage cleanup. Streamlit wiring and several secondary services were not excerpted, so those connections are shown only where documented or indexed.

Main entry points: [`services/document_workflow.py`](https://github.com/gamingforce466-collab/digisign-15/blob/main/services/document_workflow.py) (Document workflow), [`formats/__init__.py`](https://github.com/gamingforce466-collab/digisign-15/blob/main/formats/__init__.py) (Format dispatcher), [`app.py`](https://github.com/gamingforce466-collab/digisign-15/blob/main/app.py) (Flask UI), [`streamlit_app.py`](https://github.com/gamingforce466-collab/digisign-15/blob/main/streamlit_app.py) (Streamlit UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User interfaces"]
  node_flask["Flask UI<br/>[app.py]"]
  node_streamlit["Streamlit UI<br/>[streamlit_app.py]"]
end

subgraph group_workflow["Signing workflow"]
  node_workflow["Document workflow"]
  node_records[("Signature records")]
  node_documents_store[("Document files")]
end

subgraph group_crypto["Cryptography"]
  node_key_store[("Key files")]
  node_keys["RSA key management<br/>[keys.py]"]
  node_signer["RSA-PSS signing<br/>[signer.py]"]
  node_verifier["Signature verification<br/>[verifier.py]"]
end

subgraph group_documents["Document formats"]
  node_dispatcher["Format dispatcher<br/>[__init__.py]"]
  node_format_registry["Document formats"]
  node_pdf["PDF handler<br/>[handler.py]"]
  node_docx["DOCX handler<br/>[handler.py]"]
  node_image["Image handler<br/>[handler.py]"]
  node_text["TXT handler<br/>[handler.py]"]
  node_xlsx["XLSX handler<br/>[handler.py]"]
  node_format_common["Format utilities<br/>[common.py]"]
  node_qr["QR generation and decode<br/>[generator.py]"]
end

subgraph group_operations["Operations"]
  node_benchmark["Quantitative benchmark<br/>[benchmark.py]"]
  node_export["Excel report export<br/>[excel_exporter.py]"]
  node_randomdata["Demo data<br/>[randomdata.py]"]
  node_maintenance["Storage cleanup<br/>[maintenance.py]"]
  node_scenarios["Demo scenarios<br/>[scenarios.py]"]
end

node_user(("User"))

node_user -->|"uses"| node_flask
node_user -->|"uses"| node_streamlit
node_flask -->|"creates workflow"| node_workflow
node_flask -->|"manages keys"| node_keys
node_flask -->|"runs benchmark"| node_benchmark
node_flask -->|"clears storage"| node_maintenance
node_flask -->|"gets demo data"| node_randomdata
node_flask -->|"uses scenarios"| node_scenarios
node_streamlit -.->|"runs workflow"| node_workflow
node_streamlit -->|"manages keys"| node_keys
node_streamlit -->|"uses benchmark"| node_benchmark
node_streamlit -->|"clears storage"| node_maintenance
node_streamlit -->|"uses demo data"| node_randomdata
node_workflow -->|"reads and writes"| node_records
node_workflow -->|"stores documents"| node_documents_store
node_workflow -->|"loads keys"| node_keys
node_workflow -->|"signs digest"| node_signer
node_workflow -->|"verifies digest"| node_verifier
node_workflow -->|"validates and marks"| node_dispatcher
node_workflow -->|"creates QR payloads"| node_qr
node_keys -->|"reads and writes"| node_key_store
node_dispatcher -->|"dispatches PDF"| node_pdf
node_dispatcher -->|"dispatches DOCX"| node_docx
node_dispatcher -->|"dispatches images"| node_image
node_dispatcher -->|"dispatches TXT"| node_text
node_dispatcher -->|"dispatches XLSX"| node_xlsx
node_dispatcher -->|"uses utilities"| node_format_common
node_pdf -->|"decodes QR"| node_qr
node_docx -->|"uses utilities"| node_format_common
node_docx -->|"decodes QR"| node_qr
node_image -->|"uses utilities"| node_format_common
node_image -->|"generates and decodes"| node_qr
node_text -->|"decodes metadata"| node_qr
node_xlsx -->|"uses utilities"| node_format_common
node_xlsx -->|"generates and decodes"| node_qr
node_benchmark -.->|"exports report"| node_export
node_maintenance -.->|"clears files"| node_documents_store
node_maintenance -.->|"clears records"| node_records
node_maintenance -.->|"clears keys"| node_key_store
node_format_registry -->|"format mapping"| node_dispatcher

click node_flask "https://github.com/gamingforce466-collab/digisign-15/blob/main/app.py"
click node_streamlit "https://github.com/gamingforce466-collab/digisign-15/blob/main/streamlit_app.py"
click node_workflow "https://github.com/gamingforce466-collab/digisign-15/blob/main/services/document_workflow.py"
click node_records "https://github.com/gamingforce466-collab/digisign-15/tree/main/storage/signatures"
click node_documents_store "https://github.com/gamingforce466-collab/digisign-15/tree/main/storage/documents"
click node_key_store "https://github.com/gamingforce466-collab/digisign-15/tree/main/storage/keys"
click node_keys "https://github.com/gamingforce466-collab/digisign-15/blob/main/crypto/keys.py"
click node_signer "https://github.com/gamingforce466-collab/digisign-15/blob/main/crypto/signer.py"
click node_verifier "https://github.com/gamingforce466-collab/digisign-15/blob/main/crypto/verifier.py"
click node_dispatcher "https://github.com/gamingforce466-collab/digisign-15/blob/main/formats/__init__.py"
click node_format_registry "https://github.com/gamingforce466-collab/digisign-15/blob/main/document_formats.py"
click node_pdf "https://github.com/gamingforce466-collab/digisign-15/blob/main/pdf/handler.py"
click node_docx "https://github.com/gamingforce466-collab/digisign-15/blob/main/formats/docx/handler.py"
click node_image "https://github.com/gamingforce466-collab/digisign-15/blob/main/formats/image/handler.py"
click node_text "https://github.com/gamingforce466-collab/digisign-15/blob/main/formats/txt/handler.py"
click node_xlsx "https://github.com/gamingforce466-collab/digisign-15/blob/main/formats/xlsx/handler.py"
click node_format_common "https://github.com/gamingforce466-collab/digisign-15/blob/main/formats/common.py"
click node_qr "https://github.com/gamingforce466-collab/digisign-15/blob/main/qr/generator.py"
click node_benchmark "https://github.com/gamingforce466-collab/digisign-15/blob/main/crypto/benchmark.py"
click node_export "https://github.com/gamingforce466-collab/digisign-15/blob/main/crypto/excel_exporter.py"
click node_randomdata "https://github.com/gamingforce466-collab/digisign-15/blob/main/randomdata.py"
click node_maintenance "https://github.com/gamingforce466-collab/digisign-15/blob/main/services/maintenance.py"
click node_scenarios "https://github.com/gamingforce466-collab/digisign-15/blob/main/services/scenarios.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_flask,node_streamlit,node_user toneBlue
class node_workflow,node_records,node_documents_store toneAmber
class node_key_store,node_keys,node_signer,node_verifier toneMint
class node_dispatcher,node_format_registry,node_pdf,node_docx,node_image,node_text,node_xlsx,node_format_common,node_qr toneRose
class node_benchmark,node_export,node_randomdata,node_maintenance,node_scenarios toneIndigo
```

## Components

### User interfaces

- [Flask UI](https://github.com/gamingforce466-collab/digisign-15/blob/main/app.py): `app.py`
- [Streamlit UI](https://github.com/gamingforce466-collab/digisign-15/blob/main/streamlit_app.py): `streamlit_app.py`

### Signing workflow

- [Document workflow](https://github.com/gamingforce466-collab/digisign-15/blob/main/services/document_workflow.py): `services/document_workflow.py`
- [Signature records](https://github.com/gamingforce466-collab/digisign-15/tree/main/storage/signatures): `storage/signatures`
- [Document files](https://github.com/gamingforce466-collab/digisign-15/tree/main/storage/documents): `storage/documents`

### Cryptography

- [Key files](https://github.com/gamingforce466-collab/digisign-15/tree/main/storage/keys): `storage/keys`
- [RSA key management](https://github.com/gamingforce466-collab/digisign-15/blob/main/crypto/keys.py): `crypto/keys.py`
- [RSA-PSS signing](https://github.com/gamingforce466-collab/digisign-15/blob/main/crypto/signer.py): `crypto/signer.py`
- [Signature verification](https://github.com/gamingforce466-collab/digisign-15/blob/main/crypto/verifier.py): `crypto/verifier.py`

### Document formats

- [Format dispatcher](https://github.com/gamingforce466-collab/digisign-15/blob/main/formats/__init__.py): `formats/__init__.py`
- [Document formats](https://github.com/gamingforce466-collab/digisign-15/blob/main/document_formats.py): `document_formats.py`
- [PDF handler](https://github.com/gamingforce466-collab/digisign-15/blob/main/pdf/handler.py): `pdf/handler.py`
- [DOCX handler](https://github.com/gamingforce466-collab/digisign-15/blob/main/formats/docx/handler.py): `formats/docx/handler.py`
- [Image handler](https://github.com/gamingforce466-collab/digisign-15/blob/main/formats/image/handler.py): `formats/image/handler.py`
- [TXT handler](https://github.com/gamingforce466-collab/digisign-15/blob/main/formats/txt/handler.py): `formats/txt/handler.py`
- [XLSX handler](https://github.com/gamingforce466-collab/digisign-15/blob/main/formats/xlsx/handler.py): `formats/xlsx/handler.py`
- [Format utilities](https://github.com/gamingforce466-collab/digisign-15/blob/main/formats/common.py): `formats/common.py`
- [QR generation and decode](https://github.com/gamingforce466-collab/digisign-15/blob/main/qr/generator.py): `qr/generator.py`

### Operations

- [Quantitative benchmark](https://github.com/gamingforce466-collab/digisign-15/blob/main/crypto/benchmark.py): `crypto/benchmark.py`
- [Excel report export](https://github.com/gamingforce466-collab/digisign-15/blob/main/crypto/excel_exporter.py): `crypto/excel_exporter.py`
- [Demo data](https://github.com/gamingforce466-collab/digisign-15/blob/main/randomdata.py): `randomdata.py`
- [Storage cleanup](https://github.com/gamingforce466-collab/digisign-15/blob/main/services/maintenance.py): `services/maintenance.py`
- [Demo scenarios](https://github.com/gamingforce466-collab/digisign-15/blob/main/services/scenarios.py): `services/scenarios.py`

### Other components

- **User**

## Connections

- User → Flask UI: uses (evidence: `README.md`)
- User → Streamlit UI: uses (evidence: `README.md`)
- Flask UI → Document workflow: creates workflow (evidence: `app.py`)
- Flask UI → RSA key management: manages keys (evidence: `app.py`)
- Flask UI → Quantitative benchmark: runs benchmark (evidence: `app.py`)
- Flask UI → Storage cleanup: clears storage (evidence: `app.py`)
- Flask UI → Demo data: gets demo data (evidence: `app.py`)
- Flask UI → Demo scenarios: uses scenarios (evidence: `app.py`)
- Streamlit UI → Document workflow: runs workflow
- Streamlit UI → RSA key management: manages keys (evidence: `streamlit_app.py`)
- Streamlit UI → Quantitative benchmark: uses benchmark (evidence: `streamlit_app.py`)
- Streamlit UI → Storage cleanup: clears storage (evidence: `streamlit_app.py`)
- Streamlit UI → Demo data: uses demo data (evidence: `streamlit_app.py`)
- Document workflow → Signature records: reads and writes (evidence: `services/document_workflow.py`)
- Document workflow → Document files: stores documents (evidence: `services/document_workflow.py`)
- Document workflow → RSA key management: loads keys (evidence: `services/document_workflow.py`)
- Document workflow → RSA-PSS signing: signs digest (evidence: `services/document_workflow.py`)
- Document workflow → Signature verification: verifies digest (evidence: `services/document_workflow.py`)
- Document workflow → Format dispatcher: validates and marks (evidence: `services/document_workflow.py`)
- Document workflow → QR generation and decode: creates QR payloads (evidence: `services/document_workflow.py`)
- RSA key management → Key files: reads and writes (evidence: `crypto/keys.py`)
- Format dispatcher → PDF handler: dispatches PDF (evidence: `formats/__init__.py`)
- Format dispatcher → DOCX handler: dispatches DOCX (evidence: `formats/__init__.py`)
- Format dispatcher → Image handler: dispatches images (evidence: `formats/__init__.py`)
- Format dispatcher → TXT handler: dispatches TXT (evidence: `formats/__init__.py`)
- Format dispatcher → XLSX handler: dispatches XLSX (evidence: `formats/__init__.py`)
- Format dispatcher → Format utilities: uses utilities
- PDF handler → QR generation and decode: decodes QR (evidence: `formats/__init__.py`)
- DOCX handler → Format utilities: uses utilities (evidence: `formats/docx/handler.py`)
- DOCX handler → QR generation and decode: decodes QR (evidence: `formats/docx/handler.py`)
- Image handler → Format utilities: uses utilities (evidence: `formats/image/handler.py`)
- Image handler → QR generation and decode: generates and decodes (evidence: `formats/image/handler.py`)
- TXT handler → QR generation and decode: decodes metadata (evidence: `formats/txt/handler.py`)
- XLSX handler → Format utilities: uses utilities (evidence: `formats/xlsx/handler.py`)
- XLSX handler → QR generation and decode: generates and decodes (evidence: `formats/xlsx/handler.py`)
- Quantitative benchmark → Excel report export: exports report
- Storage cleanup → Document files: clears files
- Storage cleanup → Signature records: clears records
- Storage cleanup → Key files: clears keys
- Document formats → Format dispatcher: format mapping (evidence: `document_formats.py`)
