How inertiajs/inertia-laravel works
Main Components
a) Core Components:
• Inertia Middleware Layer
• Response Handler
• SSR (Server-Side Rendering) System
• Props Management System
• Testing Infrastructure
b) Integration Points:
• Laravel Application
• Frontend Framework (Vue.js, React, or Svelte)
• Server-Side Rendering Node.js Server
┌─────────────────────────────────────────────────────────┐
• Client (Browser) │
• ┬─────────────────────────────┘
• ↕
┌─────────────────────────────────────────────────────────┐
• Inertia Middleware │
• ┬─────────────────┬────────────────────┤
• Props System │ Response Handler │ SSR System │
• AlwaysProp │ - Response │ - Gateway │
• DeferProp │ - Controller │ - BundleDetector │
• LazyProp │ │ - HttpGateway │
• MergeProp │ │ │
• ┴─────────────────┴────────────────────┘
• ↕
┌─────────────────────────────────────────────────────────┐
• Laravel Application │
• ┘
Important Elements to Highlight
a) Middleware Flow:
• How requests flow through the Inertia middleware
• Where props are processed and transformed
• Demonstrate SSR decision points
b) Props System:
• Different types of props (Always, Defer, Lazy, Merge)
• How props are processed and passed to the frontend
c) SSR Architecture:
• Node.js SSR server
• Communication between Laravel and the SSR server
• BundleDetector's role
Implementation Details
Use standardized UML or C4 model notation:
• Diamonds for composition relationships
• Middleware-centric nature of the system
• Clear boundaries between Inertia, Laravel, and the frontend
• SSR system's architecture as it's a complex subsystem
• Testing infrastructure as it's a significant part of the codebase