# laravel/rust architecture

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

- Interactive diagram: https://gitdiagram.com/laravel/rust
- Repository: https://github.com/laravel/rust

## Overview

This repository is a Laravel-for-Rust application starter: its visible runtime configures a Laravel application, routes web/API/channel traffic, and serves an Inertia welcome page with a WebGPU terrain effect. The README also documents broader framework capabilities—validation, sessions/cache, ORM/migrations, queues, tasks, workflows, and broadcasting—but their implementations are not present in the sampled app source, so those are shown as framework-provided capabilities rather than inferred internal call chains. Links involving unsampled behavior are omitted or marked unverified.

Main entry points: [`src/app.rs`](https://github.com/laravel/rust/blob/0.x/src/app.rs) (Application setup), [`src/routes/web.rs`](https://github.com/laravel/rust/blob/0.x/src/routes/web.rs) (Web routes), [`resources/js/pages/Welcome.tsx`](https://github.com/laravel/rust/blob/0.x/resources/js/pages/Welcome.tsx) (Welcome page), [`src/listeners/mod.rs`](https://github.com/laravel/rust/blob/0.x/src/listeners/mod.rs) (Event listeners)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Application runtime"]
  node_app["Application setup<br/>[app.rs]"]
  node_database_config["Database config<br/>[database.rs]"]
  node_console["Inspire command<br/>[inspire.rs]"]
end

subgraph group_http["HTTP and Inertia"]
  node_web_routes["Web routes<br/>[web.rs]"]
  node_api_routes["API routes<br/>[api.rs]"]
  node_channel_routes["Channel routes<br/>[channels.rs]"]
  node_welcome["Welcome handler<br/>[welcome.rs]"]
  node_inertia_middleware["Inertia middleware"]
end

subgraph group_frontend["Web experience"]
  node_frontend_entry["Inertia frontend<br/>[app.tsx]"]
  node_welcome_page["Welcome page<br/>[Welcome.tsx]"]
  node_terrain["Terrain renderer<br/>[terrain.ts]"]
end

subgraph group_domain["Models and events"]
  node_user_model["User model<br/>[user.rs]"]
  node_events["Example event<br/>[mod.rs]"]
  node_listeners["Event listeners<br/>[mod.rs]"]
  node_testing["Test support<br/>[testing.rs]"]
end

subgraph group_framework["Framework capabilities"]
  node_framework_features["Framework services"]
end

node_user(("Browser user"))

node_app -->|"registers"| node_web_routes
node_app -->|"registers"| node_api_routes
node_app -->|"registers"| node_channel_routes
node_app -->|"installs"| node_inertia_middleware
node_web_routes -->|"routes to"| node_welcome
node_user -.->|"requests"| node_web_routes
node_welcome_page -->|"uses"| node_terrain
node_user -.->|"views"| node_frontend_entry
node_app -->|"configures auth"| node_user_model
node_app -.->|"uses config"| node_database_config
node_listeners -->|"references"| node_events
node_app -.->|"framework provides"| node_framework_features

click node_app "https://github.com/laravel/rust/blob/0.x/src/app.rs"
click node_database_config "https://github.com/laravel/rust/blob/0.x/src/config/database.rs"
click node_console "https://github.com/laravel/rust/blob/0.x/src/console/inspire.rs"
click node_web_routes "https://github.com/laravel/rust/blob/0.x/src/routes/web.rs"
click node_api_routes "https://github.com/laravel/rust/blob/0.x/src/routes/api.rs"
click node_channel_routes "https://github.com/laravel/rust/blob/0.x/src/routes/channels.rs"
click node_welcome "https://github.com/laravel/rust/blob/0.x/src/http/handlers/welcome.rs"
click node_inertia_middleware "https://github.com/laravel/rust/blob/0.x/src/http/middleware/handle_inertia_requests.rs"
click node_frontend_entry "https://github.com/laravel/rust/blob/0.x/resources/js/app.tsx"
click node_welcome_page "https://github.com/laravel/rust/blob/0.x/resources/js/pages/Welcome.tsx"
click node_terrain "https://github.com/laravel/rust/blob/0.x/resources/js/welcome/terrain.ts"
click node_user_model "https://github.com/laravel/rust/blob/0.x/src/models/user.rs"
click node_events "https://github.com/laravel/rust/blob/0.x/src/events/mod.rs"
click node_listeners "https://github.com/laravel/rust/blob/0.x/src/listeners/mod.rs"
click node_testing "https://github.com/laravel/rust/blob/0.x/src/testing.rs"
click node_framework_features "https://github.com/laravel/rust/tree/0.x/src"

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_app,node_database_config,node_console,node_user toneBlue
class node_web_routes,node_api_routes,node_channel_routes,node_welcome,node_inertia_middleware toneAmber
class node_frontend_entry,node_welcome_page,node_terrain toneMint
class node_user_model,node_events,node_listeners,node_testing toneRose
class node_framework_features toneIndigo
```

## Components

### Application runtime

- [Application setup](https://github.com/laravel/rust/blob/0.x/src/app.rs): `src/app.rs`
- [Database config](https://github.com/laravel/rust/blob/0.x/src/config/database.rs): `src/config/database.rs`
- [Inspire command](https://github.com/laravel/rust/blob/0.x/src/console/inspire.rs): `src/console/inspire.rs`

### HTTP and Inertia

- [Web routes](https://github.com/laravel/rust/blob/0.x/src/routes/web.rs): `src/routes/web.rs`
- [API routes](https://github.com/laravel/rust/blob/0.x/src/routes/api.rs): `src/routes/api.rs`
- [Channel routes](https://github.com/laravel/rust/blob/0.x/src/routes/channels.rs): `src/routes/channels.rs`
- [Welcome handler](https://github.com/laravel/rust/blob/0.x/src/http/handlers/welcome.rs): `src/http/handlers/welcome.rs`
- [Inertia middleware](https://github.com/laravel/rust/blob/0.x/src/http/middleware/handle_inertia_requests.rs): `src/http/middleware/handle_inertia_requests.rs`

### Web experience

- [Inertia frontend](https://github.com/laravel/rust/blob/0.x/resources/js/app.tsx): `resources/js/app.tsx`
- [Welcome page](https://github.com/laravel/rust/blob/0.x/resources/js/pages/Welcome.tsx): `resources/js/pages/Welcome.tsx`
- [Terrain renderer](https://github.com/laravel/rust/blob/0.x/resources/js/welcome/terrain.ts): `resources/js/welcome/terrain.ts`

### Models and events

- [User model](https://github.com/laravel/rust/blob/0.x/src/models/user.rs): `src/models/user.rs`
- [Example event](https://github.com/laravel/rust/blob/0.x/src/events/mod.rs): `src/events/mod.rs`
- [Event listeners](https://github.com/laravel/rust/blob/0.x/src/listeners/mod.rs): `src/listeners/mod.rs`
- [Test support](https://github.com/laravel/rust/blob/0.x/src/testing.rs): `src/testing.rs`

### Framework capabilities

- [Framework services](https://github.com/laravel/rust/tree/0.x/src): `src`

### Other components

- **Browser user**

## Connections

- Application setup → Web routes: registers (evidence: `src/app.rs`)
- Application setup → API routes: registers (evidence: `src/app.rs`)
- Application setup → Channel routes: registers (evidence: `src/app.rs`)
- Application setup → Inertia middleware: installs (evidence: `src/app.rs`)
- Web routes → Welcome handler: routes to (evidence: `src/routes/web.rs`)
- Browser user → Web routes: requests
- Welcome page → Terrain renderer: uses (evidence: `resources/js/welcome/terrain.ts`)
- Browser user → Inertia frontend: views
- Application setup → User model: configures auth (evidence: `src/app.rs`)
- Application setup → Database config: uses config
- Event listeners → Example event: references (evidence: `src/listeners/mod.rs`)
- Application setup → Framework services: framework provides (evidence: `README.md`)
