# nare809/hdscreen architecture

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

- Interactive diagram: https://gitdiagram.com/nare809/hdscreen
- Repository: https://github.com/nare809/hdscreen

## Overview

##### Project type and purpose
- This is a React‐based single-page streaming platform (“HdScreen”) that displays movies/TV shows to end users.
- The front-end is delivered as a static bundle (built by Webpack) and relies on Firebase for user management and persistent state, plus TMDB’s public API for content metadata.

##### File structure
- Top-level: configuration files (.babelrc, webpack.config.js, README.md, etc.), public assets under `/public`, and source under `/src`.
- `/src/components`: hundreds of UI building-blocks (cards, banners, players, modals, etc.).
- `/src/containers`: higher-order or route components that tie UI to data and context (App.jsx, HomepageContainer.jsx, ActorPageContainer.jsx, etc.).
- `/src/Firebase`: Firebase initialization (firebase.js), authentication/user utilities (UserUtils.js, UserContext.js), and list management.
- `/src/api/tmdb.js`: wrapper for TMDB external API calls.
- Build/deploy scripts: `.cmd` files, production vs. development webpack configs, bundle analysis, gzip compression.

##### README for additional insights
- Uses React.lazy/Suspense for code splitting.
- Asset compression (gzip).
- Preload hints, optimized splitChunks, Sass config.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Build & Deployment Layer
    subgraph "Build & Deployment" 
        direction TB
        Babel[".babelrc"]:::tooling
        WebpackDev["webpack.config.js"]:::tooling
        WebpackProd["webpack.config.prod.js"]:::tooling
        Babel --> WebpackDev
        Babel --> WebpackProd
        WebpackDev -->|"builds"| Dist["dist (static bundle)"]:::frontend
        WebpackProd -->|"builds"| Dist
    end

    %% Hosting Layer
    Hosting["Firebase Hosting"]:::backend
    Dist -->|"deploy"| Hosting

    %% Runtime Layer (Browser)
    subgraph "Browser / Runtime" 
        direction TB
        Browser["Web Browser"]:::client
        subgraph "React SPA"
            direction TB
            Entry["src/index.js"]:::client
            AppShell["App.jsx"]:::client
            Entry --> AppShell
            subgraph "UI Components"
                direction TB
                Components["/src/components/"]:::client
            end
            subgraph "Container Components"
                direction TB
                Containers["/src/containers/"]:::client
            end
            subgraph "Context & API Clients"
                direction TB
                FirebaseInit["firebase.js"]:::backend
                UserUtils["UserUtils.js"]:::backend
                UserContext["UserContext.js"]:::backend
                Lists["lists.js"]:::backend
                TMDBClient["tmdb.js"]:::external
                FirebaseInit --> UserUtils
                FirebaseInit --> UserContext
                FirebaseInit --> Lists
            end
            AppShell --> Components
            AppShell --> Containers
            AppShell --> UserContext
            AppShell --> TMDBClient
        end
        Hosting --> Browser
    end

    %% External Services
    subgraph "External Services"
        direction TB
        Auth["Firebase Auth"]:::backend
        Firestore["Firestore DB"]:::backend
        TMDB["TMDB API"]:::external
        Browser -->|"login/signup, token"| Auth
        Browser -->|"read/write user lists"| Firestore
        Browser -->|"fetch metadata"| TMDB
    end

    %% Public Assets
    subgraph "Public Assets"
        direction TB
        IndexHTML["public/index.html"]:::frontend
        Redirects["public/_redirects"]:::frontend
        Manifest["public/manifest.json"]:::frontend
        Robots["public/robots.txt"]:::frontend
        PlayerApp["public/player/index.html"]:::frontend
        AssetLinks["public/.well-known/assetlinks.json"]:::frontend
        Hosting --> IndexHTML
        Hosting --> Redirects
        Hosting --> Manifest
        Hosting --> Robots
        Hosting --> PlayerApp
        Hosting --> AssetLinks
    end

    classDef tooling fill:#dddddd,stroke:#999999,stroke-width:1px
    classDef frontend fill:#cce5ff,stroke:#66b0ff,stroke-width:1px
    classDef client fill:#cce5ff,stroke:#3399ff,stroke-width:1px
    classDef backend fill:#d4edda,stroke:#28a745,stroke-width:1px
    classDef external fill:#ffe5b4,stroke:#ff9900,stroke-width:1px

    %% Click Events
    click Entry "https://github.com/nare809/hdscreen/blob/main/src/index.js"
    click AppShell "https://github.com/nare809/hdscreen/blob/main/src/containers/App.jsx"
    click Components "https://github.com/nare809/hdscreen/tree/main/src/components/"
    click Containers "https://github.com/nare809/hdscreen/tree/main/src/containers/"
    click FirebaseInit "https://github.com/nare809/hdscreen/blob/main/src/Firebase/firebase.js"
    click UserUtils "https://github.com/nare809/hdscreen/blob/main/src/Firebase/UserUtils.js"
    click UserContext "https://github.com/nare809/hdscreen/blob/main/src/Firebase/UserContext.js"
    click Lists "https://github.com/nare809/hdscreen/blob/main/src/Firebase/lists.js"
    click TMDBClient "https://github.com/nare809/hdscreen/blob/main/src/api/tmdb.js"
    click Babel "https://github.com/nare809/hdscreen/blob/main/.babelrc"
    click WebpackDev "https://github.com/nare809/hdscreen/blob/main/webpack.config.js"
    click WebpackProd "https://github.com/nare809/hdscreen/blob/main/webpack.config.prod.js"
    click IndexHTML "https://github.com/nare809/hdscreen/blob/main/public/index.html"
    click Redirects "https://github.com/nare809/hdscreen/tree/main/public/_redirects"
    click Manifest "https://github.com/nare809/hdscreen/blob/main/public/manifest.json"
    click Robots "https://github.com/nare809/hdscreen/blob/main/public/robots.txt"
    click PlayerApp "https://github.com/nare809/hdscreen/blob/main/public/player/index.html"
    click AssetLinks "https://github.com/nare809/hdscreen/blob/main/public/.well-known/assetlinks.json"
```
