# herobrauni/my-idlers architecture

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

- Interactive diagram: https://gitdiagram.com/herobrauni/my-idlers
- Repository: https://github.com/herobrauni/my-idlers

## Overview

##### Main System Components

a) Frontend Layer:
- Web Interface (Built with Bootstrap 5.3)
- Public and authenticated views
- JavaScript/CSS assets
- Blade template components

b) Backend Layer:
- Laravel 11.x Framework
- PHP 8.3 Runtime
- Authentication System
- API Controllers
- Model Layer
- Service Providers

c) Database Layer:
- MySQL Database
- Migrations System
- Data Models

d) External Services:
- YABS Integration
- DNS Lookup Services
- Server Status Checking

##### Component Relationships

**[Web Browser] ←→ [Frontend Layer]**
- ↕
**[API Clients] ←→ [API Layer] ←→ [Controllers] ←→ [Models] ←→ [Database]**
- ↕             ↕
- [Auth System]   [Services]
- ↕
- [External Services]

##### Specific Implementation Details

a) Core Features:
- Server Management System
- YABS Integration
- Multi-currency Support
- Status Monitoring

b) Authentication Flow:
- Login/Register System
- API Token Authentication
- Session Management

c) Data Flow:
- CRUD Operations
- API Endpoints
- External Service Integration

##### Important Architectural Patterns

Patterns:
- MVC Architecture (Controllers, Models, Views)
- Repository Pattern for Data Access
- Service Layer for Business Logic
- API Resource Pattern
- Component-based Frontend

##### Key Technical Elements

Technical aspects:
- Laravel Routes (web.php, api.php)
- Middleware Stack
- Database Schema
- Cache System
- File Storage

##### Deployment Components

Deployment options:
- Docker Container Support
- Traditional Web Server
- PikaPods Managed Hosting

Remember to show the relationship between the core features like server management, YABS integration, and the various types of hosting services (VPS, Dedicated, Shared, etc.) that the system can track.

This system design should emphasize the scalability of the application and its ability to handle different types of hosting services while maintaining a clean separation of concerns between the various components.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        Browser["Web Browser"]:::client
        APIClient["API Clients"]:::client
    end

    subgraph Frontend
        WebUI["Web Interface"]:::frontend
        Assets["Assets (JS/CSS)"]:::frontend
        Templates["Blade Templates"]:::frontend
        Components["UI Components"]:::frontend
    end
    click Assets "https://github.com/herobrauni/my-idlers/tree/main/resources/css/*"
    click Templates "https://github.com/herobrauni/my-idlers/tree/main/resources/views/*"
    click Components "https://github.com/herobrauni/my-idlers/tree/main/resources/views/components/*"

    subgraph API
        APILayer["API Layer"]:::api
        AuthSystem["Authentication System"]:::auth
    end
    click APILayer "https://github.com/herobrauni/my-idlers/blob/main/routes/api.php"
    click AuthSystem "https://github.com/herobrauni/my-idlers/tree/main/app/Http/Controllers/Auth/*"

    subgraph Controllers
        MainController["Main Controllers"]:::controller
        YabsController["YABS Controller"]:::controller
        ServerController["Server Controller"]:::controller
        DNSController["DNS Controller"]:::controller
    end
    click YabsController "https://github.com/herobrauni/my-idlers/blob/main/app/Http/Controllers/YabsController.php"
    click ServerController "https://github.com/herobrauni/my-idlers/blob/main/app/Http/Controllers/ServerController.php"
    click DNSController "https://github.com/herobrauni/my-idlers/blob/main/app/Http/Controllers/DNSController.php"

    subgraph Models
        ServerModel["Server Model"]:::model
        UserModel["User Model"]:::model
        YabsModel["YABS Model"]:::model
        DNSModel["DNS Model"]:::model
        SettingsModel["Settings Model"]:::model
    end
    click ServerModel "https://github.com/herobrauni/my-idlers/blob/main/app/Models/Server.php"
    click UserModel "https://github.com/herobrauni/my-idlers/blob/main/app/Models/User.php"
    click YabsModel "https://github.com/herobrauni/my-idlers/blob/main/app/Models/Yabs.php"
    click DNSModel "https://github.com/herobrauni/my-idlers/blob/main/app/Models/DNS.php"
    click SettingsModel "https://github.com/herobrauni/my-idlers/blob/main/app/Models/Settings.php"

    subgraph Database
        MySQL[(MySQL Database)]:::database
        Migrations["Migrations"]:::database
        Seeders["Seeders"]:::database
    end
    click Migrations "https://github.com/herobrauni/my-idlers/tree/main/database/migrations/*"
    click Seeders "https://github.com/herobrauni/my-idlers/tree/main/database/seeders/*"

    subgraph ExternalServices
        YABS["YABS Service"]:::external
        DNSLookup["DNS Lookup"]:::external
        StatusCheck["Status Monitoring"]:::external
    end

    %% Relationships
    Browser --> WebUI
    APIClient --> APILayer
    WebUI --> APILayer
    Assets --> WebUI
    Templates --> WebUI
    Components --> Templates

    APILayer --> AuthSystem
    APILayer --> MainController
    AuthSystem --> MainController

    MainController --> ServerController
    MainController --> YabsController
    MainController --> DNSController

    ServerController --> ServerModel
    YabsController --> YabsModel
    DNSController --> DNSModel
    MainController --> SettingsModel
    AuthSystem --> UserModel

    ServerModel --> MySQL
    UserModel --> MySQL
    YabsModel --> MySQL
    DNSModel --> MySQL
    SettingsModel --> MySQL

    Migrations --> MySQL
    Seeders --> MySQL

    YabsController --> YABS
    DNSController --> DNSLookup
    ServerController --> StatusCheck

    %% Styles
    classDef client fill:#e9ecef,stroke:#343a40
    classDef frontend fill:#0d6efd,stroke:#0a58ca,color:#fff
    classDef api fill:#198754,stroke:#146c43,color:#fff
    classDef auth fill:#6610f2,stroke:#520dc2,color:#fff
    classDef controller fill:#ffc107,stroke:#cc9a06
    classDef model fill:#fd7e14,stroke:#ca6510
    classDef database fill:#6c757d,stroke:#565e64,color:#fff
    classDef external fill:#d63384,stroke:#ab296a,color:#fff
```
