# vasyukov1/marginalia architecture

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

- Interactive diagram: https://gitdiagram.com/vasyukov1/marginalia
- Repository: https://github.com/vasyukov1/marginalia

## Overview

This Laravel educational starter pack implements a book catalog and personal reading tracker, with account registration, login, profile management, and localized web pages. The main workflow is a visitor entering through web routes, browsing books or authors, then an authenticated user recording and reviewing reading activity and statistics. The graph includes the domain models as an internal layer. Controller and route excerpts support the shown calls; catalog, dashboard, and some authentication behavior is only represented where the source index or README establishes it.

Main entry points: [`routes/web.php`](https://github.com/vasyukov1/marginalia/blob/main/routes/web.php) (Web routes), [`app/Http/Controllers/ReadingController.php`](https://github.com/vasyukov1/marginalia/blob/main/app/Http/Controllers/ReadingController.php) (Reading entries), [`app/Models/Book.php`](https://github.com/vasyukov1/marginalia/blob/main/app/Models/Book.php) (Book model), [`app/Http/Controllers/AuthorController.php`](https://github.com/vasyukov1/marginalia/blob/main/app/Http/Controllers/AuthorController.php) (Author browsing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web and accounts"]
  node_routes["Web routes<br/>[web.php]"]
  node_authroutes["Auth routes<br/>[auth.php]"]
  node_registration["Registration"]
  node_sessions["Login sessions"]
  node_profile["Profile management"]
  node_locale["Locale middleware<br/>[SetLocale.php]"]
end

subgraph group_catalog["Book catalog"]
  node_catalogcontroller["Catalog browsing"]
  node_authors["Author browsing"]
  node_books["Book details<br/>[BookController.php]"]
  node_authorview["Author pages<br/>[index.blade.php]"]
end

subgraph group_reading["Reading tracker"]
  node_readingcontroller["Reading entries"]
  node_dashboard["Reading dashboard"]
  node_readingview["Reading form<br/>[create.blade.php]"]
end

subgraph group_domain["Domain and persistence"]
  node_author_model["Author model<br/>[Author.php]"]
  node_book_model["Book model<br/>[Book.php]"]
  node_reading_model["Reading model<br/>[Reading.php]"]
  node_user_model["User model<br/>[User.php]"]
  node_database[("SQLite database<br/>[database.php]")]
end

node_visitor(("Visitor"))

node_visitor -->|"requests pages"| node_routes
node_routes -->|"dispatches to"| node_catalogcontroller
node_routes -->|"dispatches to"| node_authors
node_routes -->|"dispatches to"| node_books
node_routes -->|"dispatches to"| node_readingcontroller
node_routes -->|"dispatches to"| node_dashboard
node_routes -->|"dispatches to"| node_profile
node_authroutes -->|"routes requests"| node_registration
node_authroutes -->|"routes requests"| node_sessions
node_registration -->|"creates account"| node_user_model
node_authors -->|"queries authors"| node_author_model
node_authors -->|"renders page"| node_authorview
node_readingcontroller -->|"records reading"| node_reading_model
node_readingcontroller -->|"queries books"| node_book_model
node_readingcontroller -->|"finds author"| node_author_model
node_readingcontroller -->|"renders form"| node_readingview
node_dashboard -->|"queries books"| node_book_model
node_profile -->|"updates account"| node_user_model
node_user_model -->|"relates readings"| node_reading_model
node_reading_model -->|"relates book"| node_book_model
node_book_model -->|"relates author"| node_author_model
node_book_model -.->|"persists records"| node_database

click node_routes "https://github.com/vasyukov1/marginalia/blob/main/routes/web.php"
click node_authroutes "https://github.com/vasyukov1/marginalia/blob/main/routes/auth.php"
click node_registration "https://github.com/vasyukov1/marginalia/blob/main/app/Http/Controllers/Auth/RegisteredUserController.php"
click node_sessions "https://github.com/vasyukov1/marginalia/blob/main/app/Http/Controllers/Auth/AuthenticatedSessionController.php"
click node_profile "https://github.com/vasyukov1/marginalia/blob/main/app/Http/Controllers/Userzone/ProfileController.php"
click node_locale "https://github.com/vasyukov1/marginalia/blob/main/app/Http/Middleware/SetLocale.php"
click node_catalogcontroller "https://github.com/vasyukov1/marginalia/blob/main/app/Http/Controllers/CatalogController.php"
click node_authors "https://github.com/vasyukov1/marginalia/blob/main/app/Http/Controllers/AuthorController.php"
click node_books "https://github.com/vasyukov1/marginalia/blob/main/app/Http/Controllers/BookController.php"
click node_readingcontroller "https://github.com/vasyukov1/marginalia/blob/main/app/Http/Controllers/ReadingController.php"
click node_dashboard "https://github.com/vasyukov1/marginalia/blob/main/app/Http/Controllers/Userzone/DashboardController.php"
click node_readingview "https://github.com/vasyukov1/marginalia/blob/main/resources/views/readings/create.blade.php"
click node_authorview "https://github.com/vasyukov1/marginalia/blob/main/resources/views/authors/index.blade.php"
click node_author_model "https://github.com/vasyukov1/marginalia/blob/main/app/Models/Author.php"
click node_book_model "https://github.com/vasyukov1/marginalia/blob/main/app/Models/Book.php"
click node_reading_model "https://github.com/vasyukov1/marginalia/blob/main/app/Models/Reading.php"
click node_user_model "https://github.com/vasyukov1/marginalia/blob/main/app/Models/User.php"
click node_database "https://github.com/vasyukov1/marginalia/blob/main/config/database.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_authroutes,node_registration,node_sessions,node_profile,node_locale toneBlue
class node_catalogcontroller,node_authors,node_books,node_authorview toneAmber
class node_readingcontroller,node_dashboard,node_readingview toneMint
class node_author_model,node_book_model,node_reading_model,node_user_model,node_database toneRose
class node_visitor toneIndigo
```

## Components

### Web and accounts

- [Web routes](https://github.com/vasyukov1/marginalia/blob/main/routes/web.php): `routes/web.php`
- [Auth routes](https://github.com/vasyukov1/marginalia/blob/main/routes/auth.php): `routes/auth.php`
- [Registration](https://github.com/vasyukov1/marginalia/blob/main/app/Http/Controllers/Auth/RegisteredUserController.php): `app/Http/Controllers/Auth/RegisteredUserController.php`
- [Login sessions](https://github.com/vasyukov1/marginalia/blob/main/app/Http/Controllers/Auth/AuthenticatedSessionController.php): `app/Http/Controllers/Auth/AuthenticatedSessionController.php`
- [Profile management](https://github.com/vasyukov1/marginalia/blob/main/app/Http/Controllers/Userzone/ProfileController.php): `app/Http/Controllers/Userzone/ProfileController.php`
- [Locale middleware](https://github.com/vasyukov1/marginalia/blob/main/app/Http/Middleware/SetLocale.php): `app/Http/Middleware/SetLocale.php`

### Book catalog

- [Catalog browsing](https://github.com/vasyukov1/marginalia/blob/main/app/Http/Controllers/CatalogController.php): `app/Http/Controllers/CatalogController.php`
- [Author browsing](https://github.com/vasyukov1/marginalia/blob/main/app/Http/Controllers/AuthorController.php): `app/Http/Controllers/AuthorController.php`
- [Book details](https://github.com/vasyukov1/marginalia/blob/main/app/Http/Controllers/BookController.php): `app/Http/Controllers/BookController.php`
- [Author pages](https://github.com/vasyukov1/marginalia/blob/main/resources/views/authors/index.blade.php): `resources/views/authors/index.blade.php`

### Reading tracker

- [Reading entries](https://github.com/vasyukov1/marginalia/blob/main/app/Http/Controllers/ReadingController.php): `app/Http/Controllers/ReadingController.php`
- [Reading dashboard](https://github.com/vasyukov1/marginalia/blob/main/app/Http/Controllers/Userzone/DashboardController.php): `app/Http/Controllers/Userzone/DashboardController.php`
- [Reading form](https://github.com/vasyukov1/marginalia/blob/main/resources/views/readings/create.blade.php): `resources/views/readings/create.blade.php`

### Domain and persistence

- [Author model](https://github.com/vasyukov1/marginalia/blob/main/app/Models/Author.php): `app/Models/Author.php`
- [Book model](https://github.com/vasyukov1/marginalia/blob/main/app/Models/Book.php): `app/Models/Book.php`
- [Reading model](https://github.com/vasyukov1/marginalia/blob/main/app/Models/Reading.php): `app/Models/Reading.php`
- [User model](https://github.com/vasyukov1/marginalia/blob/main/app/Models/User.php): `app/Models/User.php`
- [SQLite database](https://github.com/vasyukov1/marginalia/blob/main/config/database.php): `config/database.php`

### Other components

- **Visitor**

## Connections

- Visitor → Web routes: requests pages (evidence: `routes/web.php`)
- Web routes → Catalog browsing: dispatches to (evidence: `routes/web.php`)
- Web routes → Author browsing: dispatches to (evidence: `routes/web.php`)
- Web routes → Book details: dispatches to (evidence: `routes/web.php`)
- Web routes → Reading entries: dispatches to (evidence: `routes/web.php`)
- Web routes → Reading dashboard: dispatches to (evidence: `routes/web.php`)
- Web routes → Profile management: dispatches to (evidence: `routes/web.php`)
- Auth routes → Registration: routes requests (evidence: `routes/auth.php`)
- Auth routes → Login sessions: routes requests (evidence: `routes/auth.php`)
- Registration → User model: creates account (evidence: `app/Http/Controllers/Auth/RegisteredUserController.php`)
- Author browsing → Author model: queries authors (evidence: `app/Http/Controllers/AuthorController.php`)
- Author browsing → Author pages: renders page (evidence: `app/Http/Controllers/AuthorController.php`)
- Reading entries → Reading model: records reading (evidence: `app/Http/Controllers/ReadingController.php`)
- Reading entries → Book model: queries books (evidence: `app/Http/Controllers/ReadingController.php`)
- Reading entries → Author model: finds author (evidence: `app/Http/Controllers/ReadingController.php`)
- Reading entries → Reading form: renders form (evidence: `app/Http/Controllers/ReadingController.php`)
- Reading dashboard → Book model: queries books (evidence: `app/Http/Controllers/Userzone/DashboardController.php`)
- Profile management → User model: updates account (evidence: `app/Http/Controllers/Userzone/ProfileController.php`)
- User model → Reading model: relates readings (evidence: `app/Models/User.php`)
- Reading model → Book model: relates book (evidence: `app/Models/Reading.php`)
- Book model → Author model: relates author (evidence: `app/Models/Book.php`)
- Book model → SQLite database: persists records
