# sylar-db-cloner/sylar architecture

> Architecture diagram of the GitHub repository sylar-db-cloner/sylar, 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/sylar-db-cloner/sylar
- Repository: https://github.com/sylar-db-cloner/sylar

## Overview

##### Main Components Identification

a. Core Services:
- Service Cloner Core
- Docker Infrastructure
- ZFS Filesystem Service
- Messenger System
- GraphQL API Layer
- Authentication/Security Layer

b. Supporting Infrastructure:
- Grafana (Monitoring)
- Prometheus (Metrics)
- Loki (Logging)
- Mercure (Real-time updates)
- MySQL (Database)

- Frontend Layer                                         |

- Services View |  |  System View   |  | Messenger View|  |Reservations View|        |

- API Layer                                              |

- GraphQL API   |  |  REST Endpoints|  |   Mercure Hub  |                           |

- Core Services                                          |

- Service Cloner  |  |Docker Service  |  |ZFS Filesystem |  |    Messenger   |        |

- Infrastructure                                           |

- Grafana     |  |   Prometheus   |  |     Loki      |  |     MySQL      |        |

##### Component Relationships

- Frontend components → GraphQL API
- GraphQL API → Core Services
- Core Services → Infrastructure
- Monitoring flow: Services → Prometheus → Grafana
- Logging flow: Services → Loki → Grafana
- Real-time updates: Services → Mercure → Frontend

##### Additional Elements

Important aspects:
- Security layer spanning across API and Core Services
- ZFS storage pool connection to filesystem service
- Docker container management flow
- Message queue flow for async operations
- Monitoring and logging pipelines

##### Technical Details

- Docker container orchestration
- ZFS filesystem management
- Message queue system
- Real-time updates via Mercure
- Monitoring and logging infrastructure
- Authentication and authorization flow

Remember to use standardized UML or similar notation for consistency and clarity, and consider creating separate detailed views for complex subsystems like the service cloning process or the monitoring stack.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles and Classes
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef api fill:#2ecc71,stroke:#27ae60,color:white
    classDef core fill:#e67e22,stroke:#d35400,color:white
    classDef infra fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef security fill:#e74c3c,stroke:#c0392b,color:white

    %% Frontend Layer
    subgraph Frontend
        SV["Services View"]:::frontend
        SYSV["System View"]:::frontend
        MV["Messenger View"]:::frontend
        RV["Reservations View"]:::frontend
        AUTH_CTX["Authentication Context"]:::frontend
        GQL_CLIENT["GraphQL Client"]:::frontend
        LAYOUTS["Layouts"]:::frontend
    end

    %% API Layer
    subgraph API
        GQLAPI["GraphQL API"]:::api
        REST["REST Endpoints"]:::api
        MERCURE["Mercure Hub"]:::api
    end

    %% Core Services
    subgraph Core
        CLONER["Service Cloner"]:::core
        DOCKER["Docker Service"]:::core
        ZFS["ZFS Filesystem"]:::core
        MSG["Messenger"]:::core
    end

    %% Infrastructure
    subgraph Infrastructure
        GRAFANA["Grafana"]:::infra
        PROM["Prometheus"]:::infra
        LOKI["Loki"]:::infra
        MYSQL["MySQL"]:::infra
    end

    %% Security Layer
    SEC["Security Layer"]:::security

    %% Relationships
    SV & SYSV & MV & RV --> GQL_CLIENT
    GQL_CLIENT --> GQLAPI
    GQLAPI --> CLONER & DOCKER & ZFS & MSG
    SEC --> GQLAPI
    DOCKER --> MYSQL
    ZFS --> MYSQL
    MSG --> MERCURE
    MERCURE --> SV & MV & RV
    CLONER & DOCKER & ZFS & MSG --> PROM
    PROM --> GRAFANA
    CLONER & DOCKER & ZFS & MSG --> LOKI
    LOKI --> GRAFANA

    %% Click Events
    click SV "https://github.com/sylar-db-cloner/sylar/tree/main/assets/views/ServicesView/"
    click SYSV "https://github.com/sylar-db-cloner/sylar/tree/main/assets/views/SystemView/"
    click MV "https://github.com/sylar-db-cloner/sylar/tree/main/assets/views/MessengerView/"
    click RV "https://github.com/sylar-db-cloner/sylar/tree/main/assets/views/ReservationsView/"
    click AUTH_CTX "https://github.com/sylar-db-cloner/sylar/tree/main/assets/Context/Authentication/"
    click GQL_CLIENT "https://github.com/sylar-db-cloner/sylar/tree/main/assets/graphQL/"
    click LAYOUTS "https://github.com/sylar-db-cloner/sylar/tree/main/assets/layouts/"
    click GQLAPI "https://github.com/sylar-db-cloner/sylar/tree/main/src/UserInterface/GraphQL/"
    click CLONER "https://github.com/sylar-db-cloner/sylar/tree/main/src/Core/ServiceCloner/"
    click DOCKER "https://github.com/sylar-db-cloner/sylar/tree/main/src/Infrastructure/Docker/"
    click ZFS "https://github.com/sylar-db-cloner/sylar/tree/main/src/Infrastructure/Filesystem/"
    click MSG "https://github.com/sylar-db-cloner/sylar/tree/main/src/Infrastructure/Messenger/"
    click SEC "https://github.com/sylar-db-cloner/sylar/tree/main/src/Infrastructure/Security/"
    click GRAFANA "https://github.com/sylar-db-cloner/sylar/tree/main/.docker/grafana/"
    click PROM "https://github.com/sylar-db-cloner/sylar/tree/main/.docker/prometheus/"
    click LOKI "https://github.com/sylar-db-cloner/sylar/tree/main/.docker/loki/"
    click MERCURE "https://github.com/sylar-db-cloner/sylar/tree/main/.docker/mercure/"
    click MYSQL "https://github.com/sylar-db-cloner/sylar/tree/main/data/mysql-master/"

    %% Legend
    subgraph Legend
        L1["Frontend Component"]:::frontend
        L2["API Component"]:::api
        L3["Core Service"]:::core
        L4["Infrastructure"]:::infra
        L5["Security"]:::security
    end
```
