# graziabaiamonte/inertia-blog architecture

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

- Interactive diagram: https://gitdiagram.com/graziabaiamonte/inertia-blog
- Repository: https://github.com/graziabaiamonte/inertia-blog

## Overview

1. **Overall shape**
   - This is a Laravel application with an Inertia.js + React + TypeScript frontend.
   - The backend owns routing, auth, persistence, authorization, and server-side page composition.
   - The frontend is a SPA-like UI rendered through Inertia pages, not a separate API-only client.

2. **Core request flow**
   - HTTP requests enter Laravel through `public/index.php`, then route definitions in `routes/web.php` and `routes/auth.php`.
   - Controllers in `app/Http/Controllers` handle domain actions and return Inertia responses or redirects.
   - `app/Http/Middleware/HandleInertiaRequests.php` and `SetLocale.php` are key cross-cutting layers that shape every request.

3. **Primary domain model**
   - The main business entities are `Post`, `Category`, `Tag`, `Comment`, and `User`.
   - Database migrations show a blog/content model with many-to-many post-tag relations and comment storage.
   - `app/Enums/PostStatus.php` indicates posts have a status lifecycle rather than being simple draft/published records.

4. **Content and publishing subsystem**
   - `BlogController` serves the public blog listing and post detail pages.
   - Admin-side `PostController`, `CategoryController`, and `TagController` manage content creation and taxonomy maintenance.
   - `CommentController` exists both for public comment submission and admin moderation, so comments are a first-class content stream.

5. **Administration boundary**
   - Admin controllers live under `app/Http/Controllers/Admin`, separating back-office workflows from public browsing.
   - Frontend admin pages are grouped under `resources/js/Pages/Admin/*`.
   - This boundary is reinforced by role/permission infrastructure and dedicated tests for authorization and admin login.

6. **Authentication and account management**
   - Standard Laravel auth controllers handle registration, login, password reset, password confirmation, and email verification.
   - `ProfileController` plus `resources/js/Pages/Profile/*` support user self-service profile and password updates.
   - `EmailVerification` tests and controllers show that verified-email gating is part of the access model.

7. **Authorization model**
   - Authorization is not just route-level auth; it is role/permission-based.
   - `config/permission.php`, `database/migrations/*permission_tables.php`, and enums like `RoleName` / `PermissionName` indicate a structured RBAC layer.
   - Seeders (`RolePermissionSeeder`) establish the default access model, likely including admin/editor-style distinctions.

8. **Frontend architecture**
   - The frontend is organized around Inertia pages in `resources/js/Pages`, shared layouts in `resources/js/Layouts`, and reusable UI controls in `resources/js/Components`.
   - `resources/js/app.tsx` and `resources/js/bootstrap.ts` bootstrap the client-side runtime.
   - The UI stack includes React, TypeScript, Vite, Tailwind CSS, and likely axios for client requests.

9. **Key reusable UI and interaction widgets**
   - Notable shared components include markdown editing, image upload, comment form/list, locale switching, pagination, and taxonomy selectors.
   - These components reflect the app’s main interaction patterns: content editing, media handling, multilingual UI, and comment-driven engagement.
   - `resources/views/app.blade.php` is the Inertia entry shell that mounts the React app.

10. **Localization**
   - The application is bilingual, with English and Italian translation files in `lang/en*` and `lang/it*`.
   - `SetLocale` middleware and `LocaleController` manage user-facing language selection.
   - The presence of translation-sync tooling and locale-switch tests suggests translation consistency is part of the app’s architecture, not an afterthought.

11. **Media and content formatting**
   - `MediaController`, `StoreMediaRequest`, `MediaCollection` enum, and `config/filesystems.php` show a dedicated media upload subsystem.
   - `app/Support/Markdown.php` plus a Markdown editor component indicate post/comment content uses markdown rendering or preprocessing.
   - Storage is split across Laravel’s filesystem abstractions, with public and private storage areas present in `storage/app`.

12. **Persistence and runtime infrastructure**
   - Data lives in a relational database via Eloquent models and migrations; factories and seeders support test and bootstrap data.
   - Standard Laravel infrastructure is present for cache, queues, sessions, logging, and mail, even if not all are central to the current feature set.
   - `compose.yaml` suggests containerized local development, likely including the app plus database and related services.

