# guilhermmedev/sistema-biblioteca architecture

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

- Interactive diagram: https://gitdiagram.com/guilhermmedev/sistema-biblioteca
- Repository: https://github.com/guilhermmedev/sistema-biblioteca

## Overview

Lybris is a Laravel library-management web app for students and librarians. The main workflow is book discovery and catalog maintenance, followed by a student reservation, librarian approval into a loan, and return processing; scheduled commands also handle fines, blocking, and expired reservations. The graph focuses on those documented product capabilities and the sampled controller/model calls. The README documents Google Books lookup, but the shown code does not establish its backend or frontend wiring, so that integration is included without an asserted call edge.

Main entry points: [`routes/web.php`](https://github.com/guilhermmedev/sistema-biblioteca/blob/master/routes/web.php) (Web routes), [`app/Http/Controllers/BookController.php`](https://github.com/guilhermmedev/sistema-biblioteca/blob/master/app/Http/Controllers/BookController.php) (Catalog browsing), [`app/Http/Controllers/ReservationController.php`](https://github.com/guilhermmedev/sistema-biblioteca/blob/master/app/Http/Controllers/ReservationController.php) (Reservation handling), [`app/Models/Loan.php`](https://github.com/guilhermmedev/sistema-biblioteca/blob/master/app/Models/Loan.php) (Loan records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_routes["Web routes<br/>[web.php]"]
  node_catalog["Catalog browsing<br/>[BookController.php]"]
  node_catalog_views["Catalog views<br/>[home.blade.php]"]
  node_admin_views["Catalog admin views<br/>[create.blade.php]"]
  node_http_entry["Laravel HTTP entry<br/>[index.php]"]
end

subgraph group_operations["Library operations"]
  node_reservation["Reservation handling"]
  node_loan_ops["Loan handling"]
  node_admin_views_ops["Loan and request views<br/>[requests.blade.php]"]
end

subgraph group_identity["User access"]
  node_registration["Registration"]
  node_login["Login"]
  node_verification["Email verification"]
  node_access_middleware["Admin access"]
end

subgraph group_domain["Library records"]
  node_book_model[("Book records<br/>[Book.php]")]
  node_reservation_model[("Reservation records<br/>[Reservation.php]")]
  node_loan_model[("Loan records<br/>[Loan.php]")]
  node_user_model[("User records<br/>[User.php]")]
end

subgraph group_maintenance["Scheduled maintenance"]
  node_fine_job["Fine processing<br/>[ApplyFine.php]"]
  node_block_job["User blocking<br/>[BlockUsers.php]"]
  node_expiry_job["Reservation expiry"]
  node_command_schedule["Command schedule<br/>[console.php]"]
end

node_visitor(("Student or librarian"))
node_google_books{{"Google Books API"}}

node_visitor -->|"uses app"| node_http_entry
node_http_entry -->|"dispatches routes"| node_routes
node_routes -->|"routes requests"| node_catalog
node_routes -->|"routes requests"| node_reservation
node_routes -->|"routes requests"| node_loan_ops
node_catalog -->|"searches records"| node_book_model
node_catalog -->|"checks reservations"| node_reservation_model
node_catalog -->|"checks loans"| node_loan_model
node_catalog -->|"renders catalog"| node_catalog_views
node_catalog -->|"renders admin form"| node_admin_views
node_reservation -->|"updates availability"| node_book_model
node_reservation -->|"creates requests"| node_reservation_model
node_reservation -->|"creates approved loan"| node_loan_model
node_reservation -->|"uses user identity"| node_user_model
node_reservation -->|"renders requests"| node_admin_views_ops
node_loan_ops -->|"updates loan status"| node_loan_model
node_registration -->|"creates account"| node_user_model
node_routes -.->|"routes requests"| node_registration
node_routes -.->|"routes requests"| node_login
node_routes -.->|"routes requests"| node_verification
node_access_middleware -.->|"guards admin routes"| node_routes
node_command_schedule -->|"registers command"| node_fine_job
node_command_schedule -->|"registers command"| node_block_job
node_command_schedule -->|"registers command"| node_expiry_job
node_fine_job -->|"processes fines"| node_loan_model
node_expiry_job -->|"removes expired"| node_reservation_model
node_google_books -.->|"documents lookup capability"| node_admin_views

click node_routes "https://github.com/guilhermmedev/sistema-biblioteca/blob/master/routes/web.php"
click node_catalog "https://github.com/guilhermmedev/sistema-biblioteca/blob/master/app/Http/Controllers/BookController.php"
click node_catalog_views "https://github.com/guilhermmedev/sistema-biblioteca/blob/master/resources/views/home.blade.php"
click node_admin_views "https://github.com/guilhermmedev/sistema-biblioteca/blob/master/resources/views/admin/create.blade.php"
click node_registration "https://github.com/guilhermmedev/sistema-biblioteca/blob/master/app/Http/Controllers/Auth/RegisterController.php"
click node_login "https://github.com/guilhermmedev/sistema-biblioteca/blob/master/app/Http/Controllers/Auth/LoginController.php"
click node_verification "https://github.com/guilhermmedev/sistema-biblioteca/blob/master/app/Http/Controllers/Auth/VerificationController.php"
click node_access_middleware "https://github.com/guilhermmedev/sistema-biblioteca/blob/master/app/Http/Middleware/AdminMiddleWare.php"
click node_reservation "https://github.com/guilhermmedev/sistema-biblioteca/blob/master/app/Http/Controllers/ReservationController.php"
click node_loan_ops "https://github.com/guilhermmedev/sistema-biblioteca/blob/master/app/Http/Controllers/LoansController.php"
click node_admin_views_ops "https://github.com/guilhermmedev/sistema-biblioteca/blob/master/resources/views/admin/requests.blade.php"
click node_book_model "https://github.com/guilhermmedev/sistema-biblioteca/blob/master/app/Models/Book.php"
click node_reservation_model "https://github.com/guilhermmedev/sistema-biblioteca/blob/master/app/Models/Reservation.php"
click node_loan_model "https://github.com/guilhermmedev/sistema-biblioteca/blob/master/app/Models/Loan.php"
click node_user_model "https://github.com/guilhermmedev/sistema-biblioteca/blob/master/app/Models/User.php"
click node_fine_job "https://github.com/guilhermmedev/sistema-biblioteca/blob/master/app/Console/Commands/ApplyFine.php"
click node_block_job "https://github.com/guilhermmedev/sistema-biblioteca/blob/master/app/Console/Commands/BlockUsers.php"
click node_expiry_job "https://github.com/guilhermmedev/sistema-biblioteca/blob/master/app/Console/Commands/DeleteReserveExpired.php"
click node_command_schedule "https://github.com/guilhermmedev/sistema-biblioteca/blob/master/routes/console.php"
click node_http_entry "https://github.com/guilhermmedev/sistema-biblioteca/blob/master/public/index.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_routes,node_catalog,node_catalog_views,node_admin_views,node_http_entry toneBlue
class node_reservation,node_loan_ops,node_admin_views_ops toneAmber
class node_registration,node_login,node_verification,node_access_middleware,node_google_books toneMint
class node_book_model,node_reservation_model,node_loan_model,node_user_model toneRose
class node_fine_job,node_block_job,node_expiry_job,node_command_schedule,node_visitor toneIndigo
```

## Components

### Web experience

- [Web routes](https://github.com/guilhermmedev/sistema-biblioteca/blob/master/routes/web.php): `routes/web.php`
- [Catalog browsing](https://github.com/guilhermmedev/sistema-biblioteca/blob/master/app/Http/Controllers/BookController.php): `app/Http/Controllers/BookController.php`
- [Catalog views](https://github.com/guilhermmedev/sistema-biblioteca/blob/master/resources/views/home.blade.php): `resources/views/home.blade.php`
- [Catalog admin views](https://github.com/guilhermmedev/sistema-biblioteca/blob/master/resources/views/admin/create.blade.php): `resources/views/admin/create.blade.php`
- [Laravel HTTP entry](https://github.com/guilhermmedev/sistema-biblioteca/blob/master/public/index.php): `public/index.php`

### Library operations

- [Reservation handling](https://github.com/guilhermmedev/sistema-biblioteca/blob/master/app/Http/Controllers/ReservationController.php): `app/Http/Controllers/ReservationController.php`
- [Loan handling](https://github.com/guilhermmedev/sistema-biblioteca/blob/master/app/Http/Controllers/LoansController.php): `app/Http/Controllers/LoansController.php`
- [Loan and request views](https://github.com/guilhermmedev/sistema-biblioteca/blob/master/resources/views/admin/requests.blade.php): `resources/views/admin/requests.blade.php`

### User access

- [Registration](https://github.com/guilhermmedev/sistema-biblioteca/blob/master/app/Http/Controllers/Auth/RegisterController.php): `app/Http/Controllers/Auth/RegisterController.php`
- [Login](https://github.com/guilhermmedev/sistema-biblioteca/blob/master/app/Http/Controllers/Auth/LoginController.php): `app/Http/Controllers/Auth/LoginController.php`
- [Email verification](https://github.com/guilhermmedev/sistema-biblioteca/blob/master/app/Http/Controllers/Auth/VerificationController.php): `app/Http/Controllers/Auth/VerificationController.php`
- [Admin access](https://github.com/guilhermmedev/sistema-biblioteca/blob/master/app/Http/Middleware/AdminMiddleWare.php): `app/Http/Middleware/AdminMiddleWare.php`

### Library records

- [Book records](https://github.com/guilhermmedev/sistema-biblioteca/blob/master/app/Models/Book.php): `app/Models/Book.php`
- [Reservation records](https://github.com/guilhermmedev/sistema-biblioteca/blob/master/app/Models/Reservation.php): `app/Models/Reservation.php`
- [Loan records](https://github.com/guilhermmedev/sistema-biblioteca/blob/master/app/Models/Loan.php): `app/Models/Loan.php`
- [User records](https://github.com/guilhermmedev/sistema-biblioteca/blob/master/app/Models/User.php): `app/Models/User.php`

### Scheduled maintenance

- [Fine processing](https://github.com/guilhermmedev/sistema-biblioteca/blob/master/app/Console/Commands/ApplyFine.php): `app/Console/Commands/ApplyFine.php`
- [User blocking](https://github.com/guilhermmedev/sistema-biblioteca/blob/master/app/Console/Commands/BlockUsers.php): `app/Console/Commands/BlockUsers.php`
- [Reservation expiry](https://github.com/guilhermmedev/sistema-biblioteca/blob/master/app/Console/Commands/DeleteReserveExpired.php): `app/Console/Commands/DeleteReserveExpired.php`
- [Command schedule](https://github.com/guilhermmedev/sistema-biblioteca/blob/master/routes/console.php): `routes/console.php`

### Other components

- **Student or librarian**
- **Google Books API**

## Connections

- Student or librarian → Laravel HTTP entry: uses app
- Laravel HTTP entry → Web routes: dispatches routes
- Web routes → Catalog browsing: routes requests (evidence: `routes/web.php`)
- Web routes → Reservation handling: routes requests (evidence: `routes/web.php`)
- Web routes → Loan handling: routes requests (evidence: `routes/web.php`)
- Catalog browsing → Book records: searches records (evidence: `app/Http/Controllers/BookController.php`)
- Catalog browsing → Reservation records: checks reservations (evidence: `app/Http/Controllers/BookController.php`)
- Catalog browsing → Loan records: checks loans (evidence: `app/Http/Controllers/BookController.php`)
- Catalog browsing → Catalog views: renders catalog (evidence: `app/Http/Controllers/BookController.php`)
- Catalog browsing → Catalog admin views: renders admin form (evidence: `app/Http/Controllers/BookController.php`)
- Reservation handling → Book records: updates availability (evidence: `app/Http/Controllers/ReservationController.php`)
- Reservation handling → Reservation records: creates requests (evidence: `app/Http/Controllers/ReservationController.php`)
- Reservation handling → Loan records: creates approved loan (evidence: `app/Http/Controllers/ReservationController.php`)
- Reservation handling → User records: uses user identity (evidence: `app/Http/Controllers/ReservationController.php`)
- Reservation handling → Loan and request views: renders requests (evidence: `app/Http/Controllers/ReservationController.php`)
- Loan handling → Loan records: updates loan status (evidence: `app/Http/Controllers/LoansController.php`)
- Registration → User records: creates account (evidence: `app/Http/Controllers/Auth/RegisterController.php`)
- Web routes → Registration: routes requests
- Web routes → Login: routes requests
- Web routes → Email verification: routes requests
- Admin access → Web routes: guards admin routes
- Command schedule → Fine processing: registers command (evidence: `routes/console.php`)
- Command schedule → User blocking: registers command (evidence: `routes/console.php`)
- Command schedule → Reservation expiry: registers command (evidence: `routes/console.php`)
- Fine processing → Loan records: processes fines (evidence: `app/Console/Commands/ApplyFine.php`)
- Reservation expiry → Reservation records: removes expired (evidence: `app/Console/Commands/DeleteReserveExpired.php`)
- Google Books API → Catalog admin views: documents lookup capability
