# yoanbernabeu/openstreampoll architecture

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

- Interactive diagram: https://gitdiagram.com/yoanbernabeu/openstreampoll
- Repository: https://github.com/yoanbernabeu/openstreampoll

## Overview

##### Main Components Identification

The system should be represented with these key components:

a) Web Application Layer
- Admin Interface (Poll Management)
- Public Interface (Vote Submission)
- OBS Integration Interface
- Authentication System

b) Core Services Layer
- Poll Service
- User Service
- Visitor Service
- QR Service

c) Data Layer
- SQLite Database
- Entity Management

d) External Integration Layer
- OBS Browser Source Integration
- OBS Dock Integration

##### Specific Implementation Details

Technical aspects:

a) Real-time Updates:
- HTMX connections between frontend and backend
- Alpine.js reactive components

b) Security Flow:
- Authentication paths
- Vote validation process
- Rate limiting mechanisms

c) External Integration:
- OBS Browser Source connection
- QR code generation and update flow
- Demonstrate OBS Dock integration path

##### Additional Elements

Supporting components:

a) Infrastructure:
- FrankenPHP server container
- Docker environment
- Asset compilation flow (Tailwind CSS)

b) Development Tools:
- Testing framework connection
- Development server setup
- Command interfaces

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef controller fill:#2ecc71,stroke:#27ae60,color:white
    classDef service fill:#f1c40f,stroke:#f39c12,color:black
    classDef data fill:#e74c3c,stroke:#c0392b,color:white
    classDef external fill:#9b59b6,stroke:#8e44ad,color:white
    classDef security fill:#e67e22,stroke:#d35400,color:white

    %% Frontend Layer
    subgraph Frontend
        AdminUI["Admin Interface"]:::frontend
        PublicUI["Public Interface"]:::frontend
        OBSUI["OBS Interface"]:::frontend
        QRDisplay["QR Display"]:::frontend
        AuthUI["Login Interface"]:::frontend
    end

    %% Controller Layer
    subgraph Controllers
        AdminCtrl["Admin Controller"]:::controller
        PollCtrl["Poll Controller"]:::controller
        ObsCtrl["OBS Controller"]:::controller
        SecCtrl["Security Controller"]:::controller
    end

    %% Service Layer
    subgraph Services
        PollSvc["Poll Service"]:::service
        UserSvc["User Service"]:::service
        VisitorSvc["Visitor Service"]:::service
        QRSvc["QR Service"]:::service
    end

    %% Data Layer
    subgraph Data
        DB[(SQLite DB)]:::data
        Entities["Entities"]:::data
        Repos["Repositories"]:::data
    end

    %% External Integration
    subgraph OBS
        OBSBrowser["OBS Browser Source"]:::external
        OBSDock["OBS Dock"]:::external
    end

    %% Relationships
    AdminUI --> AdminCtrl
    PublicUI --> PollCtrl
    OBSUI --> ObsCtrl
    AuthUI --> SecCtrl

    AdminCtrl --> PollSvc
    PollCtrl --> PollSvc
    ObsCtrl --> QRSvc
    SecCtrl --> UserSvc

    PollSvc --> Repos
    UserSvc --> Repos
    VisitorSvc --> Repos
    QRSvc --> PollSvc

    Repos --> DB
    Repos --> Entities

    ObsCtrl --> OBSBrowser
    ObsCtrl --> OBSDock
    QRDisplay --> OBSBrowser

    %% Click Events
    click AdminUI "https://github.com/yoanbernabeu/OpenStreamPoll/tree/main/templates/admin/"
    click PublicUI "https://github.com/yoanbernabeu/OpenStreamPoll/tree/main/templates/home/"
    click OBSUI "https://github.com/yoanbernabeu/OpenStreamPoll/tree/main/templates/obs/"
    click AuthUI "https://github.com/yoanbernabeu/OpenStreamPoll/blob/main/templates/security/login.html.twig"
    click SecCtrl "https://github.com/yoanbernabeu/OpenStreamPoll/blob/main/src/Controller/SecurityController.php"
    click PollSvc "https://github.com/yoanbernabeu/OpenStreamPoll/blob/main/src/Service/Poll/PollService.php"
    click UserSvc "https://github.com/yoanbernabeu/OpenStreamPoll/blob/main/src/Service/User/UserService.php"
    click VisitorSvc "https://github.com/yoanbernabeu/OpenStreamPoll/blob/main/src/Service/Visitor/VisitorService.php"
    click QRSvc "https://github.com/yoanbernabeu/OpenStreamPoll/blob/main/src/Service/Qr/QrService.php"
    click Entities "https://github.com/yoanbernabeu/OpenStreamPoll/tree/main/src/Entity/"
    click Repos "https://github.com/yoanbernabeu/OpenStreamPoll/tree/main/src/Repository/"
    click AdminCtrl "https://github.com/yoanbernabeu/OpenStreamPoll/blob/main/src/Controller/AdminController.php"
    click PollCtrl "https://github.com/yoanbernabeu/OpenStreamPoll/blob/main/src/Controller/PollController.php"
    click ObsCtrl "https://github.com/yoanbernabeu/OpenStreamPoll/blob/main/src/Controller/ObsController.php"

    %% Legend
    subgraph Legend
        Frontend_L["Frontend"]:::frontend
        Controller_L["Controller"]:::controller
        Service_L["Service"]:::service
        Data_L["Data"]:::data
        External_L["External"]:::external
    end
```
