# trantienphat-65132670/nhom8_quanlythuviendhqghcm architecture

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

- Interactive diagram: https://gitdiagram.com/trantienphat-65132670/nhom8_quanlythuviendhqghcm
- Repository: https://github.com/trantienphat-65132670/nhom8_quanlythuviendhqghcm

## Overview

This is a Laravel library-management application. Readers browse the catalogue, then borrow or reserve books; staff manage inventory and borrowing decisions, while reader profiles, account administration, and library news provide parallel capabilities. The graph follows documented routes and sampled controller calls. Several listed controllers and route registrations were not excerpted, so their connections are shown only where route evidence is available; unsampled subsystems are represented by their exact controller paths.

Main entry points: [`routes/client.php`](https://github.com/trantienphat-65132670/nhom8_quanlythuviendhqghcm/blob/main/routes/client.php) (Reader routes), [`routes/admin.php`](https://github.com/trantienphat-65132670/nhom8_quanlythuviendhqghcm/blob/main/routes/admin.php) (Admin routes), [`app/Models/Book.php`](https://github.com/trantienphat-65132670/nhom8_quanlythuviendhqghcm/blob/main/app/Models/Book.php) (Book records), [`app/Models/Category.php`](https://github.com/trantienphat-65132670/nhom8_quanlythuviendhqghcm/blob/main/app/Models/Category.php) (Category records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Web entry and access"]
  node_http["Laravel web routes<br/>[web.php]"]
  node_client_routes["Reader routes<br/>[client.php]"]
  node_admin_routes["Admin routes<br/>[admin.php]"]
  node_auth_routes["Authentication routes<br/>[auth.php]"]
  node_middleware["Access middleware"]
end

subgraph group_catalog["Catalogue and inventory"]
  node_books_reader["Catalogue browsing"]
  node_book_admin["Book management<br/>[BookController.php]"]
  node_categories["Category management"]
  node_book_model[("Book records<br/>[Book.php]")]
  node_category_model[("Category records<br/>[Category.php]")]
end

subgraph group_circulation["Borrowing and reservations"]
  node_borrow_admin["Borrow administration"]
  node_borrow_reader["Reader borrowing"]
  node_reservations["Book reservations"]
  node_borrow_rules["Overdue synchronization<br/>[Controller.php]"]
  node_availability_mail["Availability email"]
end

subgraph group_accounts["Accounts and profiles"]
  node_auth["Sign-in and OTP<br/>[AuthController.php]"]
  node_admin_accounts["Account administration<br/>[UserController.php]"]
  node_profile["Reader profile"]
  node_user_model[("User records<br/>[User.php]")]
  node_otp_mail["OTP email<br/>[SendOTPMail.php]"]
end

subgraph group_news["Library news"]
  node_news_admin["News publishing"]
  node_news_views["News reading"]
end

node_reader(("Reader"))
node_staff(("Library staff"))

node_reader -->|"requests pages"| node_client_routes
node_staff -.->|"manages library"| node_admin_routes
node_http -.->|"loads routes"| node_client_routes
node_client_routes -->|"routes catalogue"| node_books_reader
node_client_routes -->|"routes borrowing"| node_borrow_reader
node_client_routes -->|"routes reservations"| node_reservations
node_client_routes -->|"routes profile"| node_profile
node_client_routes -->|"routes public news"| node_news_admin
node_admin_routes -->|"routes inventory"| node_book_admin
node_admin_routes -->|"routes categories"| node_categories
node_admin_routes -->|"routes borrowing admin"| node_borrow_admin
node_admin_routes -->|"routes accounts"| node_admin_accounts
node_admin_routes -->|"routes publishing"| node_news_admin
node_auth_routes -->|"routes sign-in"| node_auth
node_auth -->|"sends OTP"| node_otp_mail
node_auth -.->|"checks credentials"| node_user_model
node_middleware -->|"guards reader pages"| node_client_routes
node_books_reader -->|"queries books"| node_book_model
node_books_reader -->|"queries categories"| node_category_model
node_book_admin -->|"creates and updates"| node_book_model
node_book_admin -->|"loads categories"| node_category_model
node_category_model -->|"has many"| node_book_model
node_book_model -->|"belongs to"| node_category_model
node_borrow_admin -->|"synchronizes overdue"| node_borrow_rules
node_borrow_admin -->|"checks availability"| node_reservations
node_borrow_reader -.->|"uses shared rules"| node_borrow_rules
node_reservations -->|"sends availability"| node_availability_mail
node_availability_mail -->|"formats book data"| node_book_model
node_admin_accounts -->|"manages users"| node_user_model
node_profile -->|"updates profile"| node_user_model
node_news_admin -.->|"renders news"| node_news_views

click node_http "https://github.com/trantienphat-65132670/nhom8_quanlythuviendhqghcm/blob/main/routes/web.php"
click node_client_routes "https://github.com/trantienphat-65132670/nhom8_quanlythuviendhqghcm/blob/main/routes/client.php"
click node_admin_routes "https://github.com/trantienphat-65132670/nhom8_quanlythuviendhqghcm/blob/main/routes/admin.php"
click node_auth_routes "https://github.com/trantienphat-65132670/nhom8_quanlythuviendhqghcm/blob/main/routes/auth.php"
click node_auth "https://github.com/trantienphat-65132670/nhom8_quanlythuviendhqghcm/blob/main/app/Http/Controllers/AuthController.php"
click node_middleware "https://github.com/trantienphat-65132670/nhom8_quanlythuviendhqghcm/tree/main/app/Http/Middleware"
click node_books_reader "https://github.com/trantienphat-65132670/nhom8_quanlythuviendhqghcm/blob/main/app/Http/Controllers/ClientController.php"
click node_book_admin "https://github.com/trantienphat-65132670/nhom8_quanlythuviendhqghcm/blob/main/app/Http/Controllers/BookController.php"
click node_categories "https://github.com/trantienphat-65132670/nhom8_quanlythuviendhqghcm/blob/main/app/Http/Controllers/CategoryController.php"
click node_book_model "https://github.com/trantienphat-65132670/nhom8_quanlythuviendhqghcm/blob/main/app/Models/Book.php"
click node_category_model "https://github.com/trantienphat-65132670/nhom8_quanlythuviendhqghcm/blob/main/app/Models/Category.php"
click node_borrow_admin "https://github.com/trantienphat-65132670/nhom8_quanlythuviendhqghcm/blob/main/app/Http/Controllers/AdminController.php"
click node_borrow_reader "https://github.com/trantienphat-65132670/nhom8_quanlythuviendhqghcm/blob/main/app/Http/Controllers/BorrowController.php"
click node_reservations "https://github.com/trantienphat-65132670/nhom8_quanlythuviendhqghcm/blob/main/app/Http/Controllers/ReservationController.php"
click node_borrow_rules "https://github.com/trantienphat-65132670/nhom8_quanlythuviendhqghcm/blob/main/app/Http/Controllers/Controller.php"
click node_availability_mail "https://github.com/trantienphat-65132670/nhom8_quanlythuviendhqghcm/blob/main/app/Mail/BookAvailableMail.php"
click node_admin_accounts "https://github.com/trantienphat-65132670/nhom8_quanlythuviendhqghcm/blob/main/app/Http/Controllers/UserController.php"
click node_profile "https://github.com/trantienphat-65132670/nhom8_quanlythuviendhqghcm/blob/main/app/Http/Controllers/ProfileController.php"
click node_user_model "https://github.com/trantienphat-65132670/nhom8_quanlythuviendhqghcm/blob/main/app/Models/User.php"
click node_otp_mail "https://github.com/trantienphat-65132670/nhom8_quanlythuviendhqghcm/blob/main/app/Mail/SendOTPMail.php"
click node_news_admin "https://github.com/trantienphat-65132670/nhom8_quanlythuviendhqghcm/blob/main/app/Http/Controllers/NewsPostController.php"
click node_news_views "https://github.com/trantienphat-65132670/nhom8_quanlythuviendhqghcm/tree/main/resources/views/news"

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_http,node_client_routes,node_admin_routes,node_auth_routes,node_middleware toneBlue
class node_books_reader,node_book_admin,node_categories,node_book_model,node_category_model toneAmber
class node_borrow_admin,node_borrow_reader,node_reservations,node_borrow_rules,node_availability_mail toneMint
class node_auth,node_admin_accounts,node_profile,node_user_model,node_otp_mail toneRose
class node_news_admin,node_news_views,node_reader,node_staff toneIndigo
```

## Components

### Web entry and access

- [Laravel web routes](https://github.com/trantienphat-65132670/nhom8_quanlythuviendhqghcm/blob/main/routes/web.php): `routes/web.php`
- [Reader routes](https://github.com/trantienphat-65132670/nhom8_quanlythuviendhqghcm/blob/main/routes/client.php): `routes/client.php`
- [Admin routes](https://github.com/trantienphat-65132670/nhom8_quanlythuviendhqghcm/blob/main/routes/admin.php): `routes/admin.php`
- [Authentication routes](https://github.com/trantienphat-65132670/nhom8_quanlythuviendhqghcm/blob/main/routes/auth.php): `routes/auth.php`
- [Access middleware](https://github.com/trantienphat-65132670/nhom8_quanlythuviendhqghcm/tree/main/app/Http/Middleware): `app/Http/Middleware`

### Catalogue and inventory

- [Catalogue browsing](https://github.com/trantienphat-65132670/nhom8_quanlythuviendhqghcm/blob/main/app/Http/Controllers/ClientController.php): `app/Http/Controllers/ClientController.php`
- [Book management](https://github.com/trantienphat-65132670/nhom8_quanlythuviendhqghcm/blob/main/app/Http/Controllers/BookController.php): `app/Http/Controllers/BookController.php`
- [Category management](https://github.com/trantienphat-65132670/nhom8_quanlythuviendhqghcm/blob/main/app/Http/Controllers/CategoryController.php): `app/Http/Controllers/CategoryController.php`
- [Book records](https://github.com/trantienphat-65132670/nhom8_quanlythuviendhqghcm/blob/main/app/Models/Book.php): `app/Models/Book.php`
- [Category records](https://github.com/trantienphat-65132670/nhom8_quanlythuviendhqghcm/blob/main/app/Models/Category.php): `app/Models/Category.php`

### Borrowing and reservations

- [Borrow administration](https://github.com/trantienphat-65132670/nhom8_quanlythuviendhqghcm/blob/main/app/Http/Controllers/AdminController.php): `app/Http/Controllers/AdminController.php`
- [Reader borrowing](https://github.com/trantienphat-65132670/nhom8_quanlythuviendhqghcm/blob/main/app/Http/Controllers/BorrowController.php): `app/Http/Controllers/BorrowController.php`
- [Book reservations](https://github.com/trantienphat-65132670/nhom8_quanlythuviendhqghcm/blob/main/app/Http/Controllers/ReservationController.php): `app/Http/Controllers/ReservationController.php`
- [Overdue synchronization](https://github.com/trantienphat-65132670/nhom8_quanlythuviendhqghcm/blob/main/app/Http/Controllers/Controller.php): `app/Http/Controllers/Controller.php`
- [Availability email](https://github.com/trantienphat-65132670/nhom8_quanlythuviendhqghcm/blob/main/app/Mail/BookAvailableMail.php): `app/Mail/BookAvailableMail.php`

### Accounts and profiles

- [Sign-in and OTP](https://github.com/trantienphat-65132670/nhom8_quanlythuviendhqghcm/blob/main/app/Http/Controllers/AuthController.php): `app/Http/Controllers/AuthController.php`
- [Account administration](https://github.com/trantienphat-65132670/nhom8_quanlythuviendhqghcm/blob/main/app/Http/Controllers/UserController.php): `app/Http/Controllers/UserController.php`
- [Reader profile](https://github.com/trantienphat-65132670/nhom8_quanlythuviendhqghcm/blob/main/app/Http/Controllers/ProfileController.php): `app/Http/Controllers/ProfileController.php`
- [User records](https://github.com/trantienphat-65132670/nhom8_quanlythuviendhqghcm/blob/main/app/Models/User.php): `app/Models/User.php`
- [OTP email](https://github.com/trantienphat-65132670/nhom8_quanlythuviendhqghcm/blob/main/app/Mail/SendOTPMail.php): `app/Mail/SendOTPMail.php`

### Library news

- [News publishing](https://github.com/trantienphat-65132670/nhom8_quanlythuviendhqghcm/blob/main/app/Http/Controllers/NewsPostController.php): `app/Http/Controllers/NewsPostController.php`
- [News reading](https://github.com/trantienphat-65132670/nhom8_quanlythuviendhqghcm/tree/main/resources/views/news): `resources/views/news`

### Other components

- **Reader**
- **Library staff**

## Connections

- Reader → Reader routes: requests pages (evidence: `routes/client.php`)
- Library staff → Admin routes: manages library
- Laravel web routes → Reader routes: loads routes
- Reader routes → Catalogue browsing: routes catalogue (evidence: `routes/client.php`)
- Reader routes → Reader borrowing: routes borrowing (evidence: `routes/client.php`)
- Reader routes → Book reservations: routes reservations (evidence: `routes/client.php`)
- Reader routes → Reader profile: routes profile (evidence: `routes/client.php`)
- Reader routes → News publishing: routes public news (evidence: `routes/client.php`)
- Admin routes → Book management: routes inventory (evidence: `routes/admin.php`)
- Admin routes → Category management: routes categories (evidence: `routes/admin.php`)
- Admin routes → Borrow administration: routes borrowing admin (evidence: `routes/admin.php`)
- Admin routes → Account administration: routes accounts (evidence: `routes/admin.php`)
- Admin routes → News publishing: routes publishing (evidence: `routes/admin.php`)
- Authentication routes → Sign-in and OTP: routes sign-in (evidence: `routes/auth.php`)
- Sign-in and OTP → OTP email: sends OTP (evidence: `app/Http/Controllers/AuthController.php`)
- Sign-in and OTP → User records: checks credentials
- Access middleware → Reader routes: guards reader pages (evidence: `routes/client.php`)
- Catalogue browsing → Book records: queries books (evidence: `app/Http/Controllers/ClientController.php`)
- Catalogue browsing → Category records: queries categories (evidence: `app/Http/Controllers/ClientController.php`)
- Book management → Book records: creates and updates (evidence: `app/Http/Controllers/BookController.php`)
- Book management → Category records: loads categories (evidence: `app/Http/Controllers/BookController.php`)
- Category records → Book records: has many (evidence: `app/Models/Category.php`)
- Book records → Category records: belongs to (evidence: `app/Models/Book.php`)
- Borrow administration → Overdue synchronization: synchronizes overdue (evidence: `app/Http/Controllers/AdminController.php`)
- Borrow administration → Book reservations: checks availability (evidence: `app/Http/Controllers/AdminController.php`)
- Reader borrowing → Overdue synchronization: uses shared rules (evidence: `app/Http/Controllers/BorrowController.php`)
- Book reservations → Availability email: sends availability (evidence: `app/Http/Controllers/ReservationController.php`)
- Availability email → Book records: formats book data (evidence: `app/Mail/BookAvailableMail.php`)
- Account administration → User records: manages users (evidence: `app/Http/Controllers/UserController.php`)
- Reader profile → User records: updates profile (evidence: `app/Http/Controllers/ProfileController.php`)
- News publishing → News reading: renders news
