diff --git a/docs/latest/concepts/architecture.md b/docs/latest/concepts/architecture.md index c3f7ccc3..1714ccb6 100644 --- a/docs/latest/concepts/architecture.md +++ b/docs/latest/concepts/architecture.md @@ -9,91 +9,7 @@ browser. This page explains how a request flows through the framework. ## Request lifecycle -
- - -
-
Browser Request
-
-
↓
- -
-
Static Files
-
Serve file directly if path matches a static asset
-
-
no match
-
↓
- -
-
Global Middlewareruns in registration order
-
Can modify request/response, set state, or short‑circuit with a Response
-
-
↓
- -
-
Router
-
Match URL pattern + HTTP method. Static routes checked first, then dynamic.
-
-
↓
- -
-
Scoped Middleware
-
Middleware that only runs for matching path prefixes (e.g. /admin/*). Used for auth, logging, or other route‑specific logic.
-
-
↓
- -
-
Handler
-
API route? Return Response directly (JSON, redirect, etc.)
-
-
has component
-
↓
- -
Rendering
- -
-
App Wrapper
-
Outer <html>/<head>/<body> structure
-
-
↓
- -
-
Layouts
-
Nested layout components (inherited from parent directories)
-
-
↓
- -
-
Page Component
-
Route component receives props.data from handler
-
-
↓
- -
-
HTML + JS Responsesent to browser
-
Server‑rendered HTML with island props serialized inline
-
- -
Client (Browser)
-
↓
- -
-
Island Hydrationonly islands receive JS
-
Rest of the page stays static HTML. No JavaScript for non‑island components.
-
-
+![Request lifecycle flow diagram](/docs/architecture-flow-v2.svg) ## Key concepts diff --git a/www/static/docs/architecture-flow-v2.svg b/www/static/docs/architecture-flow-v2.svg new file mode 100644 index 00000000..ffae1a88 --- /dev/null +++ b/www/static/docs/architecture-flow-v2.svg @@ -0,0 +1,108 @@ + + + + + + Browser Request + + ↓ + + + + Static Files + Serve file directly if path matches a static asset + + no match + ↓ + + + + Global Middleware + runs in registration order + Can modify request/response, set state, + or short-circuit with a Response + + ↓ + + + + Router + Match URL pattern + HTTP method. + Static routes checked first, then dynamic. + + ↓ + + + + Scoped Middleware + Middleware that only runs for matching path + prefixes (e.g. /admin/*). Used for auth, logging, + or other route-specific logic. + + ↓ + + + + Handler + API route? Return Response directly (JSON, redirect, etc.) + + has component + ↓ + + + + RENDERING + + + + App Wrapper + <html>/<head>/<body> structure + + ↓ + + + + Layouts + Nested layout components (inherited from parent directories) + + ↓ + + + + Page Component + Route component receives props.data from handler + + ↓ + + + + HTML + JS Response + sent to browser + Server-rendered HTML with island props + serialized inline + + + + CLIENT (BROWSER) + + ↓ + + + + Island Hydration + only islands receive JS + Rest of the page stays static HTML. + No JavaScript for non-island components. +