# facesofgaming/shadps4-compat-list architecture

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

- Interactive diagram: https://gitdiagram.com/facesofgaming/shadps4-compat-list
- Repository: https://github.com/facesofgaming/shadps4-compat-list

## Overview

##### Main Components
- Frontend:
– Located in the public/shadps4 directory, it includes the index.html file that loads dependencies (like Tailwind CSS and AG-grid) and a JavaScript file (app.shadps4.js) which configures AG-grid and formats the compatibility list data.
- Backend:
– The Laravel framework is used here, following the standard Laravel directory structure. Important backend parts include:
▪ Laravel Console Commands:
- ShadPs4ParseGithubIssues.php (responsible for parsing GitHub issues and generating the shadps4-issues.json file).
- ShadPs4ExportDiscordChannel.php (which is intended for extracting images from Discord – a work in progress).
▪ Controllers and Models: While not central to the core functionality described in the README, these represent the conventional Laravel architectural layers (e.g., app/Http/Controllers for web requests and app/Models for data representation).
▪ Configuration Files: Directories such as config, database (for migrations and seeders), and the Laravel bootstrapping logic in bootstrap/app.php defining the core application settings.
- Third-Party / External Integrations:
– GitHub (for fetching issues; note the possible rate limits and the suggestion to use a GitHub token).
– (Potentially) Discord, for the (currently WIP) command to extract images.

##### Relationships and Interactions
- Data Flow:
– The backend component (represented by the Laravel Artisan command) directly interacts with GitHub’s API to fetch issues. It then processes and aggregates the data, saving the output to the JSON file (public/shadps4/shadps4-issues.json).
– The frontend component (index.html and app.shadps4.js) loads this JSON file to present the compatibility list dynamically using AG-grid.
– There is a scheduled or manually triggered backend process (via Laravel’s scheduler) that can update the JSON file periodically, keeping the front-end data fresh.
- Architectural Patterns:
– MVC Pattern: Although the live functionality centers around Artisan commands and static JSON serving, the project maintains the Laravel MVC structure for potential extensions (using controllers, models, and views).
– Separation of Concerns: Frontend (presentation and formatting through JavaScript and HTML) is clearly separated from backend processes (data fetching, parsing, and file generation).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Services
    EX_GitHub["GitHub API"]:::external
    EX_Discord["Discord API"]:::external

    %% Frontend Section
    subgraph "Frontend"
        FE_HTML["index.html"]:::frontend
        FE_JS["app.shadps4.js"]:::frontend
    end

    %% Backend Section
    subgraph "Backend"
        LB_Framework["Laravel Framework"]:::backend
        LB_Bootstrap["Bootstrapping & Configuration"]:::backend
        LB_MVC["Controllers & Models"]:::backend
        LB_Scheduler["Scheduler"]:::scheduler
        CMD_Github["ShadPs4ParseGithubIssues"]:::backend
        CMD_Discord["ShadPs4ExportDiscordChannel (WIP)"]:::backend
        DATA_JSON["shadps4-issues.json"]:::backend
    end

    %% Data Flow and Interactions
    EX_GitHub -->|"FetchIssues"| CMD_Github
    LB_Scheduler -->|"trigger"| CMD_Github
    CMD_Github -->|"GenerateJSON"| DATA_JSON
    DATA_JSON -->|"RenderData"| FE_JS
    FE_HTML -->|"Loads"| FE_JS
    CMD_Discord -.->|"WIP extract images"| EX_Discord

    %% Backend Internal Relationships
    LB_Framework --> LB_Bootstrap
    LB_Framework --> LB_MVC
    LB_Framework --> CMD_Github
    LB_Framework --> CMD_Discord

    %% Legend (Informational node, not clickable)
    LEGEND["Legend:
FrontEnd (Blue) | Backend (Green) | Scheduler (Yellow) | External (Red)"]:::legend

    %% Classes/Styles
    classDef frontend fill:#cce5ff,stroke:#004085,stroke-width:2px;
    classDef backend fill:#d4edda,stroke:#155724,stroke-width:2px;
    classDef scheduler fill:#fff3cd,stroke:#856404,stroke-width:2px;
    classDef external fill:#f8d7da,stroke:#721c24,stroke-width:2px;
    classDef legend fill:#eee,stroke:#333,stroke-dasharray: 3, 3,stroke-width:1px;

    %% Click Events
    click FE_HTML "https://github.com/facesofgaming/shadps4-compat-list/blob/main/public/shadps4/index.html"
    click FE_JS "https://github.com/facesofgaming/shadps4-compat-list/blob/main/public/shadps4/app.shadps4.js"
    click CMD_Github "https://github.com/facesofgaming/shadps4-compat-list/blob/main/app/Console/Commands/ShadPs4ParseGithubIssues.php"
    click CMD_Discord "https://github.com/facesofgaming/shadps4-compat-list/blob/main/app/Console/Commands/ShadPs4ExportDiscordChannel.php"
    click LB_Bootstrap "https://github.com/facesofgaming/shadps4-compat-list/blob/main/bootstrap/app.php"
    click LB_MVC "https://github.com/facesofgaming/shadps4-compat-list/tree/main/app/Http/Controllers/"
    click DATA_JSON "https://github.com/facesofgaming/shadps4-compat-list/blob/main/public/shadps4/shadps4-issues.json"
```
