# aelly-a/cis4301-project architecture

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

- Interactive diagram: https://gitdiagram.com/aelly-a/cis4301-project
- Repository: https://github.com/aelly-a/cis4301-project

## Overview

This is a command-line library-management application for catalog and patron maintenance, circulation, waitlists, and searches, backed by MariaDB. The main workflow is menu selection, interactive validation/filter collection, database operations, and committing changes; separate database initialization loads SQL seed files. The excerpts show menu dispatch and several helper-to-database calls, but db_handler is partial and several helper routines are unsampled, so database-operation links for documented menu capabilities are limited to relationships supported by the shown source or source index.

Main entry points: [`db_handler.py`](https://github.com/aelly-a/cis4301-project/blob/main/db_handler.py) (Database operations), [`helper_functions.py`](https://github.com/aelly-a/cis4301-project/blob/main/helper_functions.py) (Interactive workflows), [`main.py`](https://github.com/aelly-a/cis4301-project/blob/main/main.py) (Menu dispatcher), [`load_db.py`](https://github.com/aelly-a/cis4301-project/blob/main/load_db.py) (SQL data loader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI workflows"]
  node_main["Menu dispatcher<br/>[main.py]"]
  node_interactive["Interactive workflows"]
end

subgraph group_circulation["Circulation"]
  node_circulation["Checkout, return, extensions"]
  node_waitlist["Waitlist coordination"]
end

subgraph group_catalog["Catalog and search"]
  node_catalog_ops["Catalog and patron edits"]
  node_search["Table searches"]
end

subgraph group_persistence["Persistence and models"]
  node_db["Database operations<br/>[db_handler.py]"]
  node_credentials["MariaDB settings<br/>[MARIADB_CREDS.py]"]
  node_database[("Library database")]
  node_loader["SQL data loader<br/>[load_db.py]"]
  node_book["Book model<br/>[Book.py]"]
  node_user["User model<br/>[User.py]"]
  node_loan["Loan model<br/>[Loan.py]"]
  node_history["Loan history model<br/>[LoanHistory.py]"]
  node_waitlist_model["Waitlist model<br/>[Waitlist.py]"]
end

node_patron(("Library operator"))

node_patron -->|"selects actions"| node_main
node_main -->|"dispatches menu"| node_interactive
node_interactive -->|"runs workflows"| node_circulation
node_interactive -.->|"runs workflows"| node_catalog_ops
node_interactive -->|"routes searches"| node_search
node_circulation -->|"checks and mutates"| node_db
node_circulation -.->|"coordinates queue"| node_waitlist
node_waitlist -->|"queries queue"| node_db
node_catalog_ops -->|"adds and edits"| node_db
node_search -->|"requests filtered rows"| node_db
node_main -->|"commits and closes"| node_db
node_db -->|"reads settings"| node_credentials
node_db -->|"connects and queries"| node_database
node_loader -->|"reads settings"| node_credentials
node_loader -->|"creates and seeds"| node_database
node_db -->|"uses model"| node_book
node_db -->|"uses model"| node_user
node_db -->|"uses model"| node_loan
node_db -->|"uses model"| node_history
node_db -->|"uses model"| node_waitlist_model
node_interactive -->|"builds filters"| node_book
node_interactive -->|"builds filters"| node_user
node_interactive -->|"builds filters"| node_loan
node_interactive -->|"builds filters"| node_history
node_interactive -->|"builds filters"| node_waitlist_model

click node_main "https://github.com/aelly-a/cis4301-project/blob/main/main.py"
click node_interactive "https://github.com/aelly-a/cis4301-project/blob/main/helper_functions.py"
click node_circulation "https://github.com/aelly-a/cis4301-project/blob/main/helper_functions.py"
click node_waitlist "https://github.com/aelly-a/cis4301-project/blob/main/helper_functions.py"
click node_catalog_ops "https://github.com/aelly-a/cis4301-project/blob/main/helper_functions.py"
click node_search "https://github.com/aelly-a/cis4301-project/blob/main/helper_functions.py"
click node_db "https://github.com/aelly-a/cis4301-project/blob/main/db_handler.py"
click node_credentials "https://github.com/aelly-a/cis4301-project/blob/main/MARIADB_CREDS.py"
click node_loader "https://github.com/aelly-a/cis4301-project/blob/main/load_db.py"
click node_book "https://github.com/aelly-a/cis4301-project/blob/main/models/Book.py"
click node_user "https://github.com/aelly-a/cis4301-project/blob/main/models/User.py"
click node_loan "https://github.com/aelly-a/cis4301-project/blob/main/models/Loan.py"
click node_history "https://github.com/aelly-a/cis4301-project/blob/main/models/LoanHistory.py"
click node_waitlist_model "https://github.com/aelly-a/cis4301-project/blob/main/models/Waitlist.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_main,node_interactive toneBlue
class node_circulation,node_waitlist toneAmber
class node_catalog_ops,node_search toneMint
class node_db,node_credentials,node_database,node_loader,node_book,node_user,node_loan,node_history,node_waitlist_model toneRose
class node_patron toneIndigo
```

## Components

### CLI workflows

- [Menu dispatcher](https://github.com/aelly-a/cis4301-project/blob/main/main.py): `main.py`
- [Interactive workflows](https://github.com/aelly-a/cis4301-project/blob/main/helper_functions.py): `helper_functions.py`

### Circulation

- [Checkout, return, extensions](https://github.com/aelly-a/cis4301-project/blob/main/helper_functions.py): `helper_functions.py`
- [Waitlist coordination](https://github.com/aelly-a/cis4301-project/blob/main/helper_functions.py): `helper_functions.py`

### Catalog and search

- [Catalog and patron edits](https://github.com/aelly-a/cis4301-project/blob/main/helper_functions.py): `helper_functions.py`
- [Table searches](https://github.com/aelly-a/cis4301-project/blob/main/helper_functions.py): `helper_functions.py`

### Persistence and models

- [Database operations](https://github.com/aelly-a/cis4301-project/blob/main/db_handler.py): `db_handler.py`
- [MariaDB settings](https://github.com/aelly-a/cis4301-project/blob/main/MARIADB_CREDS.py): `MARIADB_CREDS.py`
- **Library database**
- [SQL data loader](https://github.com/aelly-a/cis4301-project/blob/main/load_db.py): `load_db.py`
- [Book model](https://github.com/aelly-a/cis4301-project/blob/main/models/Book.py): `models/Book.py`
- [User model](https://github.com/aelly-a/cis4301-project/blob/main/models/User.py): `models/User.py`
- [Loan model](https://github.com/aelly-a/cis4301-project/blob/main/models/Loan.py): `models/Loan.py`
- [Loan history model](https://github.com/aelly-a/cis4301-project/blob/main/models/LoanHistory.py): `models/LoanHistory.py`
- [Waitlist model](https://github.com/aelly-a/cis4301-project/blob/main/models/Waitlist.py): `models/Waitlist.py`

### Other components

- **Library operator**

## Connections

- Library operator → Menu dispatcher: selects actions
- Menu dispatcher → Interactive workflows: dispatches menu (evidence: `main.py`)
- Interactive workflows → Checkout, return, extensions: runs workflows (evidence: `helper_functions.py`)
- Interactive workflows → Catalog and patron edits: runs workflows (evidence: `helper_functions.py`)
- Interactive workflows → Table searches: routes searches (evidence: `helper_functions.py`)
- Checkout, return, extensions → Database operations: checks and mutates (evidence: `helper_functions.py`)
- Checkout, return, extensions → Waitlist coordination: coordinates queue (evidence: `helper_functions.py`)
- Waitlist coordination → Database operations: queries queue (evidence: `helper_functions.py`)
- Catalog and patron edits → Database operations: adds and edits (evidence: `helper_functions.py`)
- Table searches → Database operations: requests filtered rows (evidence: `helper_functions.py`)
- Menu dispatcher → Database operations: commits and closes (evidence: `main.py`)
- Database operations → MariaDB settings: reads settings (evidence: `db_handler.py`)
- Database operations → Library database: connects and queries (evidence: `db_handler.py`)
- SQL data loader → MariaDB settings: reads settings (evidence: `load_db.py`)
- SQL data loader → Library database: creates and seeds (evidence: `load_db.py`)
- Database operations → Book model: uses model (evidence: `db_handler.py`)
- Database operations → User model: uses model (evidence: `db_handler.py`)
- Database operations → Loan model: uses model (evidence: `db_handler.py`)
- Database operations → Loan history model: uses model (evidence: `db_handler.py`)
- Database operations → Waitlist model: uses model (evidence: `db_handler.py`)
- Interactive workflows → Book model: builds filters (evidence: `helper_functions.py`)
- Interactive workflows → User model: builds filters (evidence: `helper_functions.py`)
- Interactive workflows → Loan model: builds filters (evidence: `helper_functions.py`)
- Interactive workflows → Loan history model: builds filters (evidence: `helper_functions.py`)
- Interactive workflows → Waitlist model: builds filters (evidence: `helper_functions.py`)
