# comete-upn/bbbc architecture

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

- Interactive diagram: https://gitdiagram.com/comete-upn/bbbc
- Repository: https://github.com/comete-upn/bbbc

## Overview

##### Project type and purpose
- This is a PHP-based full-stack web application (“BigBlueButton Control”) that manages virtual conferences on a BigBlueButton (BBB) server.
- Key features (from README): multi-user CAS authentication, create/delete permanent conferences, generate moderator/attendee links, measure latency via JSP ping endpoint.

##### File structure
Top-level directories and files:
- 3rdparty/ – phpCAS library and related JavaScript (flash_detect.js, jquery-2.1.1.js, ua-parser.js)
- inc/ – application core (cas.php, config.template.php, database.php, utility.php, header/footer)
- static/ – CSS, JS, images, HTML stub (void.html)
- sql/ – database schema and migrations
- upload-to-bbb/ – ping.jsp for latency tests on the BBB server
- index.php, redirect.php – main entry points
- publish.sh – CLI helper script
- README.md – installation and overview

Patterns and configurations:
– MVC-light: index.php routes requests, inc/ holds controllers and utility functions, header.php/footer.php act as view templates.
– CAS SSO integration via phpCAS (3rdparty/phpCAS).
– MySQL persistence (sql/init.sql).
– Static asset pipeline (static/css, static/js).
– External dependency: BigBlueButton API endpoints (HTTP requests to create/delete rooms).
– JSP ping endpoint for latency measurement.

##### README for additional insights
- Clearly describes CAS authentication requirement, database setup, and latency test setup.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client Side
    subgraph "User's Browser" 
        direction TB
        CSS1["common.css"]:::frontend
        CSS2["fullscreen.css"]:::frontend
        CSS3["manager.css"]:::frontend
        JS1["fullscreen.js"]:::frontend
        HTML["void.html"]:::frontend
        JQ["jquery-2.1.1.js"]:::frontend
        FD["flash_detect.js"]:::frontend
        UA["ua-parser.js"]:::frontend
    end

    %% Web Application
    subgraph "Web Server / PHP Application"
        direction TB
        subgraph "Router / Controllers"
            direction TB
            IDX["index.php"]:::backend
            RED["redirect.php"]:::backend
            HDR["header.php"]:::backend
            FTR["footer.php"]:::backend
        end
        subgraph "Business Logic / Utilities"
            direction TB
            UTIL["utility.php"]:::backend
            CASUTIL["cas.php"]:::backend
        end
        subgraph "CAS SSO Integration"
            direction TB
            PHPcasMain["CAS.php"]:::backend
            PHPcasAll["phpCAS/*"]:::backend
        end
        subgraph "Database Layer"
            direction TB
            DBMOD["database.php"]:::backend
            CFG["config.template.php"]:::backend
            SQL1["init.sql"]:::backend
            SQL2["update-20141217.sql"]:::backend
        end
        subgraph "BBB API Client"
            direction TB
            UTIL2["utility.php"]:::backend
            CLI["publish.sh"]:::backend
        end
    end

    %% External Services
    subgraph "External Services"
        direction TB
        CASsrv["CAS Authentication Server"]:::external
        DBsrv["MySQL Database"]:::external
        BBB["BigBlueButton Server API"]:::external
        JSP["ping.jsp (Latency Endpoint)"]:::external
    end

    %% Connections
    CSS1 -->|"load"| IDX
    CSS2 --> IDX
    CSS3 --> IDX
    JS1 --> IDX
    HTML --> IDX
    JQ --> IDX
    FD --> IDX
    UA --> IDX

    IDX -->|"includes"| HDR
    IDX -->|"includes"| FTR
    IDX -->|"calls"| UTIL
    IDX -->|"calls"| CASUTIL
    RED -->|"redirecttoCAS"| PHPcasMain
    CASUTIL -->|"uses"| PHPcasAll

    UTIL -->|"queries"| DBMOD
    DBMOD -->|"reads/writes"| DBsrv

    UTIL2 -->|"APIcalls"| BBB
    CLI -->|"shellcalls"| BBB

    JS1 -->|"AJAX ping"| JSP

    RED -->|"validateTicket"| CASsrv
    PHPcasMain -->|"CASAuth"| CASsrv

    %% Styles
    classDef frontend fill:#FFA500,stroke:#333,stroke-width:1px
    classDef backend fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef external fill:#90EE90,stroke:#333,stroke-width:1px

    %% Click Events
    click CSS1 "https://github.com/comete-upn/bbbc/blob/master/static/css/common.css"
    click CSS2 "https://github.com/comete-upn/bbbc/blob/master/static/css/fullscreen.css"
    click CSS3 "https://github.com/comete-upn/bbbc/blob/master/static/css/manager.css"
    click JS1 "https://github.com/comete-upn/bbbc/blob/master/static/js/fullscreen.js"
    click HTML "https://github.com/comete-upn/bbbc/blob/master/static/void.html"
    click JQ "https://github.com/comete-upn/bbbc/blob/master/3rdparty/jquery-2.1.1.js"
    click FD "https://github.com/comete-upn/bbbc/blob/master/3rdparty/flash_detect.js"
    click UA "https://github.com/comete-upn/bbbc/blob/master/3rdparty/ua-parser.js"
    click IDX "https://github.com/comete-upn/bbbc/blob/master/index.php"
    click RED "https://github.com/comete-upn/bbbc/blob/master/redirect.php"
    click HDR "https://github.com/comete-upn/bbbc/blob/master/inc/header.php"
    click FTR "https://github.com/comete-upn/bbbc/blob/master/inc/footer.php"
    click UTIL "https://github.com/comete-upn/bbbc/blob/master/inc/utility.php"
    click CASUTIL "https://github.com/comete-upn/bbbc/blob/master/inc/cas.php"
    click PHPcasMain "https://github.com/comete-upn/bbbc/blob/master/3rdparty/phpCAS/CAS.php"
    click PHPcasAll "https://github.com/comete-upn/bbbc/tree/master/3rdparty/phpCAS/"
    click DBMOD "https://github.com/comete-upn/bbbc/blob/master/inc/database.php"
    click CFG "https://github.com/comete-upn/bbbc/blob/master/inc/config.template.php"
    click SQL1 "https://github.com/comete-upn/bbbc/blob/master/sql/init.sql"
    click SQL2 "https://github.com/comete-upn/bbbc/blob/master/sql/update-20141217.sql"
    click CLI "https://github.com/comete-upn/bbbc/blob/master/publish.sh"
    click JSP "https://github.com/comete-upn/bbbc/blob/master/upload-to-bbb/ping.jsp"
```
