# ametox/personalbookshelf architecture

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

- Interactive diagram: https://gitdiagram.com/ametox/personalbookshelf
- Repository: https://github.com/ametox/personalbookshelf

## Overview

PersonalBookshelf is a Laravel web app for finding books, viewing details, and organizing books into user-owned categories. The main workflow routes a search to the book controller, which queries Open Library, stores results in the session, and renders book views; signed-in users can manage categories and add or remove books. Registration and login support that personal shelf workflow. The source excerpts show controller, model, route, and view responsibilities; database links reflect Eloquent operations, while unsampled details are omitted.

Main entry points: [`BookShelf/app/Http/Controllers/BookController.php`](https://github.com/ametox/personalbookshelf/blob/main/BookShelf/app/Http/Controllers/BookController.php) (Book controller), [`BookShelf/app/Http/Controllers/UserController.php`](https://github.com/ametox/personalbookshelf/blob/main/BookShelf/app/Http/Controllers/UserController.php) (User controller), [`BookShelf/resources/js/app.js`](https://github.com/ametox/personalbookshelf/blob/main/BookShelf/resources/js/app.js) (Browser entry), [`BookShelf/routes/web.php`](https://github.com/ametox/personalbookshelf/blob/main/BookShelf/routes/web.php) (Web routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web routing"]
  node_routes["Web routes<br/>[web.php]"]
end

subgraph group_books["Book discovery"]
  node_bookctl["Book controller<br/>[BookController.php]"]
  node_bookmodel["Book model<br/>[Book.php]"]
  node_openlibrary["Open Library"]
  node_homeview["Search home<br/>[home.blade.php]"]
  node_detailview["Book detail"]
end

subgraph group_shelf["Personal shelves"]
  node_categorymodel["Category model<br/>[Category.php]"]
  node_shelfview["Shelf view"]
  node_categoryview["Category contents"]
  node_database[("Application database")]
end

subgraph group_accounts["Accounts"]
  node_userctl["User controller<br/>[UserController.php]"]
  node_usermodel["User model<br/>[User.php]"]
  node_authviews["Login and register<br/>[login.blade.php]"]
end

subgraph group_frontend["Browser interface"]
  node_jsentry["Browser entry<br/>[app.js]"]
  node_alpine["Alpine interface<br/>[alpineScript.js]"]
  node_browsercode["Interface code<br/>[code.js]"]
  node_bootstrapjs["JS bootstrap<br/>[bootstrap.js]"]
end

node_reader(("Reader"))

node_reader -->|"requests pages"| node_routes
node_routes -->|"dispatches book routes"| node_bookctl
node_routes -->|"dispatches account routes"| node_userctl
node_bookctl -->|"searches and fetches"| node_openlibrary
node_bookctl -->|"queries and saves"| node_bookmodel
node_bookctl -->|"manages categories"| node_categorymodel
node_bookctl -->|"reads and writes"| node_database
node_bookctl -->|"renders search"| node_homeview
node_bookctl -->|"renders details"| node_detailview
node_bookctl -->|"renders shelf"| node_shelfview
node_bookctl -->|"renders category"| node_categoryview
node_userctl -->|"creates users"| node_usermodel
node_userctl -->|"persists accounts"| node_database
node_userctl -->|"renders forms"| node_authviews
node_jsentry -->|"loads interface"| node_alpine
node_jsentry -->|"loads interface code"| node_browsercode
node_jsentry -->|"loads bootstrap"| node_bootstrapjs

click node_routes "https://github.com/ametox/personalbookshelf/blob/main/BookShelf/routes/web.php"
click node_bookctl "https://github.com/ametox/personalbookshelf/blob/main/BookShelf/app/Http/Controllers/BookController.php"
click node_bookmodel "https://github.com/ametox/personalbookshelf/blob/main/BookShelf/app/Models/Book.php"
click node_homeview "https://github.com/ametox/personalbookshelf/blob/main/BookShelf/resources/views/home.blade.php"
click node_detailview "https://github.com/ametox/personalbookshelf/blob/main/BookShelf/resources/views/displayBook.blade.php"
click node_userctl "https://github.com/ametox/personalbookshelf/blob/main/BookShelf/app/Http/Controllers/UserController.php"
click node_usermodel "https://github.com/ametox/personalbookshelf/blob/main/BookShelf/app/Models/User.php"
click node_authviews "https://github.com/ametox/personalbookshelf/blob/main/BookShelf/resources/views/login.blade.php"
click node_categorymodel "https://github.com/ametox/personalbookshelf/blob/main/BookShelf/app/Models/Category.php"
click node_shelfview "https://github.com/ametox/personalbookshelf/blob/main/BookShelf/resources/views/displayBookShelf.blade.php"
click node_categoryview "https://github.com/ametox/personalbookshelf/blob/main/BookShelf/resources/views/displayCategoryContent.blade.php"
click node_database "https://github.com/ametox/personalbookshelf/tree/main/BookShelf/database"
click node_jsentry "https://github.com/ametox/personalbookshelf/blob/main/BookShelf/resources/js/app.js"
click node_alpine "https://github.com/ametox/personalbookshelf/blob/main/BookShelf/resources/js/alpineScript.js"
click node_browsercode "https://github.com/ametox/personalbookshelf/blob/main/BookShelf/resources/js/code.js"
click node_bootstrapjs "https://github.com/ametox/personalbookshelf/blob/main/BookShelf/resources/js/bootstrap.js"

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 toneBlue
class node_bookctl,node_bookmodel,node_openlibrary,node_homeview,node_detailview toneAmber
class node_categorymodel,node_shelfview,node_categoryview,node_database toneMint
class node_userctl,node_usermodel,node_authviews toneRose
class node_jsentry,node_alpine,node_browsercode,node_bootstrapjs,node_reader toneIndigo
```

## Components

### Web routing

- [Web routes](https://github.com/ametox/personalbookshelf/blob/main/BookShelf/routes/web.php): `BookShelf/routes/web.php`

### Book discovery

- [Book controller](https://github.com/ametox/personalbookshelf/blob/main/BookShelf/app/Http/Controllers/BookController.php): `BookShelf/app/Http/Controllers/BookController.php`
- [Book model](https://github.com/ametox/personalbookshelf/blob/main/BookShelf/app/Models/Book.php): `BookShelf/app/Models/Book.php`
- **Open Library**
- [Search home](https://github.com/ametox/personalbookshelf/blob/main/BookShelf/resources/views/home.blade.php): `BookShelf/resources/views/home.blade.php`
- [Book detail](https://github.com/ametox/personalbookshelf/blob/main/BookShelf/resources/views/displayBook.blade.php): `BookShelf/resources/views/displayBook.blade.php`

### Personal shelves

- [Category model](https://github.com/ametox/personalbookshelf/blob/main/BookShelf/app/Models/Category.php): `BookShelf/app/Models/Category.php`
- [Shelf view](https://github.com/ametox/personalbookshelf/blob/main/BookShelf/resources/views/displayBookShelf.blade.php): `BookShelf/resources/views/displayBookShelf.blade.php`
- [Category contents](https://github.com/ametox/personalbookshelf/blob/main/BookShelf/resources/views/displayCategoryContent.blade.php): `BookShelf/resources/views/displayCategoryContent.blade.php`
- [Application database](https://github.com/ametox/personalbookshelf/tree/main/BookShelf/database): `BookShelf/database`

### Accounts

- [User controller](https://github.com/ametox/personalbookshelf/blob/main/BookShelf/app/Http/Controllers/UserController.php): `BookShelf/app/Http/Controllers/UserController.php`
- [User model](https://github.com/ametox/personalbookshelf/blob/main/BookShelf/app/Models/User.php): `BookShelf/app/Models/User.php`
- [Login and register](https://github.com/ametox/personalbookshelf/blob/main/BookShelf/resources/views/login.blade.php): `BookShelf/resources/views/login.blade.php`

### Browser interface

- [Browser entry](https://github.com/ametox/personalbookshelf/blob/main/BookShelf/resources/js/app.js): `BookShelf/resources/js/app.js`
- [Alpine interface](https://github.com/ametox/personalbookshelf/blob/main/BookShelf/resources/js/alpineScript.js): `BookShelf/resources/js/alpineScript.js`
- [Interface code](https://github.com/ametox/personalbookshelf/blob/main/BookShelf/resources/js/code.js): `BookShelf/resources/js/code.js`
- [JS bootstrap](https://github.com/ametox/personalbookshelf/blob/main/BookShelf/resources/js/bootstrap.js): `BookShelf/resources/js/bootstrap.js`

### Other components

- **Reader**

## Connections

- Reader → Web routes: requests pages (evidence: `BookShelf/routes/web.php`)
- Web routes → Book controller: dispatches book routes (evidence: `BookShelf/routes/web.php`)
- Web routes → User controller: dispatches account routes (evidence: `BookShelf/routes/web.php`)
- Book controller → Open Library: searches and fetches (evidence: `BookShelf/app/Http/Controllers/BookController.php`)
- Book controller → Book model: queries and saves (evidence: `BookShelf/app/Http/Controllers/BookController.php`)
- Book controller → Category model: manages categories (evidence: `BookShelf/app/Http/Controllers/BookController.php`)
- Book controller → Application database: reads and writes (evidence: `BookShelf/app/Http/Controllers/BookController.php`)
- Book controller → Search home: renders search (evidence: `BookShelf/app/Http/Controllers/BookController.php`)
- Book controller → Book detail: renders details (evidence: `BookShelf/app/Http/Controllers/BookController.php`)
- Book controller → Shelf view: renders shelf (evidence: `BookShelf/app/Http/Controllers/BookController.php`)
- Book controller → Category contents: renders category (evidence: `BookShelf/app/Http/Controllers/BookController.php`)
- User controller → User model: creates users (evidence: `BookShelf/app/Http/Controllers/UserController.php`)
- User controller → Application database: persists accounts (evidence: `BookShelf/app/Http/Controllers/UserController.php`)
- User controller → Login and register: renders forms (evidence: `BookShelf/app/Http/Controllers/UserController.php`)
- Browser entry → Alpine interface: loads interface (evidence: `BookShelf/resources/js/app.js`)
- Browser entry → Interface code: loads interface code (evidence: `BookShelf/resources/js/app.js`)
- Browser entry → JS bootstrap: loads bootstrap (evidence: `BookShelf/resources/js/app.js`)
