# guref/humnt-dap architecture

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

- Interactive diagram: https://gitdiagram.com/guref/humnt-dap
- Repository: https://github.com/guref/humnt-dap

## Overview

This is a Flask personnel-records system for searching institutional employee data, handling leave and personnel-change workflows, and producing reports. Users enter through the web application; its routes handle authentication, search, employee modules, requests, and administration. The principal search path consolidates spreadsheet records and can export selected results. Excel structure discovery and JSON configuration are handled by a controller, while a separate controller builds PDFs. The excerpts show only part of the large application, so some documented-by-code capabilities are represented at route/subsystem level rather than as inferred call chains.

Main entry points: [`data`](https://github.com/guref/humnt-dap/tree/main/data) (Personnel spreadsheets), [`controllers/database_ops.py`](https://github.com/guref/humnt-dap/blob/main/controllers/database_ops.py) (Excel and JSON operations), [`controllers/pdf_logic.py`](https://github.com/guref/humnt-dap/blob/main/controllers/pdf_logic.py) (PDF generation), [`app.py`](https://github.com/guref/humnt-dap/blob/main/app.py) (Global personnel search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web workflows"]
  node_webapp["Flask application<br/>[app.py]"]
  node_auth["Login and sessions<br/>[app.py]"]
  node_global_search["Global personnel search<br/>[app.py]"]
  node_vacations["Vacation records<br/>[app.py]"]
  node_leave["Leave permissions<br/>[app.py]"]
  node_retirement["Retirement requests<br/>[app.py]"]
  node_admin["Administration<br/>[app.py]"]
end

subgraph group_records["Personnel records"]
  node_db_ops["Excel and JSON operations<br/>[database_ops.py]"]
  node_personnel_data[("Personnel spreadsheets")]
  node_json_data[("Application JSON data")]
end

subgraph group_reports["Reporting"]
  node_exports["Custom exports<br/>[app.py]"]
  node_pdf["PDF generation<br/>[pdf_logic.py]"]
end

node_user(("Staff user"))

node_user -->|"uses"| node_webapp
node_user -->|"signs in"| node_auth
node_user -->|"searches records"| node_global_search
node_user -->|"views records"| node_vacations
node_user -.->|"manages leave"| node_leave
node_user -->|"submits requests"| node_retirement
node_user -->|"administers users"| node_admin
node_user -->|"requests export"| node_exports
node_global_search -->|"searches spreadsheets"| node_personnel_data
node_exports -->|"searches spreadsheets"| node_personnel_data
node_db_ops -->|"reads workbooks"| node_personnel_data
node_db_ops -->|"loads configuration"| node_json_data
node_pdf -->|"loads data helpers"| node_db_ops
node_pdf -->|"reads report data"| node_personnel_data

click node_webapp "https://github.com/guref/humnt-dap/blob/main/app.py"
click node_auth "https://github.com/guref/humnt-dap/blob/main/app.py"
click node_global_search "https://github.com/guref/humnt-dap/blob/main/app.py"
click node_vacations "https://github.com/guref/humnt-dap/blob/main/app.py"
click node_leave "https://github.com/guref/humnt-dap/blob/main/app.py"
click node_retirement "https://github.com/guref/humnt-dap/blob/main/app.py"
click node_admin "https://github.com/guref/humnt-dap/blob/main/app.py"
click node_exports "https://github.com/guref/humnt-dap/blob/main/app.py"
click node_db_ops "https://github.com/guref/humnt-dap/blob/main/controllers/database_ops.py"
click node_personnel_data "https://github.com/guref/humnt-dap/tree/main/data"
click node_json_data "https://github.com/guref/humnt-dap/tree/main/data"
click node_pdf "https://github.com/guref/humnt-dap/blob/main/controllers/pdf_logic.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_webapp,node_auth,node_global_search,node_vacations,node_leave,node_retirement,node_admin,node_user toneBlue
class node_db_ops,node_personnel_data,node_json_data toneAmber
class node_exports,node_pdf toneMint
```

## Components

### Web workflows

- [Flask application](https://github.com/guref/humnt-dap/blob/main/app.py): `app.py`
- [Login and sessions](https://github.com/guref/humnt-dap/blob/main/app.py): `app.py`
- [Global personnel search](https://github.com/guref/humnt-dap/blob/main/app.py): `app.py`
- [Vacation records](https://github.com/guref/humnt-dap/blob/main/app.py): `app.py`
- [Leave permissions](https://github.com/guref/humnt-dap/blob/main/app.py): `app.py`
- [Retirement requests](https://github.com/guref/humnt-dap/blob/main/app.py): `app.py`
- [Administration](https://github.com/guref/humnt-dap/blob/main/app.py): `app.py`

### Personnel records

- [Excel and JSON operations](https://github.com/guref/humnt-dap/blob/main/controllers/database_ops.py): `controllers/database_ops.py`
- [Personnel spreadsheets](https://github.com/guref/humnt-dap/tree/main/data): `data`
- [Application JSON data](https://github.com/guref/humnt-dap/tree/main/data): `data`

### Reporting

- [Custom exports](https://github.com/guref/humnt-dap/blob/main/app.py): `app.py`
- [PDF generation](https://github.com/guref/humnt-dap/blob/main/controllers/pdf_logic.py): `controllers/pdf_logic.py`

### Other components

- **Staff user**

## Connections

- Staff user → Flask application: uses (evidence: `app.py`)
- Staff user → Login and sessions: signs in (evidence: `app.py`)
- Staff user → Global personnel search: searches records (evidence: `app.py`)
- Staff user → Vacation records: views records (evidence: `app.py`)
- Staff user → Leave permissions: manages leave
- Staff user → Retirement requests: submits requests (evidence: `app.py`)
- Staff user → Administration: administers users (evidence: `app.py`)
- Staff user → Custom exports: requests export (evidence: `app.py`)
- Global personnel search → Personnel spreadsheets: searches spreadsheets (evidence: `app.py`)
- Custom exports → Personnel spreadsheets: searches spreadsheets (evidence: `app.py`)
- Excel and JSON operations → Personnel spreadsheets: reads workbooks (evidence: `controllers/database_ops.py`)
- Excel and JSON operations → Application JSON data: loads configuration (evidence: `controllers/database_ops.py`)
- PDF generation → Excel and JSON operations: loads data helpers (evidence: `controllers/pdf_logic.py`)
- PDF generation → Personnel spreadsheets: reads report data (evidence: `controllers/pdf_logic.py`)
