# redgp0g/orbitadaterralaravel architecture

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

- Interactive diagram: https://gitdiagram.com/redgp0g/orbitadaterralaravel
- Repository: https://github.com/redgp0g/orbitadaterralaravel

## Overview

##### Main Components

a) Client Layer:
- Frontend components (represented in resources/views)
- Separation between public views (home) and dashboard views
- Livewire components for real-time interactions
- UI assets and static resources

b) Application Layer:
- HTTP Controllers (both web and API)
- Authentication system
- Mail system
- Middleware stack
- Livewire components

c) Data Layer:
- Database (showing main entities from Models directory)
- File storage system
- Cache system

##### Specific Implementation Details

**[Client Layer]**
- Public Interface
- Home Views
- Cards for Sale
- Simulation
- User Authentication
- Dashboard Interface
- Admin Views
- Company Management
- Sales History
- UI Components (Livewire)

**[Application Layer]**
- Web Controllers
- Dashboard Controller
- Home Controller
- User Controller
- API Controllers
- Registration Controller
- Card Controller
- Company Controller
- Authentication
- Mail System
- Password Recovery
- Email Verification
- Password Change
- Middleware Stack

**[Data Layer]**
- Database Models
- User
- Card
- Company
- Registration
- Access History
- Storage Systems
- File Storage
- Cache
- Sessions

##### Additional Elements

- Notes for important architectural decisions
- External service integrations (mail, etc.)
- Environment-specific configurations

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        UI["UI Components"]:::ui
        PublicInterface["Public Interface"]:::frontend
        DashboardInterface["Dashboard Interface"]:::frontend
        AuthViews["Authentication Views"]:::frontend
        StaticAssets["Static Assets"]:::static
        MailTemplates["Mail Templates"]:::ui
    end

    subgraph Application
        WebControllers["Web Controllers"]:::controller
        APIControllers["API Controllers"]:::controller
        LivewireComponents["Livewire Components"]:::livewire
        AuthSystem["Authentication System"]:::auth
        MiddlewareStack["Middleware Stack"]:::middleware
        
        subgraph MailSystem["Mail System"]
            PasswordRecovery["Password Recovery"]:::mail
            EmailVerification["Email Verification"]:::mail
            PasswordChange["Password Change"]:::mail
        end
    end

    subgraph Data
        subgraph Models["Database Models"]
            UserModel["User Model"]:::model
            CardModel["Card Model"]:::model
            CompanyModel["Company Model"]:::model
            RegistrationModel["Registration Model"]:::model
            AccessHistoryModel["Access History Model"]:::model
        end
        
        Storage["Storage Systems"]:::storage
        Cache["Cache"]:::storage
        Sessions["Sessions"]:::storage
    end

    %% Relationships
    PublicInterface --> WebControllers
    DashboardInterface --> WebControllers
    UI --> LivewireComponents
    AuthViews --> AuthSystem
    
    WebControllers --> Models
    APIControllers --> Models
    LivewireComponents --> Models
    
    AuthSystem --> UserModel
    MiddlewareStack --> AuthSystem
    
    MailSystem --> MailTemplates
    Models --> Storage

    %% Click Events
    click PublicInterface "https://github.com/redgp0g/OrbitaDaTerraLaravel/tree/main/resources/views/home/"
    click DashboardInterface "https://github.com/redgp0g/OrbitaDaTerraLaravel/tree/main/resources/views/dashboard/"
    click UI "https://github.com/redgp0g/OrbitaDaTerraLaravel/tree/main/resources/views/components/"
    click WebControllers "https://github.com/redgp0g/OrbitaDaTerraLaravel/tree/main/app/Http/Controllers/"
    click APIControllers "https://github.com/redgp0g/OrbitaDaTerraLaravel/tree/main/app/Http/Controllers/api/"
    click LivewireComponents "https://github.com/redgp0g/OrbitaDaTerraLaravel/tree/main/app/Http/Livewire/"
    click MiddlewareStack "https://github.com/redgp0g/OrbitaDaTerraLaravel/tree/main/app/Http/Middleware/"
    click PasswordRecovery "https://github.com/redgp0g/OrbitaDaTerraLaravel/blob/main/app/Mail/RecuperarSenha.php"
    click EmailVerification "https://github.com/redgp0g/OrbitaDaTerraLaravel/blob/main/app/Mail/VerificacaoEmail.php"
    click PasswordChange "https://github.com/redgp0g/OrbitaDaTerraLaravel/blob/main/app/Mail/SenhaAlterada.php"
    click UserModel "https://github.com/redgp0g/OrbitaDaTerraLaravel/blob/main/app/Models/User.php"
    click CardModel "https://github.com/redgp0g/OrbitaDaTerraLaravel/blob/main/app/Models/Carta.php"
    click CompanyModel "https://github.com/redgp0g/OrbitaDaTerraLaravel/blob/main/app/Models/Empresa.php"
    click RegistrationModel "https://github.com/redgp0g/OrbitaDaTerraLaravel/blob/main/app/Models/Cadastro.php"
    click AccessHistoryModel "https://github.com/redgp0g/OrbitaDaTerraLaravel/blob/main/app/Models/HistoricoAcesso.php"
    click Storage "https://github.com/redgp0g/OrbitaDaTerraLaravel/tree/main/storage/"
    click MailTemplates "https://github.com/redgp0g/OrbitaDaTerraLaravel/tree/main/resources/views/mails/"
    click AuthViews "https://github.com/redgp0g/OrbitaDaTerraLaravel/tree/main/resources/views/usuario/"
    click StaticAssets "https://github.com/redgp0g/OrbitaDaTerraLaravel/tree/main/ui-assets/"

    %% Styles
    classDef frontend fill:#3498db
    classDef controller fill:#2ecc71
    classDef model fill:#f1c40f
    classDef auth fill:#e74c3c
    classDef middleware fill:#9b59b6
    classDef storage fill:#95a5a6
    classDef mail fill:#1abc9c
    classDef ui fill:#34495e
    classDef static fill:#7f8c8d
    classDef livewire fill:#16a085

    %% Legend
    subgraph Legend
        Frontend["Frontend"]:::frontend
        Controller["Controllers"]:::controller
        ModelLegend["Models"]:::model
        AuthLegend["Authentication"]:::auth
        MiddlewareLegend["Middleware"]:::middleware
        StorageLegend["Storage"]:::storage
        MailLegend["Mail"]:::mail
        UILegend["UI Components"]:::ui
        StaticLegend["Static Assets"]:::static
        LivewireLegend["Livewire"]:::livewire
    end
```
