# raphy/epitechdj architecture

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

- Interactive diagram: https://gitdiagram.com/raphy/epitechdj
- Repository: https://github.com/raphy/epitechdj

## Overview

##### Project type and purpose
- This is a full-stack, monolithic web application built on Symfony (PHP).
- It clones the core functionality of Plug.DJ (“EpitechDJ”) for Epitech students: user authentication via Epitech, video queuing, voting, and playback.

##### File structure
- Top-level Symfony structure:
- app/ – configuration (config.yml, routing.yml, security.yml), cache, logs, kernel, console, autoload
- src/ – application code broken into Bundles
- AppBundle – controllers (Authentication, Home, Player, Video, Vote), Entities (Video, Vote), Twig views, public assets (CSS/JS/images)
- RaphyEpitechUserBundle – reusable bundle handling Epitech OAuth, User entity, custom security providers
- web/ – document root: app.php, app_dev.php, static assets, config.php
- composer.json/lock – dependencies
- PHPUnit config – tests likely under app/phpunit.xml.dist
- Patterns & choices: MVC (Controllers → Views → Entities via Doctrine ORM), Dependency Injection (services.yml), Bundles for modularity.

##### README for additional insights
- Confirms it’s a Plug.DJ-style video-voting web app.

##### Detail without overcomplicating
- Don’t forget to show asset flow: Client requests CSS/JS → web/Resources/public.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Layer
    Browser["Client (Browser)"]:::frontend
    Browser -->|"HTTP(S)"| AppPHP
    Browser -->|"HTTP(S)"| DevPHP
    Browser -->|"Loads"| JS
    Browser -->|"Loads"| CSS
    Browser -->|"Loads"| IMG

    %% Static Assets
    subgraph "Static Assets"
        JS["EpitechDJ.js"]:::frontend
        CSS["style.css"]:::frontend
        IMG["Images"]:::frontend
    end
    click JS "https://github.com/raphy/epitechdj/blob/master/src/AppBundle/Resources/public/js/EpitechDJ.js"
    click CSS "https://github.com/raphy/epitechdj/blob/master/src/AppBundle/Resources/public/css/style.css"
    click IMG "https://github.com/raphy/epitechdj/tree/master/src/AppBundle/Resources/public/img/"

    %% Web Server Layer
    subgraph "Web Server"  
        AppPHP["app.php"]:::infra
        DevPHP["app_dev.php"]:::infra
        HT_Web["web/.htaccess"]:::infra
        HT_AppHT["app/.htaccess"]:::infra
    end
    click AppPHP "https://github.com/raphy/epitechdj/blob/master/web/app.php"
    click DevPHP "https://github.com/raphy/epitechdj/blob/master/web/app_dev.php"
    click HT_Web "https://github.com/raphy/epitechdj/blob/master/web/.htaccess"
    click HT_AppHT "https://github.com/raphy/epitechdj/blob/master/app/.htaccess"

    AppPHP --> PHPFPM
    DevPHP --> PHPFPM
    JS --> AppPHP
    CSS --> AppPHP
    IMG --> AppPHP

    %% PHP-FPM
    PHPFPM["PHP-FPM"]:::infra
    PHPFPM --> AppKernel
    PHPFPM --> Console

    %% Symfony Application
    subgraph "Symfony App"
        subgraph "Kernel"
            AppKernel["AppKernel.php"]:::backend
            Console["console"]:::backend
        end
        subgraph "Global Configuration"
            Routing["routing.yml"]:::config
            Security["security.yml"]:::config
            ServicesCFG["services.yml"]:::config
            ConfigY["config.yml"]:::config
        end
        subgraph "Bundles"
            subgraph "AppBundle"
                AB_Def["AppBundle.php"]:::backend
                AuthCtrl["AuthenticationController.php"]:::backend
                HomeCtrl["HomeController.php"]:::backend
                PlayerCtrl["PlayerController.php"]:::backend
                VideoCtrl["VideoController.php"]:::backend
                VoteCtrl["VoteController.php"]:::backend
                VideoEnt["Video.php"]:::backend
                VoteEnt["Vote.php"]:::backend
                AB_Views["Resources/views/"]:::backend
                AB_ServCFG["Resources/config/services.yml"]:::config
                AB_Routing["Resources/config/routing.yml"]:::config
            end
            subgraph "RaphyEpitechUserBundle"
                RE_Def["RaphyEpitechUserBundle.php"]:::backend
                RE_AuthFactory["AuthenticationFactory.php"]:::backend
                RE_AuthProvider["AuthenticationProvider.php"]:::backend
                RE_UserProvider["UserProvider.php"]:::backend
                RE_Entity["User.php"]:::backend
                RE_DepInj["DependencyInjection/"]:::config
                RE_ServCfg["Resources/config/services.yml"]:::config
            end
        end
    end

    %% Data Layer
    subgraph "Data Layer"
        DB["Database (MySQL/PostgreSQL via Doctrine)"]:::external
    end

    %% External Services
    ExternalAPI["Epitech OAuth API"]:::external

    %% Connections
    AppKernel --> Routing
    AppKernel --> Security
    AppKernel --> ServicesCFG
    AppKernel --> ConfigY
    AppKernel --> AB_Def
    AppKernel --> RE_Def

    AuthCtrl --> VideoEnt
    AuthCtrl --> VoteEnt
    PlayerCtrl --> DB
    VideoCtrl --> DB
    VoteCtrl --> DB

    RE_AuthFactory --> RE_Entity
    RE_AuthProvider --> RE_Entity
    RE_UserProvider --> RE_Entity

    AB_ServCFG --> AB_Def
    AB_Routing --> AB_Def
    RE_DepInj --> RE_Def
    RE_ServCfg --> RE_Def

    AppKernel -->|"SQL Queries"| DB
    AuthCtrl -->|"SQL Queries"| DB
    VideoCtrl -->|"SQL Queries"| DB
    VoteCtrl -->|"SQL Queries"| DB

    PlayerCtrl -->|"OAuth Redirect/Callback"| ExternalAPI
    ExternalAPI -->|"OAuth Response"| AuthCtrl

    %% Click Events for Symfony
    click AppKernel "https://github.com/raphy/epitechdj/blob/master/app/AppKernel.php"
    click Console "https://github.com/raphy/epitechdj/tree/master/app/console"
    click Routing "https://github.com/raphy/epitechdj/blob/master/app/config/routing.yml"
    click Security "https://github.com/raphy/epitechdj/blob/master/app/config/security.yml"
    click ServicesCFG "https://github.com/raphy/epitechdj/blob/master/app/config/services.yml"
    click ConfigY "https://github.com/raphy/epitechdj/blob/master/app/config/config.yml"
    click AB_Def "https://github.com/raphy/epitechdj/blob/master/src/AppBundle/AppBundle.php"
    click AuthCtrl "https://github.com/raphy/epitechdj/blob/master/src/AppBundle/Controller/AuthenticationController.php"
    click HomeCtrl "https://github.com/raphy/epitechdj/blob/master/src/AppBundle/Controller/HomeController.php"
    click PlayerCtrl "https://github.com/raphy/epitechdj/blob/master/src/AppBundle/Controller/PlayerController.php"
    click VideoCtrl "https://github.com/raphy/epitechdj/blob/master/src/AppBundle/Controller/VideoController.php"
    click VoteCtrl "https://github.com/raphy/epitechdj/blob/master/src/AppBundle/Controller/VoteController.php"
    click VideoEnt "https://github.com/raphy/epitechdj/blob/master/src/AppBundle/Entity/Video.php"
    click VoteEnt "https://github.com/raphy/epitechdj/blob/master/src/AppBundle/Entity/Vote.php"
    click AB_Views "https://github.com/raphy/epitechdj/tree/master/src/AppBundle/Resources/views/"
    click AB_ServCFG "https://github.com/raphy/epitechdj/blob/master/src/AppBundle/Resources/config/services.yml"
    click AB_Routing "https://github.com/raphy/epitechdj/blob/master/src/AppBundle/Resources/config/routing.yml"
    click RE_Def "https://github.com/raphy/epitechdj/blob/master/src/Raphy/Epitech/UserBundle/RaphyEpitechUserBundle.php"
    click RE_AuthFactory "https://github.com/raphy/epitechdj/blob/master/src/Raphy/Epitech/UserBundle/Security/AuthenticationFactory.php"
    click RE_AuthProvider "https://github.com/raphy/epitechdj/blob/master/src/Raphy/Epitech/UserBundle/Security/AuthenticationProvider.php"
    click RE_UserProvider "https://github.com/raphy/epitechdj/blob/master/src/Raphy/Epitech/UserBundle/Security/UserProvider.php"
    click RE_Entity "https://github.com/raphy/epitechdj/blob/master/src/Raphy/Epitech/UserBundle/Entity/User.php"
    click RE_DepInj "https://github.com/raphy/epitechdj/tree/master/src/Raphy/Epitech/UserBundle/DependencyInjection/"
    click RE_ServCfg "https://github.com/raphy/epitechdj/blob/master/src/Raphy/Epitech/UserBundle/Resources/config/services.yml"
    click JS "https://github.com/raphy/epitechdj/blob/master/src/AppBundle/Resources/public/js/EpitechDJ.js"
    click CSS "https://github.com/raphy/epitechdj/blob/master/src/AppBundle/Resources/public/css/style.css"
    click IMG "https://github.com/raphy/epitechdj/tree/master/src/AppBundle/Resources/public/img/"

    %% Styles
    classDef frontend fill:#D6EAF8,stroke:#1B4F72,color:#1B4F72
    classDef infra fill:#FAD7A0,stroke:#874D00,color:#874D00
    classDef backend fill:#E8DAEF,stroke:#512E5F,color:#512E5F
    classDef external fill:#D5F5E3,stroke:#196F3D,color:#196F3D
    classDef config fill:#FCF3CF,stroke:#7D6608,color:#7D6608
```
