# mavs07082022/library architecture

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

- Interactive diagram: https://gitdiagram.com/mavs07082022/library
- Repository: https://github.com/mavs07082022/library

## Overview

St. Agnes Academy’s Library Management System serves students, librarians, and administrators. The visible entry workflow is homepage to sign-in; the API router dispatches supported management and authentication endpoints, while API handlers use shared Supabase access. Separate components cover registration, catalog search, borrowing, notifications, and administration. The README describes local setup and launching the NLP service, but gives little detail on user workflows; several UI-to-API connections therefore are not shown.

Main entry points: [`api/config.php`](https://github.com/mavs07082022/library/blob/master/api/config.php) (API and Data Helpers), [`api/index.php`](https://github.com/mavs07082022/library/blob/master/api/index.php) (API Router), [`api/auth.php`](https://github.com/mavs07082022/library/blob/master/api/auth.php) (Authentication API), [`api/send_email.php`](https://github.com/mavs07082022/library/blob/master/api/send_email.php) (Email Sender)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Web Experience"]
  node_homepage["Public Homepage<br/>[homepage.php]"]
  node_student_dashboard["Student Dashboard"]
  node_librarian_dashboard["Librarian Dashboard"]
  node_admin_dashboard["Admin Dashboard"]
  node_admin_reports["Admin Reports<br/>[admin_reports.php]"]
  node_admin_users["Admin User Management<br/>[admin_users.php]"]
  node_admin_settings["Admin Settings<br/>[admin_settings.php]"]
end

subgraph group_accounts["Accounts"]
  node_login["Sign-in UI<br/>[login.php]"]
  node_registration["Student Registration"]
  node_auth_api["Authentication API<br/>[auth.php]"]
end

subgraph group_library["Library Operations"]
  node_admin_api["Administration API<br/>[admin.php]"]
  node_books_api["Books API<br/>[books.php]"]
  node_members_api["Members API<br/>[members.php]"]
  node_borrowings_api["Borrowings API<br/>[borrowings.php]"]
  node_fines_api["Fines API<br/>[fines.php]"]
end

subgraph group_services["Search and Messaging"]
  node_search_api["Catalog Search<br/>[search.php]"]
  node_predict_api["Search Predictions<br/>[predict_search.php]"]
  node_classify_api["Book Classification<br/>[classify_book.php]"]
  node_track_search["Search Activity Tracking<br/>[track_search.php]"]
  node_notifications_api["Notifications<br/>[notifications.php]"]
  node_trigger_notifications["Notification Triggers"]
  node_send_notification["Notification Sender"]
  node_email_sender["Email Sender<br/>[send_email.php]"]
end

subgraph group_infrastructure["Shared Infrastructure"]
  node_api_router["API Router<br/>[index.php]"]
  node_email_config["Email Configuration<br/>[email_config.php]"]
  node_config["API and Data Helpers<br/>[config.php]"]
  node_fpdf["PDF Generation Library<br/>[fpdf.php]"]
  node_makefont["Font Conversion<br/>[makefont.php]"]
  node_ttf_parser["TrueType Font Parser<br/>[ttfparser.php]"]
end

node_visitor(("Library User"))
node_supabase[("Supabase")]
node_nlp_service["NLP Service"]
node_smtp["SMTP Service"]

node_visitor -->|"opens"| node_homepage
node_homepage -->|"links to"| node_login
node_visitor -.->|"requests API"| node_api_router
node_api_router -->|"loads"| node_config
node_api_router -->|"dispatches"| node_auth_api
node_api_router -->|"dispatches"| node_admin_api
node_api_router -->|"dispatches"| node_books_api
node_api_router -->|"dispatches"| node_members_api
node_api_router -->|"dispatches"| node_borrowings_api
node_auth_api -->|"uses"| node_config
node_auth_api -->|"loads"| node_email_sender
node_admin_api -->|"uses"| node_config
node_books_api -->|"uses"| node_config
node_members_api -->|"uses"| node_config
node_borrowings_api -->|"uses"| node_config
node_fines_api -->|"uses"| node_config
node_search_api -->|"uses"| node_config
node_search_api -->|"queries"| node_nlp_service
node_predict_api -->|"uses"| node_config
node_classify_api -->|"uses"| node_config
node_track_search -->|"uses"| node_config
node_notifications_api -->|"uses"| node_config
node_trigger_notifications -->|"uses"| node_config
node_send_notification -->|"uses"| node_config
node_email_sender -->|"loads"| node_email_config
node_email_sender -->|"sends mail"| node_smtp
node_config -->|"sends REST requests"| node_supabase
node_makefont -->|"uses"| node_ttf_parser

click node_homepage "https://github.com/mavs07082022/library/blob/master/frontend/src/homepage.php"
click node_login "https://github.com/mavs07082022/library/blob/master/frontend/src/login.php"
click node_registration "https://github.com/mavs07082022/library/blob/master/student_register.php"
click node_student_dashboard "https://github.com/mavs07082022/library/blob/master/frontend/src/students/student_dashboard.php"
click node_librarian_dashboard "https://github.com/mavs07082022/library/blob/master/frontend/src/librarian/librarian_dashboard.php"
click node_admin_dashboard "https://github.com/mavs07082022/library/blob/master/frontend/src/admin_dashboard.php"
click node_admin_reports "https://github.com/mavs07082022/library/blob/master/frontend/src/admin_reports.php"
click node_admin_users "https://github.com/mavs07082022/library/blob/master/frontend/src/admin_users.php"
click node_admin_settings "https://github.com/mavs07082022/library/blob/master/frontend/src/admin_settings.php"
click node_api_router "https://github.com/mavs07082022/library/blob/master/api/index.php"
click node_auth_api "https://github.com/mavs07082022/library/blob/master/api/auth.php"
click node_admin_api "https://github.com/mavs07082022/library/blob/master/api/admin.php"
click node_books_api "https://github.com/mavs07082022/library/blob/master/api/books.php"
click node_members_api "https://github.com/mavs07082022/library/blob/master/api/members.php"
click node_borrowings_api "https://github.com/mavs07082022/library/blob/master/api/borrowings.php"
click node_fines_api "https://github.com/mavs07082022/library/blob/master/api/fines.php"
click node_search_api "https://github.com/mavs07082022/library/blob/master/api/search.php"
click node_predict_api "https://github.com/mavs07082022/library/blob/master/api/predict_search.php"
click node_classify_api "https://github.com/mavs07082022/library/blob/master/api/classify_book.php"
click node_track_search "https://github.com/mavs07082022/library/blob/master/api/track_search.php"
click node_notifications_api "https://github.com/mavs07082022/library/blob/master/api/notifications.php"
click node_trigger_notifications "https://github.com/mavs07082022/library/blob/master/api/trigger_notifications.php"
click node_send_notification "https://github.com/mavs07082022/library/blob/master/api/send_notification.php"
click node_email_sender "https://github.com/mavs07082022/library/blob/master/api/send_email.php"
click node_email_config "https://github.com/mavs07082022/library/blob/master/api/email_config.php"
click node_config "https://github.com/mavs07082022/library/blob/master/api/config.php"
click node_fpdf "https://github.com/mavs07082022/library/blob/master/frontend/src/fpdf.php"
click node_makefont "https://github.com/mavs07082022/library/blob/master/frontend/src/makefont/makefont.php"
click node_ttf_parser "https://github.com/mavs07082022/library/blob/master/frontend/src/makefont/ttfparser.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_homepage,node_student_dashboard,node_librarian_dashboard,node_admin_dashboard,node_admin_reports,node_admin_users,node_admin_settings,node_visitor toneBlue
class node_login,node_registration,node_auth_api,node_supabase toneAmber
class node_admin_api,node_books_api,node_members_api,node_borrowings_api,node_fines_api toneMint
class node_search_api,node_predict_api,node_classify_api,node_track_search,node_notifications_api,node_trigger_notifications,node_send_notification,node_email_sender toneRose
class node_api_router,node_email_config,node_config,node_fpdf,node_makefont,node_ttf_parser,node_nlp_service,node_smtp toneIndigo
```

## Components

### Web Experience

- [Public Homepage](https://github.com/mavs07082022/library/blob/master/frontend/src/homepage.php): `frontend/src/homepage.php`
- [Student Dashboard](https://github.com/mavs07082022/library/blob/master/frontend/src/students/student_dashboard.php): `frontend/src/students/student_dashboard.php`
- [Librarian Dashboard](https://github.com/mavs07082022/library/blob/master/frontend/src/librarian/librarian_dashboard.php): `frontend/src/librarian/librarian_dashboard.php`
- [Admin Dashboard](https://github.com/mavs07082022/library/blob/master/frontend/src/admin_dashboard.php): `frontend/src/admin_dashboard.php`
- [Admin Reports](https://github.com/mavs07082022/library/blob/master/frontend/src/admin_reports.php): `frontend/src/admin_reports.php`
- [Admin User Management](https://github.com/mavs07082022/library/blob/master/frontend/src/admin_users.php): `frontend/src/admin_users.php`
- [Admin Settings](https://github.com/mavs07082022/library/blob/master/frontend/src/admin_settings.php): `frontend/src/admin_settings.php`

### Accounts

- [Sign-in UI](https://github.com/mavs07082022/library/blob/master/frontend/src/login.php): `frontend/src/login.php`
- [Student Registration](https://github.com/mavs07082022/library/blob/master/student_register.php): `student_register.php`
- [Authentication API](https://github.com/mavs07082022/library/blob/master/api/auth.php): `api/auth.php`

### Library Operations

- [Administration API](https://github.com/mavs07082022/library/blob/master/api/admin.php): `api/admin.php`
- [Books API](https://github.com/mavs07082022/library/blob/master/api/books.php): `api/books.php`
- [Members API](https://github.com/mavs07082022/library/blob/master/api/members.php): `api/members.php`
- [Borrowings API](https://github.com/mavs07082022/library/blob/master/api/borrowings.php): `api/borrowings.php`
- [Fines API](https://github.com/mavs07082022/library/blob/master/api/fines.php): `api/fines.php`

### Search and Messaging

- [Catalog Search](https://github.com/mavs07082022/library/blob/master/api/search.php): `api/search.php`
- [Search Predictions](https://github.com/mavs07082022/library/blob/master/api/predict_search.php): `api/predict_search.php`
- [Book Classification](https://github.com/mavs07082022/library/blob/master/api/classify_book.php): `api/classify_book.php`
- [Search Activity Tracking](https://github.com/mavs07082022/library/blob/master/api/track_search.php): `api/track_search.php`
- [Notifications](https://github.com/mavs07082022/library/blob/master/api/notifications.php): `api/notifications.php`
- [Notification Triggers](https://github.com/mavs07082022/library/blob/master/api/trigger_notifications.php): `api/trigger_notifications.php`
- [Notification Sender](https://github.com/mavs07082022/library/blob/master/api/send_notification.php): `api/send_notification.php`
- [Email Sender](https://github.com/mavs07082022/library/blob/master/api/send_email.php): `api/send_email.php`

### Shared Infrastructure

- [API Router](https://github.com/mavs07082022/library/blob/master/api/index.php): `api/index.php`
- [Email Configuration](https://github.com/mavs07082022/library/blob/master/api/email_config.php): `api/email_config.php`
- [API and Data Helpers](https://github.com/mavs07082022/library/blob/master/api/config.php): `api/config.php`
- [PDF Generation Library](https://github.com/mavs07082022/library/blob/master/frontend/src/fpdf.php): `frontend/src/fpdf.php`
- [Font Conversion](https://github.com/mavs07082022/library/blob/master/frontend/src/makefont/makefont.php): `frontend/src/makefont/makefont.php`
- [TrueType Font Parser](https://github.com/mavs07082022/library/blob/master/frontend/src/makefont/ttfparser.php): `frontend/src/makefont/ttfparser.php`

### Other components

- **Library User**
- **Supabase**
- **NLP Service**
- **SMTP Service**

## Connections

- Library User → Public Homepage: opens (evidence: `frontend/src/homepage.php`)
- Public Homepage → Sign-in UI: links to (evidence: `frontend/src/homepage.php`)
- Library User → API Router: requests API
- API Router → API and Data Helpers: loads (evidence: `api/index.php`)
- API Router → Authentication API: dispatches (evidence: `api/index.php`)
- API Router → Administration API: dispatches (evidence: `api/index.php`)
- API Router → Books API: dispatches (evidence: `api/index.php`)
- API Router → Members API: dispatches (evidence: `api/index.php`)
- API Router → Borrowings API: dispatches (evidence: `api/index.php`)
- Authentication API → API and Data Helpers: uses (evidence: `api/auth.php`)
- Authentication API → Email Sender: loads (evidence: `api/auth.php`)
- Administration API → API and Data Helpers: uses (evidence: `api/admin.php`)
- Books API → API and Data Helpers: uses (evidence: `api/books.php`)
- Members API → API and Data Helpers: uses (evidence: `api/members.php`)
- Borrowings API → API and Data Helpers: uses (evidence: `api/borrowings.php`)
- Fines API → API and Data Helpers: uses (evidence: `api/fines.php`)
- Catalog Search → API and Data Helpers: uses (evidence: `api/search.php`)
- Catalog Search → NLP Service: queries (evidence: `api/search.php`)
- Search Predictions → API and Data Helpers: uses (evidence: `api/predict_search.php`)
- Book Classification → API and Data Helpers: uses (evidence: `api/classify_book.php`)
- Search Activity Tracking → API and Data Helpers: uses (evidence: `api/track_search.php`)
- Notifications → API and Data Helpers: uses (evidence: `api/notifications.php`)
- Notification Triggers → API and Data Helpers: uses (evidence: `api/trigger_notifications.php`)
- Notification Sender → API and Data Helpers: uses (evidence: `api/send_notification.php`)
- Email Sender → Email Configuration: loads (evidence: `api/send_email.php`)
- Email Sender → SMTP Service: sends mail (evidence: `api/send_email.php`)
- API and Data Helpers → Supabase: sends REST requests (evidence: `api/config.php`)
- Font Conversion → TrueType Font Parser: uses (evidence: `frontend/src/makefont/makefont.php`)