13. **Test architecture**
   - The tests are organized by “phase,” which maps to system capability areas: auth, model relationships, authorization, blog pages, comments, media, locale, and Inertia page rendering.
   - This structure suggests the repo’s architecture has been validated incrementally by subsystem, not only by unit tests.
   - The tests are a good guide to the boundaries between public blog, admin operations, localization, and access control.

14. **Important diagram boundaries**
   - A useful architecture diagram should separate: public blog, authenticated user/account flows, admin content management, and shared platform services.
   - Cross-cutting layers to show explicitly are locale handling, Inertia page assembly, RBAC, markdown/media support, and database-backed persistence.

Main entry points: [`routes/web.php`](https://github.com/graziabaiamonte/inertia-blog/blob/main/routes/web.php) (Routes), [`app/Http/Controllers/Admin`](https://github.com/graziabaiamonte/inertia-blog/tree/main/app/Http/Controllers/Admin) (Content admin), [`tests`](https://github.com/graziabaiamonte/inertia-blog/tree/main/tests) (Tests), [`app/Http/Controllers`](https://github.com/graziabaiamonte/inertia-blog/tree/main/app/Http/Controllers) (Auth & account)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_g_backend["Laravel backend"]
  node_n_public_entry["HTTP entry<br/>Laravel entrypoint<br/>[index.php]"]
  node_n_routes["Routes<br/>route map<br/>[web.php]"]
  node_n_auth_routes["Auth routes<br/>[auth.php]"]
  node_n_middleware["Middleware<br/>cross-cutting HTTP"]
  node_n_blog_controller["Blog<br/>public content controller<br/>[BlogController.php]"]
  node_n_content_admin["Content admin<br/>admin controllers"]
  node_n_auth_account["Auth & account<br/>auth controllers"]
  node_n_markdown["Markdown<br/>content formatting<br/>[Markdown.php]"]
end

subgraph group_g_frontend["Inertia frontend"]
  node_n_app_shell["App shell<br/>Inertia bootstrapping<br/>[app.tsx]"]
  node_n_layouts["Layouts"]
  node_n_pages["Pages"]
  node_n_components["UI components<br/>React components"]
end

subgraph group_g_data["Data & storage"]
  node_n_rbac["RBAC<br/>roles & permissions<br/>[permission.php]"]
  node_n_models[("Domain models<br/>Eloquent models")]
  node_n_migrations["Schema<br/>migrations"]
  node_n_seeders["Seed data<br/>seeders"]
  node_n_storage[("Filesystems<br/>storage config<br/>[filesystems.php]")]
  node_n_translations["Locale files<br/>i18n resources"]
end

subgraph group_g_test["Tests"]
  node_n_tests["Tests"]
end

node_n_public_entry -->|"boots web"| node_n_routes
node_n_public_entry -->|"boots auth"| node_n_auth_routes
node_n_routes -->|"passes through"| node_n_middleware
node_n_auth_routes -->|"dispatches to"| node_n_auth_account
node_n_routes -->|"serves blog"| node_n_blog_controller
node_n_routes -->|"serves admin"| node_n_content_admin
node_n_routes -->|"serves account"| node_n_auth_account
node_n_content_admin -->|"mutates"| node_n_models
node_n_blog_controller -->|"reads"| node_n_models
node_n_auth_account -->|"uses"| node_n_models
node_n_content_admin -->|"formats content"| node_n_markdown
node_n_content_admin -->|"uploads media"| node_n_storage
node_n_auth_account -->|"checks access"| node_n_rbac
node_n_rbac -->|"bootstraps"| node_n_seeders
node_n_models -->|"persisted by"| node_n_migrations
node_n_seeders -->|"fills schema"| node_n_migrations
node_n_middleware -->|"sets locale"| node_n_translations
node_n_app_shell -->|"mounts"| node_n_pages
node_n_app_shell -->|"wraps"| node_n_layouts
node_n_pages -->|"composes"| node_n_components
node_n_routes -->|"returns inertia"| node_n_app_shell
node_n_tests -.->|"verifies"| node_n_routes
node_n_tests -.->|"verifies"| node_n_content_admin
node_n_tests -.->|"verifies"| node_n_rbac
node_n_tests -.->|"verifies"| node_n_app_shell

click node_n_public_entry "https://github.com/graziabaiamonte/inertia-blog/blob/main/public/index.php"
click node_n_routes "https://github.com/graziabaiamonte/inertia-blog/blob/main/routes/web.php"
click node_n_auth_routes "https://github.com/graziabaiamonte/inertia-blog/blob/main/routes/auth.php"
click node_n_middleware "https://github.com/graziabaiamonte/inertia-blog/tree/main/app/Http/Middleware"
click node_n_blog_controller "https://github.com/graziabaiamonte/inertia-blog/blob/main/app/Http/Controllers/BlogController.php"
click node_n_content_admin "https://github.com/graziabaiamonte/inertia-blog/tree/main/app/Http/Controllers/Admin"
click node_n_auth_account "https://github.com/graziabaiamonte/inertia-blog/tree/main/app/Http/Controllers"
click node_n_markdown "https://github.com/graziabaiamonte/inertia-blog/blob/main/app/Support/Markdown.php"
click node_n_rbac "https://github.com/graziabaiamonte/inertia-blog/blob/main/config/permission.php"
click node_n_models "https://github.com/graziabaiamonte/inertia-blog/tree/main/app/Models"
click node_n_migrations "https://github.com/graziabaiamonte/inertia-blog/tree/main/database/migrations"
click node_n_seeders "https://github.com/graziabaiamonte/inertia-blog/tree/main/database/seeders"
click node_n_storage "https://github.com/graziabaiamonte/inertia-blog/blob/main/config/filesystems.php"
click node_n_translations "https://github.com/graziabaiamonte/inertia-blog/tree/main/lang"
click node_n_app_shell "https://github.com/graziabaiamonte/inertia-blog/blob/main/resources/js/app.tsx"
click node_n_layouts "https://github.com/graziabaiamonte/inertia-blog/tree/main/resources/js/Layouts"
click node_n_pages "https://github.com/graziabaiamonte/inertia-blog/tree/main/resources/js/Pages"
click node_n_components "https://github.com/graziabaiamonte/inertia-blog/tree/main/resources/js/Components"
click node_n_tests "https://github.com/graziabaiamonte/inertia-blog/tree/main/tests"

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_n_public_entry,node_n_routes,node_n_auth_routes,node_n_middleware,node_n_blog_controller,node_n_content_admin,node_n_auth_account,node_n_markdown toneBlue
class node_n_app_shell,node_n_layouts,node_n_pages,node_n_components toneAmber
class node_n_rbac,node_n_models,node_n_migrations,node_n_seeders,node_n_storage,node_n_translations toneMint
class node_n_tests toneRose
```

## Components

### Laravel backend

HTTP entry, controllers, middleware, auth, and domain logic.

- [HTTP entry](https://github.com/graziabaiamonte/inertia-blog/blob/main/public/index.php): Laravel entrypoint · Public web entry that boots the Laravel application. · `public/index.php`
- [Routes](https://github.com/graziabaiamonte/inertia-blog/blob/main/routes/web.php): route map · Main web and auth route definitions that dispatch requests into controllers. · `routes/web.php`
- [Auth routes](https://github.com/graziabaiamonte/inertia-blog/blob/main/routes/auth.php): auth routes · Authentication and verification route definitions. · `routes/auth.php`
- [Middleware](https://github.com/graziabaiamonte/inertia-blog/tree/main/app/Http/Middleware): cross-cutting HTTP · Request shaping layers for Inertia responses and locale selection. · `app/Http/Middleware`
- [Blog](https://github.com/graziabaiamonte/inertia-blog/blob/main/app/Http/Controllers/BlogController.php): public content controller · Public listing and post detail pages for the blog. · `app/Http/Controllers/BlogController.php`
- [Content admin](https://github.com/graziabaiamonte/inertia-blog/tree/main/app/Http/Controllers/Admin): admin controllers · Back-office controllers for posts, categories, tags, comments, and media. · `app/Http/Controllers/Admin`
- [Auth & account](https://github.com/graziabaiamonte/inertia-blog/tree/main/app/Http/Controllers): auth controllers · Registration, login, reset, verification, dashboard, profile, and locale actions. · `app/Http/Controllers`
- [Markdown](https://github.com/graziabaiamonte/inertia-blog/blob/main/app/Support/Markdown.php): content formatting · Shared markdown parsing/rendering support used by posts and comments. · `app/Support/Markdown.php`

### Inertia frontend

React/TypeScript pages, layouts, and shared UI used by the app shell.

- [App shell](https://github.com/graziabaiamonte/inertia-blog/blob/main/resources/js/app.tsx): Inertia bootstrapping · Client bootstrap and the Blade mount point for the Inertia application. · `resources/js/app.tsx`
- [Layouts](https://github.com/graziabaiamonte/inertia-blog/tree/main/resources/js/Layouts): React layouts · Shared authenticated, guest, and public page shells. · `resources/js/Layouts`
- [Pages](https://github.com/graziabaiamonte/inertia-blog/tree/main/resources/js/Pages): Inertia pages · Public, auth, profile, dashboard, and admin screens rendered by Inertia. · `resources/js/Pages`
- [UI components](https://github.com/graziabaiamonte/inertia-blog/tree/main/resources/js/Components): React components · Reusable controls for comments, markdown, media upload, pagination, locale switching, and navigation. · `resources/js/Components`

### Data & storage

Persistent models, migrations, seeders, filesystem, and translations.

- [RBAC](https://github.com/graziabaiamonte/inertia-blog/blob/main/config/permission.php): roles & permissions · Role and permission enums, config, migrations, and seeders that define access control. · `config/permission.php`
- [Domain models](https://github.com/graziabaiamonte/inertia-blog/tree/main/app/Models): Eloquent models · Core content and account entities: posts, categories, tags, comments, and users. · `app/Models`
- [Schema](https://github.com/graziabaiamonte/inertia-blog/tree/main/database/migrations): migrations · Database schema for users, RBAC tables, media, taxonomy, posts, and comments. · `database/migrations`
- [Seed data](https://github.com/graziabaiamonte/inertia-blog/tree/main/database/seeders): seeders · Bootstrap data for roles, permissions, and initial database state. · `database/seeders`
- [Filesystems](https://github.com/graziabaiamonte/inertia-blog/blob/main/config/filesystems.php): storage config · Public/private storage and media persistence through Laravel filesystem abstractions. · `config/filesystems.php`
- [Locale files](https://github.com/graziabaiamonte/inertia-blog/tree/main/lang): i18n resources · English and Italian translation catalogs plus locale-aware strings. · `lang`

### Tests

Feature and unit coverage organized by subsystem.

- [Tests](https://github.com/graziabaiamonte/inertia-blog/tree/main/tests): feature/unit tests · Subsystem-oriented feature and unit tests that validate auth, blog, admin, locale, media, and RBAC flows. · `tests`

## Connections

- HTTP entry → Routes: boots web · Incoming HTTP requests are routed through the Laravel web routes.
- HTTP entry → Auth routes: boots auth · Authentication and verification routes are registered during app startup.
- Routes → Middleware: passes through · Web requests are shaped by request middleware before reaching controllers.
- Auth routes → Auth & account: dispatches to · Auth-related routes invoke account and verification controllers.
- Routes → Blog: serves blog · Public content routes resolve to the blog controller.
- Routes → Content admin: serves admin · Content management routes resolve to admin controllers.
- Routes → Auth & account: serves account · Profile, dashboard, locale, and other user flows resolve here.
- Content admin → Domain models: mutates · Admin workflows create, update, and moderate content entities.
- Blog → Domain models: reads · Public blog pages query posts, tags, categories, and comments.
- Auth & account → Domain models: uses · Authentication, profile, and locale flows depend on the user model.
- Content admin → Markdown: formats content · Editor and content workflows use markdown handling for rich text.
- Content admin → Filesystems: uploads media · Admin media actions persist files through the filesystem layer.
- Auth & account → RBAC: checks access · Role and permission rules gate authenticated and administrative actions.
- RBAC → Seed data: bootstraps · Seeders establish the default role/permission model.
- Domain models → Schema: persisted by · Models are backed by relational schema definitions.
- Seed data → Schema: fills schema · Seed data assumes the RBAC and content tables created by migrations.
- Middleware → Locale files: sets locale · Locale middleware and language selection rely on translation resources.
- App shell → Pages: mounts · The Inertia shell loads page components into the browser runtime.
- App shell → Layouts: wraps · Layouts provide the shared page chrome for Inertia screens.
- Pages → UI components: composes · Pages reuse shared UI controls for forms, lists, uploads, and navigation.
- Routes → App shell: returns inertia · Controllers and routes render React pages through the Inertia entry shell.
- Tests → Routes: verifies · Feature tests cover route behavior and request flow.
- Tests → Content admin: verifies · Tests exercise admin content management and moderation boundaries.
- Tests → RBAC: verifies · Tests validate the role and permission model.
- Tests → App shell: verifies · Inertia page tests confirm client/server page composition.
