# johnkurth/thelibrarianborrowingsystem architecture

> Architecture diagram of the GitHub repository johnkurth/thelibrarianborrowingsystem, 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/johnkurth/thelibrarianborrowingsystem
- Repository: https://github.com/johnkurth/thelibrarianborrowingsystem

## Overview

This is a PHP library-borrowing management system with administrator, librarian, and student areas. The principal workflow starts with sign-in, then lets students browse and borrow books, track current loans, return books, and review history; staff manage the catalog and users and monitor circulation and overdue activity. The database connection is the shared internal layer. Several operational pages are listed in the tree but were not excerpted, so their interactions are shown only where dashboard links or source-index references support them; the README provides no additional capability documentation.

Main entry points: [`admin/connect.php`](https://github.com/johnkurth/thelibrarianborrowingsystem/blob/master/admin/connect.php) (MySQL connection), [`student/index.php`](https://github.com/johnkurth/thelibrarianborrowingsystem/blob/master/student/index.php) (Student dashboard), [`user/index.php`](https://github.com/johnkurth/thelibrarianborrowingsystem/blob/master/user/index.php) (Librarian dashboard), [`student/view-book.php`](https://github.com/johnkurth/thelibrarianborrowingsystem/blob/master/student/view-book.php) (Student book browsing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Identity and access"]
  node_login["Sign in<br/>[index.php]"]
  node_registration["Registration<br/>[register.php]"]
  node_forgot["Password recovery<br/>[forgot.php]"]
  node_useradmin["Account management<br/>[add-user.php]"]
  node_dbconnection["MySQL connection<br/>[connect.php]"]
end

subgraph group_catalog["Catalog management"]
  node_admincatalog["Admin catalog CRUD<br/>[add-book.php]"]
  node_adminbookviews["Catalog views<br/>[view-book.php]"]
  node_categoryadmin["Category management<br/>[add-categ.php]"]
end

subgraph group_circulation["Circulation workflows"]
  node_studenthome["Student dashboard<br/>[index.php]"]
  node_studentcatalog["Student book browsing<br/>[view-book.php]"]
  node_studentborrow["Borrowing actions<br/>[borrow-books.php]"]
  node_studentloans["Student loans<br/>[borrowed.php]"]
  node_studentreturns["Returns and history<br/>[return.php]"]
end

subgraph group_oversight["Staff oversight"]
  node_adminhome["Admin dashboard<br/>[index.php]"]
  node_librarianhome["Librarian dashboard<br/>[index.php]"]
  node_staffloans["Loan monitoring"]
  node_staffoverdue["Overdue tracking<br/>[overdue.php]"]
  node_staffhistory["Circulation reports<br/>[view-history.php]"]
end

node_visitor(("Library user"))
node_mysqldb[("Application database")]

node_visitor -.->|"signs in"| node_login
node_visitor -.->|"registers"| node_registration
node_visitor -.->|"requests recovery"| node_forgot
node_login -->|"queries accounts"| node_dbconnection
node_registration -->|"uses connection"| node_dbconnection
node_adminhome -->|"loads account"| node_dbconnection
node_librarianhome -->|"uses connection"| node_dbconnection
node_studenthome -->|"loads account"| node_dbconnection
node_admincatalog -->|"uses connection"| node_dbconnection
node_adminbookviews -->|"uses connection"| node_dbconnection
node_categoryadmin -->|"uses connection"| node_dbconnection
node_useradmin -->|"uses connection"| node_dbconnection
node_studentcatalog -->|"uses connection"| node_dbconnection
node_staffloans -->|"queries loans"| node_dbconnection
node_dbconnection -->|"connects to"| node_mysqldb
node_adminhome -->|"links to"| node_staffloans
node_studenthome -->|"links to"| node_studentloans
node_studenthome -->|"links to history"| node_studentreturns
node_studenthome -.->|"offers browsing"| node_studentcatalog
node_studentcatalog -.->|"leads to borrowing"| node_studentborrow
node_studentborrow -.->|"records loan"| node_studentloans
node_studentloans -.->|"supports return"| node_studentreturns
node_librarianhome -.->|"offers tracking"| node_staffoverdue
node_librarianhome -.->|"offers history"| node_staffhistory
node_admincatalog -.->|"manages books"| node_adminbookviews

click node_login "https://github.com/johnkurth/thelibrarianborrowingsystem/blob/master/index.php"
click node_registration "https://github.com/johnkurth/thelibrarianborrowingsystem/blob/master/register.php"
click node_forgot "https://github.com/johnkurth/thelibrarianborrowingsystem/blob/master/forgot.php"
click node_adminhome "https://github.com/johnkurth/thelibrarianborrowingsystem/blob/master/admin/index.php"
click node_librarianhome "https://github.com/johnkurth/thelibrarianborrowingsystem/blob/master/user/index.php"
click node_studenthome "https://github.com/johnkurth/thelibrarianborrowingsystem/blob/master/student/index.php"
click node_admincatalog "https://github.com/johnkurth/thelibrarianborrowingsystem/blob/master/admin/add/add-book.php"
click node_adminbookviews "https://github.com/johnkurth/thelibrarianborrowingsystem/blob/master/admin/view/view-book.php"
click node_categoryadmin "https://github.com/johnkurth/thelibrarianborrowingsystem/blob/master/admin/add/add-categ.php"
click node_useradmin "https://github.com/johnkurth/thelibrarianborrowingsystem/blob/master/admin/add/add-user.php"
click node_studentcatalog "https://github.com/johnkurth/thelibrarianborrowingsystem/blob/master/student/view-book.php"
click node_studentborrow "https://github.com/johnkurth/thelibrarianborrowingsystem/blob/master/student/borrow-books.php"
click node_studentloans "https://github.com/johnkurth/thelibrarianborrowingsystem/blob/master/student/borrowed.php"
click node_studentreturns "https://github.com/johnkurth/thelibrarianborrowingsystem/blob/master/student/return.php"
click node_staffloans "https://github.com/johnkurth/thelibrarianborrowingsystem/blob/master/admin/view/view-borrow-books.php"
click node_staffoverdue "https://github.com/johnkurth/thelibrarianborrowingsystem/blob/master/admin/overdue.php"
click node_staffhistory "https://github.com/johnkurth/thelibrarianborrowingsystem/blob/master/admin/view/view-history.php"
click node_dbconnection "https://github.com/johnkurth/thelibrarianborrowingsystem/blob/master/admin/connect.php"

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_login,node_registration,node_forgot,node_useradmin,node_dbconnection,node_visitor toneBlue
class node_admincatalog,node_adminbookviews,node_categoryadmin,node_mysqldb toneAmber
class node_studenthome,node_studentcatalog,node_studentborrow,node_studentloans,node_studentreturns toneMint
class node_adminhome,node_librarianhome,node_staffloans,node_staffoverdue,node_staffhistory toneRose
```

## Components

### Identity and access

- [Sign in](https://github.com/johnkurth/thelibrarianborrowingsystem/blob/master/index.php): `index.php`
- [Registration](https://github.com/johnkurth/thelibrarianborrowingsystem/blob/master/register.php): `register.php`
- [Password recovery](https://github.com/johnkurth/thelibrarianborrowingsystem/blob/master/forgot.php): `forgot.php`
- [Account management](https://github.com/johnkurth/thelibrarianborrowingsystem/blob/master/admin/add/add-user.php): `admin/add/add-user.php`
- [MySQL connection](https://github.com/johnkurth/thelibrarianborrowingsystem/blob/master/admin/connect.php): `admin/connect.php`

### Catalog management

- [Admin catalog CRUD](https://github.com/johnkurth/thelibrarianborrowingsystem/blob/master/admin/add/add-book.php): `admin/add/add-book.php`
- [Catalog views](https://github.com/johnkurth/thelibrarianborrowingsystem/blob/master/admin/view/view-book.php): `admin/view/view-book.php`
- [Category management](https://github.com/johnkurth/thelibrarianborrowingsystem/blob/master/admin/add/add-categ.php): `admin/add/add-categ.php`

### Circulation workflows

- [Student dashboard](https://github.com/johnkurth/thelibrarianborrowingsystem/blob/master/student/index.php): `student/index.php`
- [Student book browsing](https://github.com/johnkurth/thelibrarianborrowingsystem/blob/master/student/view-book.php): `student/view-book.php`
- [Borrowing actions](https://github.com/johnkurth/thelibrarianborrowingsystem/blob/master/student/borrow-books.php): `student/borrow-books.php`
- [Student loans](https://github.com/johnkurth/thelibrarianborrowingsystem/blob/master/student/borrowed.php): `student/borrowed.php`
- [Returns and history](https://github.com/johnkurth/thelibrarianborrowingsystem/blob/master/student/return.php): `student/return.php`

### Staff oversight

- [Admin dashboard](https://github.com/johnkurth/thelibrarianborrowingsystem/blob/master/admin/index.php): `admin/index.php`
- [Librarian dashboard](https://github.com/johnkurth/thelibrarianborrowingsystem/blob/master/user/index.php): `user/index.php`
- [Loan monitoring](https://github.com/johnkurth/thelibrarianborrowingsystem/blob/master/admin/view/view-borrow-books.php): `admin/view/view-borrow-books.php`
- [Overdue tracking](https://github.com/johnkurth/thelibrarianborrowingsystem/blob/master/admin/overdue.php): `admin/overdue.php`
- [Circulation reports](https://github.com/johnkurth/thelibrarianborrowingsystem/blob/master/admin/view/view-history.php): `admin/view/view-history.php`

### Other components

- **Library user**
- **Application database**

## Connections

- Library user → Sign in: signs in
- Library user → Registration: registers
- Library user → Password recovery: requests recovery
- Sign in → MySQL connection: queries accounts (evidence: `index.php`)
- Registration → MySQL connection: uses connection (evidence: `register.php`)
- Admin dashboard → MySQL connection: loads account (evidence: `admin/index.php`)
- Librarian dashboard → MySQL connection: uses connection (evidence: `user/index.php`)
- Student dashboard → MySQL connection: loads account (evidence: `student/index.php`)
- Admin catalog CRUD → MySQL connection: uses connection (evidence: `admin/add/add-book.php`)
- Catalog views → MySQL connection: uses connection (evidence: `admin/view/view-book.php`)
- Category management → MySQL connection: uses connection (evidence: `admin/add/add-categ.php`)
- Account management → MySQL connection: uses connection (evidence: `admin/add/add-user.php`)
- Student book browsing → MySQL connection: uses connection (evidence: `student/view-book.php`)
- Loan monitoring → MySQL connection: queries loans (evidence: `admin/view/view-borrow-books.php`)
- MySQL connection → Application database: connects to (evidence: `admin/connect.php`)
- Admin dashboard → Loan monitoring: links to (evidence: `admin/index.php`)
- Student dashboard → Student loans: links to (evidence: `student/index.php`)
- Student dashboard → Returns and history: links to history (evidence: `student/index.php`)
- Student dashboard → Student book browsing: offers browsing
- Student book browsing → Borrowing actions: leads to borrowing
- Borrowing actions → Student loans: records loan
- Student loans → Returns and history: supports return
- Librarian dashboard → Overdue tracking: offers tracking
- Librarian dashboard → Circulation reports: offers history
- Admin catalog CRUD → Catalog views: manages books
