# macho25/donors_registry architecture

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

- Interactive diagram: https://gitdiagram.com/macho25/donors_registry
- Repository: https://github.com/macho25/donors_registry

## Overview

This is a Flask registry for managing blood donors for the Czech Red Cross in Frýdek-Místek. Staff sign in, import donation records into batches, and use the resulting donor overview to review donor details and medal eligibility, award medals, and prepare documents. Separate workflows maintain donor contacts, overrides, and ignored-donor records. The sampled code shows Flask blueprints dispatching these workflows and SQLAlchemy-backed state; several less-sampled capabilities are represented only where the tree or README supports them.

Main entry points: [`registry/donor/views.py`](https://github.com/macho25/donors_registry/blob/master/registry/donor/views.py) (Donor management), [`registry/batch/views.py`](https://github.com/macho25/donors_registry/blob/master/registry/batch/views.py) (Batch workflows), [`registry/app.py`](https://github.com/macho25/donors_registry/blob/master/registry/app.py) (App factory), [`registry/public/views.py`](https://github.com/macho25/donors_registry/blob/master/registry/public/views.py) (Login and session)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_factory["App factory<br/>[app.py]"]
  node_auth["Login and session<br/>[views.py]"]
  node_public["Public dashboard<br/>[views.py]"]
  node_overview_ui["Donor overview UI<br/>[overview_table.js]"]
end

subgraph group_records["Donor records"]
  node_batch_views["Batch workflows<br/>[views.py]"]
  node_batch_forms["Import validation<br/>[forms.py]"]
  node_import_utils["Import parsing<br/>[utils.py]"]
  node_records_model["Batches and records<br/>[models.py]"]
  node_overview["Donor overview<br/>[models.py]"]
  node_donor_views["Donor management<br/>[views.py]"]
  node_donor_forms["Donor forms<br/>[forms.py]"]
end

subgraph group_medals["Medals and awards"]
  node_medal_catalog["Medal definitions<br/>[models.py]"]
  node_eligibility["Eligibility snapshots<br/>[models.py]"]
  node_awards["Award records<br/>[models.py]"]
  node_award_outputs["Award documents"]
end

subgraph group_contacts["Contacts and exceptions"]
  node_contact_import["Contact import<br/>[views.py]"]
  node_contact_forms["Contact validation<br/>[forms.py]"]
  node_notes["Donor notes<br/>[models.py]"]
  node_contact_audit["Contact import log<br/>[models.py]"]
  node_exceptions["Overrides and ignored<br/>[models.py]"]
end

node_staff(("Registry staff"))
node_database[("Application database")]

node_staff -->|"uses"| node_factory
node_factory -->|"registers"| node_auth
node_factory -->|"registers"| node_public
node_factory -->|"registers"| node_batch_views
node_factory -->|"registers"| node_donor_views
node_auth -->|"reads users"| node_database
node_auth -->|"signs in"| node_public
node_public -->|"reads dashboard"| node_database
node_staff -->|"imports records"| node_batch_views
node_batch_views -->|"validates input"| node_batch_forms
node_batch_forms -->|"parses lines"| node_import_utils
node_batch_views -->|"creates batches"| node_records_model
node_batch_views -->|"saves records"| node_database
node_records_model -->|"stores records"| node_database
node_batch_views -->|"refreshes overview"| node_overview
node_overview -->|"stores donor summary"| node_database
node_staff -->|"manages donors"| node_donor_views
node_donor_views -->|"queries donors"| node_overview
node_donor_views -->|"validates actions"| node_donor_forms
node_donor_views -->|"renders overview"| node_overview_ui
node_overview_ui -->|"requests table data"| node_donor_views
node_donor_views -->|"reads and updates"| node_database
node_donor_views -->|"selects medal"| node_medal_catalog
node_donor_views -->|"checks eligibility"| node_eligibility
node_eligibility -->|"stores snapshots"| node_database
node_donor_views -->|"records awards"| node_awards
node_awards -->|"stores awards"| node_database
node_donor_views -->|"renders documents"| node_award_outputs
node_staff -->|"imports contacts"| node_contact_import
node_contact_import -->|"validates input"| node_contact_forms
node_contact_import -->|"updates contacts"| node_notes
node_contact_import -->|"records import"| node_contact_audit
node_notes -->|"stores notes"| node_database
node_contact_audit -->|"stores audit log"| node_database
node_donor_views -->|"manages exceptions"| node_exceptions
node_exceptions -->|"stores overrides"| node_database

click node_factory "https://github.com/macho25/donors_registry/blob/master/registry/app.py"
click node_auth "https://github.com/macho25/donors_registry/blob/master/registry/public/views.py"
click node_public "https://github.com/macho25/donors_registry/blob/master/registry/public/views.py"
click node_batch_views "https://github.com/macho25/donors_registry/blob/master/registry/batch/views.py"
click node_batch_forms "https://github.com/macho25/donors_registry/blob/master/registry/batch/forms.py"
click node_import_utils "https://github.com/macho25/donors_registry/blob/master/registry/batch/utils.py"
click node_records_model "https://github.com/macho25/donors_registry/blob/master/registry/donor/models.py"
click node_overview "https://github.com/macho25/donors_registry/blob/master/registry/donor/models.py"
click node_donor_views "https://github.com/macho25/donors_registry/blob/master/registry/donor/views.py"
click node_donor_forms "https://github.com/macho25/donors_registry/blob/master/registry/donor/forms.py"
click node_medal_catalog "https://github.com/macho25/donors_registry/blob/master/registry/list/models.py"
click node_eligibility "https://github.com/macho25/donors_registry/blob/master/registry/donor/models.py"
click node_awards "https://github.com/macho25/donors_registry/blob/master/registry/donor/models.py"
click node_award_outputs "https://github.com/macho25/donors_registry/blob/master/registry/templates/donor/award_document.html"
click node_contact_import "https://github.com/macho25/donors_registry/blob/master/registry/batch/views.py"
click node_contact_forms "https://github.com/macho25/donors_registry/blob/master/registry/batch/forms.py"
click node_notes "https://github.com/macho25/donors_registry/blob/master/registry/donor/models.py"
click node_contact_audit "https://github.com/macho25/donors_registry/blob/master/registry/donor/models.py"
click node_exceptions "https://github.com/macho25/donors_registry/blob/master/registry/donor/models.py"
click node_overview_ui "https://github.com/macho25/donors_registry/blob/master/registry/templates/donor/overview_table.js"

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_factory,node_auth,node_public,node_overview_ui toneBlue
class node_batch_views,node_batch_forms,node_import_utils,node_records_model,node_overview,node_donor_views,node_donor_forms,node_database toneAmber
class node_medal_catalog,node_eligibility,node_awards,node_award_outputs toneMint
class node_contact_import,node_contact_forms,node_notes,node_contact_audit,node_exceptions toneRose
class node_staff toneIndigo
```

## Components

### Web application

- [App factory](https://github.com/macho25/donors_registry/blob/master/registry/app.py): `registry/app.py`
- [Login and session](https://github.com/macho25/donors_registry/blob/master/registry/public/views.py): `registry/public/views.py`
- [Public dashboard](https://github.com/macho25/donors_registry/blob/master/registry/public/views.py): `registry/public/views.py`
- [Donor overview UI](https://github.com/macho25/donors_registry/blob/master/registry/templates/donor/overview_table.js): `registry/templates/donor/overview_table.js`

### Donor records

- [Batch workflows](https://github.com/macho25/donors_registry/blob/master/registry/batch/views.py): `registry/batch/views.py`
- [Import validation](https://github.com/macho25/donors_registry/blob/master/registry/batch/forms.py): `registry/batch/forms.py`
- [Import parsing](https://github.com/macho25/donors_registry/blob/master/registry/batch/utils.py): `registry/batch/utils.py`
- [Batches and records](https://github.com/macho25/donors_registry/blob/master/registry/donor/models.py): `registry/donor/models.py`
- [Donor overview](https://github.com/macho25/donors_registry/blob/master/registry/donor/models.py): `registry/donor/models.py`
- [Donor management](https://github.com/macho25/donors_registry/blob/master/registry/donor/views.py): `registry/donor/views.py`
- [Donor forms](https://github.com/macho25/donors_registry/blob/master/registry/donor/forms.py): `registry/donor/forms.py`

### Medals and awards

- [Medal definitions](https://github.com/macho25/donors_registry/blob/master/registry/list/models.py): `registry/list/models.py`
- [Eligibility snapshots](https://github.com/macho25/donors_registry/blob/master/registry/donor/models.py): `registry/donor/models.py`
- [Award records](https://github.com/macho25/donors_registry/blob/master/registry/donor/models.py): `registry/donor/models.py`
- [Award documents](https://github.com/macho25/donors_registry/blob/master/registry/templates/donor/award_document.html): `registry/templates/donor/award_document.html`

### Contacts and exceptions

- [Contact import](https://github.com/macho25/donors_registry/blob/master/registry/batch/views.py): `registry/batch/views.py`
- [Contact validation](https://github.com/macho25/donors_registry/blob/master/registry/batch/forms.py): `registry/batch/forms.py`
- [Donor notes](https://github.com/macho25/donors_registry/blob/master/registry/donor/models.py): `registry/donor/models.py`
- [Contact import log](https://github.com/macho25/donors_registry/blob/master/registry/donor/models.py): `registry/donor/models.py`
- [Overrides and ignored](https://github.com/macho25/donors_registry/blob/master/registry/donor/models.py): `registry/donor/models.py`

### Other components

- **Registry staff**
- **Application database**

## Connections

- Registry staff → App factory: uses
- App factory → Login and session: registers
- App factory → Public dashboard: registers
- App factory → Batch workflows: registers
- App factory → Donor management: registers
- Login and session → Application database: reads users
- Login and session → Public dashboard: signs in
- Public dashboard → Application database: reads dashboard
- Registry staff → Batch workflows: imports records
- Batch workflows → Import validation: validates input
- Import validation → Import parsing: parses lines
- Batch workflows → Batches and records: creates batches
- Batch workflows → Application database: saves records
- Batches and records → Application database: stores records
- Batch workflows → Donor overview: refreshes overview
- Donor overview → Application database: stores donor summary
- Registry staff → Donor management: manages donors
- Donor management → Donor overview: queries donors
- Donor management → Donor forms: validates actions
- Donor management → Donor overview UI: renders overview
- Donor overview UI → Donor management: requests table data
- Donor management → Application database: reads and updates
- Donor management → Medal definitions: selects medal
- Donor management → Eligibility snapshots: checks eligibility
- Eligibility snapshots → Application database: stores snapshots
- Donor management → Award records: records awards
- Award records → Application database: stores awards
- Donor management → Award documents: renders documents
- Registry staff → Contact import: imports contacts
- Contact import → Contact validation: validates input
- Contact import → Donor notes: updates contacts
- Contact import → Contact import log: records import
- Donor notes → Application database: stores notes
- Contact import log → Application database: stores audit log
- Donor management → Overrides and ignored: manages exceptions
- Overrides and ignored → Application database: stores overrides
