# thedevdojo/voyager architecture

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

- Interactive diagram: https://gitdiagram.com/thedevdojo/voyager
- Repository: https://github.com/thedevdojo/voyager

## Overview

##### Main Components

- Admin Panel (Central interface)
- BREAD System (Browse, Read, Edit, Add, Delete)
- Authentication System
- Media Manager
- Database Manager
- Menu Builder

b. Data Layer (Bottom):
- Database Migrations
- Models (User, Role, Permission, DataType, etc.)
- Schema Manager
- Database Types (MySQL, PostgreSQL, SQLite)

c. Interface Layer (Top):
- Views/Templates
- Form Fields
- Vue.js Components
- Asset Management

##### Key Relationships

- User Authentication → Admin Panel
- BREAD System → Database Manager
- Menu Builder → Frontend Navigation
- Media Manager → File Storage
- Database Manager → Schema Manager
- Form Fields → BREAD System

##### Component Details

Frontend Layer:
- Vue.js Components
- Bootstrap UI
- TinyMCE Editor
- Media Picker
- Custom Form Fields

Backend Layer:
- Controllers
- Models
- Middleware
- Events/Listeners
- Service Providers

Database Layer:
- Migrations
- Seeders
- Schema Management
- Multiple Database Support

##### Integration Points

Connections for:
- Laravel Framework Integration
- Database Connections
- File Storage Systems
- Authentication System

##### Security Layer

Highlight:
- Role-based Access Control
- Permissions System
- Admin Middleware
- Authentication Guards

##### Additional Elements

Include:
- Multilingual Support
- Settings Management
- Compass (Developer Tools)
- Event System

**┌─────────────────────────────────────────┐**
- Frontend Layer               │
- (Vue.js, Bootstrap, Admin Interface)   │
- ┤
- Business Layer               │
- (BREAD, Controllers, Services)         │
- ┤
- Data Access Layer            │
- (Models, Database, Schema Manager)     │
- ┤
- Storage Layer                │
- (File Storage, Media, Database)        │
- ┘

Key Design Principles to Emphasize:

##### Secure Authentication Flow

Remember to:
- Use clear, readable labels
- Maintain consistent styling
- Related components
- Security boundaries

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Frontend Layer"
        UI["Admin Interface"]
        VueComp["Vue.js Components"]:::vue
        FormFields["Form Fields"]:::form
        Assets["Asset Management"]
        TinyMCE["TinyMCE Editor"]
        MediaPicker["Media Picker"]
    end

    subgraph "Core Components"
        AdminPanel["Admin Panel"]:::admin
        BREAD["BREAD System"]:::bread
        Auth["Authentication System"]:::auth
        MediaMgr["Media Manager"]:::media
        DBMgr["Database Manager"]:::db
        MenuBuilder["Menu Builder"]:::menu
        Settings["Settings Management"]:::settings
        MultiLang["Multilingual Support"]:::lang
    end

    subgraph "Security Layer"
        RBAC["Role-based Access Control"]:::security
        Perms["Permissions System"]:::security
        AdminMW["Admin Middleware"]:::security
        AuthGuards["Authentication Guards"]:::security
    end

    subgraph "Data Layer"
        Models["Models"]:::data
        Migrations["Database Migrations"]:::data
        Schema["Schema Manager"]:::data
        DB[(Database)]:::storage
        Storage[("File Storage")]:::storage
    end

    %% Relationships
    UI --> AdminPanel
    VueComp --> UI
    FormFields --> BREAD
    Auth --> AdminPanel
    BREAD --> DBMgr
    MenuBuilder --> UI
    MediaMgr --> Storage
    DBMgr --> Schema
    Schema --> DB
    RBAC --> Auth
    Perms --> Auth
    AdminMW --> Auth
    Models --> DB
    Migrations --> Schema

    %% Click Events
    click AdminPanel "https://github.com/thedevdojo/voyager/blob/1.7/src/Http/Controllers/VoyagerController.php"
    click BREAD "https://github.com/thedevdojo/voyager/blob/1.7/src/Http/Controllers/VoyagerBreadController.php"
    click Auth "https://github.com/thedevdojo/voyager/blob/1.7/src/Http/Controllers/VoyagerAuthController.php"
    click MediaMgr "https://github.com/thedevdojo/voyager/blob/1.7/src/Http/Controllers/VoyagerMediaController.php"
    click DBMgr "https://github.com/thedevdojo/voyager/blob/1.7/src/Http/Controllers/VoyagerDatabaseController.php"
    click MenuBuilder "https://github.com/thedevdojo/voyager/blob/1.7/src/Http/Controllers/VoyagerMenuController.php"
    click FormFields "https://github.com/thedevdojo/voyager/tree/1.7/src/FormFields/"
    click VueComp "https://github.com/thedevdojo/voyager/tree/1.7/resources/assets/js/components/"
    click MultiLang "https://github.com/thedevdojo/voyager/blob/1.7/src/Translator.php"
    click Settings "https://github.com/thedevdojo/voyager/blob/1.7/src/Http/Controllers/VoyagerSettingsController.php"
    click RBAC "https://github.com/thedevdojo/voyager/blob/1.7/src/Models/Role.php"
    click Models "https://github.com/thedevdojo/voyager/tree/1.7/src/Models/"
    click Schema "https://github.com/thedevdojo/voyager/blob/1.7/src/Database/Schema/SchemaManager.php"
    click AdminMW "https://github.com/thedevdojo/voyager/blob/1.7/src/Http/Middleware/VoyagerAdminMiddleware.php"

    %% Styling
    classDef admin fill:#4a90e2
    classDef bread fill:#4a90e2
    classDef auth fill:#9b59b6
    classDef media fill:#4a90e2
    classDef db fill:#2ecc71
    classDef menu fill:#4a90e2
    classDef security fill:#9b59b6
    classDef data fill:#2ecc71
    classDef storage fill:#95a5a6
    classDef vue fill:#e67e22
    classDef form fill:#e67e22
    classDef settings fill:#4a90e2
    classDef lang fill:#4a90e2
```
