Kaynağa Gözat

Replace mermaid request flow with plain text chart

main
Daniel Covington 3 gün önce
ebeveyn
işleme
3e8c3b4b61
1 değiştirilmiş dosya ile 45 ekleme ve 26 silme
  1. +45
    -26
      docs/REQUEST_FLOW.md

+ 45
- 26
docs/REQUEST_FLOW.md Dosyayı Görüntüle

@@ -2,32 +2,51 @@

This chart shows how a browser request moves through the MindVisionCode framework and how a response is built and returned.

```mermaid
flowchart TD
A[Browser Request] --> B[public/index.php]
B --> C[autoload.php / vendor autoload]
B --> D[ensureSessionStarted()]
B --> E[Create App + Router]
B --> F[Load routes/web.php]
B --> G[Request::capture()]
G --> H[Dispatcher::dispatch()]
H --> I{Route matched?}
I -- No --> J[Response::notFound()]
I -- Yes --> K[Route::dispatch()]
K --> L[App::call()]
L --> M{Handler type}
M -- Controller method --> N[Controller action]
M -- Closure --> O[Route closure]
N --> P[Repository / ViewModel / Service calls]
P --> Q[Database::query() / execute()]
N --> R[view() / json() / redirect()]
O --> R
R --> S[Response object]
J --> S
H --> T[normalizeResponse()]
T --> S
S --> U[Response::send()]
U --> V[Browser receives HTML / JSON / redirect]
```text
Browser Request
|
v
public/index.php
|-- loads autoload.php / vendor autoload
|-- starts the session
|-- creates App + Router
|-- loads routes/web.php
|
v
Request::capture()
|
v
Dispatcher::dispatch()
|
+--> no route matched ----> Response::notFound()
|
+--> route matched -------> Route::dispatch()
|
v
App::call()
|
+--> controller method
| |
| v
| Controller action
| |
| +--> repository / service / view model
| +--> Database::query() / execute()
| +--> view() / json() / redirect()
|
+--> closure route
|
v
direct response data

Dispatcher::normalizeResponse()
|
+--> Response object --------> Response::send()
+--> array ------------------> Response::json() --> Response::send()
+--> string -----------------> Response::send()

Final result:
Browser receives HTML, JSON, or a redirect
```

## Response building paths


Yükleniyor…
İptal
Kaydet

Powered by TurnKey Linux.