# laravel/breeze architecture

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

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

## Overview

##### Main Components Structure

**┌─ Laravel Breeze Starter Kit ─────────────────────┐**

- ┌─ Stack Options ──┐    ┌─ Core Features ───┐   │
- Blade         │    │ - Authentication   │   │
- Inertia.js    │    │ - User Profile    │   │
- Vue.js      │    │ - Email           │   │
- React       │    │   Verification    │   │
- Livewire      │    └─────────────────────   │
- API           │                             │
- ┘                              │
- ┘

##### Implementation Layers

Architectural layers with clear separation:

**┌─ Frontend Layer ─────┐**
- Views/Components   │
- Assets (CSS/JS)    │
- Frontend Routing   │
- ┬──────────┘

**┌──────────▼──────────┐**
- Controller Layer     │
- Auth Controllers   │
- Profile Controller │
- ┬──────────┘

**┌──────────▼──────────┐**
- Service Layer        │
- Auth Services      │
- Password Reset     │
- ┬──────────┘

**┌──────────▼──────────┐**
- Database Layer      │
- User Model        │
- Migrations        │
- ┘

##### Stack-Specific Components

- Blade Stack (Blue)
- Inertia Stack (Green)
- Livewire Stack (Purple)
- API Stack (Orange)

##### Authentication Flow

**User Request → Route → Controller → Authentication → Response**

##### Implementation Details
Relationship between:
- Routes (auth.php, web.php)
- Controllers (Auth controllers)
- Views/Components
- Middleware
- Service Providers

##### Testing Integration
A section showing:
- Feature Tests
- Unit Tests
- Testing Utilities

- High-level architecture
- Implementation details
- Stack-specific variations
- Authentication flows
- Testing coverage

Use tools like:
- Lucidchart
- PlantUML

Remember to:
- Use consistent styling
- Clear labels
- Relationships between components
- Modular nature of the starter kit

This will provide a comprehensive view of Laravel Breeze's architecture while maintaining clarity and usefulness for the development team.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Laravel Breeze Starter Kit"
        subgraph "Stack Options"
            Blade["Blade Stack"]:::blade
            InertiaStack["Inertia.js Stack"]:::inertia
            LivewireStack["Livewire Stack"]:::livewire
            APIStack["API Stack"]:::api

            InertiaStack --> Vue["Vue.js"]:::vue
            InertiaStack --> React["React"]:::react
        end

        subgraph "Core Features"
            Auth["Authentication"]:::core
            Profile["User Profile"]:::core
            EmailVerif["Email Verification"]:::core
        end

        subgraph "Frontend Layer"
            Views["Views/Components"]:::frontend
            Assets["Assets (CSS/JS)"]:::frontend
            FrontendRouting["Frontend Routing"]:::frontend
        end

        subgraph "Controller Layer"
            AuthControllers["Auth Controllers"]:::controller
            ProfileController["Profile Controller"]:::controller
        end

        subgraph "Service Layer"
            AuthServices["Auth Services"]:::service
            PasswordReset["Password Reset"]:::service
            ServiceProvider["Service Provider"]:::service
        end

        subgraph "Database Layer"
            UserModel["User Model"]:::database
            Migrations["Migrations"]:::database
        end

        subgraph "Testing"
            FeatureTests["Feature Tests"]:::testing
            UnitTests["Unit Tests"]:::testing
        end
    end

    %% Relationships
    Views --> AuthControllers
    AuthControllers --> AuthServices
    AuthServices --> UserModel
    ProfileController --> UserModel
    Auth --> AuthControllers
    Profile --> ProfileController
    EmailVerif --> AuthServices

    %% Click Events
    click AuthControllers "https://github.com/laravel/breeze/tree/2.x/stubs/default/app/Http/Controllers/Auth"
    click ProfileController "https://github.com/laravel/breeze/blob/2.x/stubs/default/app/Http/Controllers/ProfileController.php"
    click Views "https://github.com/laravel/breeze/tree/2.x/stubs/default/resources/views"
    click Vue "https://github.com/laravel/breeze/tree/2.x/stubs/inertia-vue/resources/js"
    click React "https://github.com/laravel/breeze/tree/2.x/stubs/inertia-react/resources/js"
    click LivewireStack "https://github.com/laravel/breeze/tree/2.x/stubs/livewire/resources/views/livewire"
    click APIStack "https://github.com/laravel/breeze/tree/2.x/stubs/api/app/Http/Controllers"
    click FrontendRouting "https://github.com/laravel/breeze/blob/2.x/stubs/default/routes/auth.php"
    click Assets "https://github.com/laravel/breeze/tree/2.x/stubs/default/resources/css"
    click ServiceProvider "https://github.com/laravel/breeze/blob/2.x/src/BreezeServiceProvider.php"
    click FeatureTests "https://github.com/laravel/breeze/tree/2.x/stubs/default/tests/Feature/Auth"
    click UnitTests "https://github.com/laravel/breeze/blob/2.x/stubs/default/tests/Feature/ProfileTest.php"

    %% Styling
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef controller fill:#2ecc71,stroke:#27ae60,color:white
    classDef service fill:#e74c3c,stroke:#c0392b,color:white
    classDef database fill:#9b59b6,stroke:#8e44ad,color:white
    classDef core fill:#f1c40f,stroke:#f39c12,color:black
    classDef blade fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef inertia fill:#1abc9c,stroke:#16a085,color:white
    classDef livewire fill:#e67e22,stroke:#d35400,color:white
    classDef api fill:#34495e,stroke:#2c3e50,color:white
    classDef vue fill:#42b883,stroke:#35495e,color:white
    classDef react fill:#61dafb,stroke:#282c34,color:black
    classDef testing fill:#95a5a6,stroke:#7f8c8d,color:white
```
