# laravel/rust-framework architecture

> Architecture diagram of the GitHub repository laravel/rust-framework, 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-framework
- Repository: https://github.com/laravel/rust-framework

## Overview

Laravel for Rust is a full-stack web framework. Its principal workflow is an application serving a request through routing and middleware, into application handlers that validate input and use models/database services, then returning a response. Separate runtime branches provide authentication, sessions, storage, caching, jobs, workflows, scheduling, search, and real-time broadcasting. The excerpts and source index support selected internal calls; other feature links are shown as unverified where implementation wiring was not sampled.

Main entry points: [`src/foundation/mod.rs`](https://github.com/laravel/rust-framework/blob/0.x/src/foundation/mod.rs) (Application builder), [`crates/http/src/http/request.rs`](https://github.com/laravel/rust-framework/blob/0.x/crates/http/src/http/request.rs) (HTTP request), [`src/db/mod.rs`](https://github.com/laravel/rust-framework/blob/0.x/src/db/mod.rs) (Database and migrations), [`src/config.rs`](https://github.com/laravel/rust-framework/blob/0.x/src/config.rs) (Typed configuration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application runtime"]
  node_foundation["Application builder<br/>[mod.rs]"]
  node_container["Service container<br/>[mod.rs]"]
  node_config["Typed configuration<br/>[config.rs]"]
end

subgraph group_web["HTTP handling"]
  node_routing["Routing<br/>[routing.rs]"]
  node_middleware["Middleware pipeline<br/>[pipeline.rs]"]
  node_request["HTTP request<br/>[request.rs]"]
  node_validation["Request validation<br/>[mod.rs]"]
  node_auth["Authentication<br/>[mod.rs]"]
  node_session["Session handling<br/>[mod.rs]"]
  node_response["HTTP responses<br/>[mod.rs]"]
end

subgraph group_data["Data services"]
  node_models["Models and relations<br/>[mod.rs]"]
  node_database[("Database and migrations<br/>[mod.rs]")]
  node_cache["Cache and locks<br/>[repository.rs]"]
  node_storage["File storage<br/>[storage.rs]"]
end

subgraph group_async["Async capabilities"]
  node_queue["Job processing<br/>[queue.rs]"]
  node_workflow["Durable workflows<br/>[workflow.rs]"]
  node_scheduler["Task scheduling<br/>[task.rs]"]
end

subgraph group_integrations["Application features"]
  node_search["Search engines<br/>[engine.rs]"]
  node_broadcast["Event broadcasting<br/>[broadcast.rs]"]
  node_inertia["Inertia integration<br/>[inertia.rs]"]
end

node_developer(("Application developer"))

node_developer -->|"configures"| node_foundation
node_foundation -->|"registers services"| node_container
node_foundation -->|"configures"| node_config
node_foundation -->|"serves application"| node_routing
node_request -.->|"enters"| node_routing
node_routing -.->|"dispatches through"| node_middleware
node_middleware -->|"passes request"| node_request
node_request -.->|"validates input"| node_validation
node_request -.->|"checks identity"| node_auth
node_auth -.->|"uses session"| node_session
node_middleware -.->|"returns response"| node_response
node_validation -->|"checks records"| node_database
node_models -->|"queries rows"| node_database
node_config -.->|"selects drivers"| node_cache
node_config -->|"configures disks"| node_storage
node_queue -.->|"persists jobs"| node_database
node_workflow -.->|"stores workflow state"| node_database
node_scheduler -.->|"dispatches tasks"| node_queue
node_models -.->|"indexes models"| node_search
node_queue -.->|"broadcasts events"| node_broadcast
node_response -.->|"renders frontend"| node_inertia

click node_foundation "https://github.com/laravel/rust-framework/blob/0.x/src/foundation/mod.rs"
click node_container "https://github.com/laravel/rust-framework/blob/0.x/src/container/mod.rs"
click node_config "https://github.com/laravel/rust-framework/blob/0.x/src/config.rs"
click node_routing "https://github.com/laravel/rust-framework/blob/0.x/src/routing.rs"
click node_middleware "https://github.com/laravel/rust-framework/blob/0.x/crates/http/src/http/middleware/pipeline.rs"
click node_request "https://github.com/laravel/rust-framework/blob/0.x/crates/http/src/http/request.rs"
click node_validation "https://github.com/laravel/rust-framework/blob/0.x/src/validation/mod.rs"
click node_auth "https://github.com/laravel/rust-framework/blob/0.x/src/auth/mod.rs"
click node_session "https://github.com/laravel/rust-framework/blob/0.x/src/session/mod.rs"
click node_response "https://github.com/laravel/rust-framework/blob/0.x/crates/http/src/http/mod.rs"
click node_models "https://github.com/laravel/rust-framework/blob/0.x/src/model/mod.rs"
click node_database "https://github.com/laravel/rust-framework/blob/0.x/src/db/mod.rs"
click node_cache "https://github.com/laravel/rust-framework/blob/0.x/crates/cache/src/cache/repository.rs"
click node_storage "https://github.com/laravel/rust-framework/blob/0.x/crates/http/src/storage.rs"
click node_queue "https://github.com/laravel/rust-framework/blob/0.x/src/queue.rs"
click node_workflow "https://github.com/laravel/rust-framework/blob/0.x/crates/workflow/src/workflow.rs"
click node_scheduler "https://github.com/laravel/rust-framework/blob/0.x/src/task.rs"
click node_search "https://github.com/laravel/rust-framework/blob/0.x/crates/search/src/search/engine.rs"
click node_broadcast "https://github.com/laravel/rust-framework/blob/0.x/crates/events/src/broadcast.rs"
click node_inertia "https://github.com/laravel/rust-framework/blob/0.x/src/inertia.rs"

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_foundation,node_container,node_config toneBlue
class node_routing,node_middleware,node_request,node_validation,node_auth,node_session,node_response toneAmber
class node_models,node_database,node_cache,node_storage toneMint
class node_queue,node_workflow,node_scheduler toneRose
class node_search,node_broadcast,node_inertia,node_developer toneIndigo
```

## Components

### Application runtime

- [Application builder](https://github.com/laravel/rust-framework/blob/0.x/src/foundation/mod.rs): `src/foundation/mod.rs`
- [Service container](https://github.com/laravel/rust-framework/blob/0.x/src/container/mod.rs): `src/container/mod.rs`
- [Typed configuration](https://github.com/laravel/rust-framework/blob/0.x/src/config.rs): `src/config.rs`

### HTTP handling

- [Routing](https://github.com/laravel/rust-framework/blob/0.x/src/routing.rs): `src/routing.rs`
- [Middleware pipeline](https://github.com/laravel/rust-framework/blob/0.x/crates/http/src/http/middleware/pipeline.rs): `crates/http/src/http/middleware/pipeline.rs`
- [HTTP request](https://github.com/laravel/rust-framework/blob/0.x/crates/http/src/http/request.rs): `crates/http/src/http/request.rs`
- [Request validation](https://github.com/laravel/rust-framework/blob/0.x/src/validation/mod.rs): `src/validation/mod.rs`
- [Authentication](https://github.com/laravel/rust-framework/blob/0.x/src/auth/mod.rs): `src/auth/mod.rs`
- [Session handling](https://github.com/laravel/rust-framework/blob/0.x/src/session/mod.rs): `src/session/mod.rs`
- [HTTP responses](https://github.com/laravel/rust-framework/blob/0.x/crates/http/src/http/mod.rs): `crates/http/src/http/mod.rs`

### Data services

- [Models and relations](https://github.com/laravel/rust-framework/blob/0.x/src/model/mod.rs): `src/model/mod.rs`
- [Database and migrations](https://github.com/laravel/rust-framework/blob/0.x/src/db/mod.rs): `src/db/mod.rs`
- [Cache and locks](https://github.com/laravel/rust-framework/blob/0.x/crates/cache/src/cache/repository.rs): `crates/cache/src/cache/repository.rs`
- [File storage](https://github.com/laravel/rust-framework/blob/0.x/crates/http/src/storage.rs): `crates/http/src/storage.rs`

### Async capabilities

- [Job processing](https://github.com/laravel/rust-framework/blob/0.x/src/queue.rs): `src/queue.rs`
- [Durable workflows](https://github.com/laravel/rust-framework/blob/0.x/crates/workflow/src/workflow.rs): `crates/workflow/src/workflow.rs`
- [Task scheduling](https://github.com/laravel/rust-framework/blob/0.x/src/task.rs): `src/task.rs`

### Application features

- [Search engines](https://github.com/laravel/rust-framework/blob/0.x/crates/search/src/search/engine.rs): `crates/search/src/search/engine.rs`
- [Event broadcasting](https://github.com/laravel/rust-framework/blob/0.x/crates/events/src/broadcast.rs): `crates/events/src/broadcast.rs`
- [Inertia integration](https://github.com/laravel/rust-framework/blob/0.x/src/inertia.rs): `src/inertia.rs`

### Other components

- **Application developer**

## Connections

- Application developer → Application builder: configures (evidence: `src/foundation/mod.rs`)
- Application builder → Service container: registers services (evidence: `src/foundation/mod.rs`)
- Application builder → Typed configuration: configures (evidence: `src/foundation/mod.rs`)
- Application builder → Routing: serves application (evidence: `src/foundation/mod.rs`)
- HTTP request → Routing: enters
- Routing → Middleware pipeline: dispatches through
- Middleware pipeline → HTTP request: passes request (evidence: `crates/http/src/http/middleware/pipeline.rs`)
- HTTP request → Request validation: validates input
- HTTP request → Authentication: checks identity
- Authentication → Session handling: uses session
- Middleware pipeline → HTTP responses: returns response (evidence: `crates/http/src/http/middleware/pipeline.rs`)
- Request validation → Database and migrations: checks records (evidence: `src/validation/database.rs`)
- Models and relations → Database and migrations: queries rows (evidence: `src/model/mod.rs`)
- Typed configuration → Cache and locks: selects drivers
- Typed configuration → File storage: configures disks (evidence: `crates/http/src/storage.rs`)
- Job processing → Database and migrations: persists jobs
- Durable workflows → Database and migrations: stores workflow state
- Task scheduling → Job processing: dispatches tasks
- Models and relations → Search engines: indexes models
- Job processing → Event broadcasting: broadcasts events
- HTTP responses → Inertia integration: renders frontend
