# sy17258/-gesture-controlled-media-player architecture

> Architecture diagram of the GitHub repository sy17258/-gesture-controlled-media-player, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sy17258/-gesture-controlled-media-player
- Repository: https://github.com/sy17258/-gesture-controlled-media-player

## Overview

##### Main Components
- UI Layer (React Frontend): Illustrate that the “Client” encapsulates several major React components:
- CombinedDetector: Likely the core component that integrates gesture detection via webcam.
- VideoPlayer: The component handling media playback.
- VideoSelector: The component that lets users choose which video to play.
- UI Styling/Utility Layer: Represented by the “src/ui” folder which contains additional styles and scripts (vortex.css, vortex.js) that enhance the visual aspects.
- Gesture Recognition Assets:
- External Libraries/Frameworks:
- MediaPipe: Indicate its role in hand tracking.
- React and its ecosystem (Create React App, Webpack/Babel configuration in package.json, config-overrides.js), which set up and run the application.
- Static Assets:
- Public Directory: Includes index.html, manifest, and robots.txt. This folder sets up the baseline HTML and configurations for the app.

##### Relationships and Data Flow
- Data Flow from Webcam to Gesture Recognition:
- Within CombinedDetector, indicate that it accesses the TensorFlow Lite model for real-time gesture recognition and possibly leverages MediaPipe for hand tracking.
- Interaction between Components:
- There can be a feedback loop where the UI reflects updated states (such as FPS counters or gesture detection feedback) by rendering changes.
- External Libraries/Configurations:
- That external libraries (React, MediaPipe) and the overall configuration files (config-overrides.js, package.json) function as the backbone that ties these components together.

##### Architectural Patterns
- Component-based UI Architecture:
- That the project follows React’s component-based design, promoting reusability and clear separation of concerns.
- Client-side Processing:
- That the gesture detection and media control logic are executed entirely on the client side (in-browser computation).
- Separation of Static Assets and Application Logic:
- Make it clear by separating the “public” folder (static HTML and ML assets) and the “src” folder (JavaScript implementation and UI components).

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Client Environment"
        Browser["Browser (Client)"]:::external
    end

    subgraph "UI Layer"
        ReactFront["React Frontend"]:::frontend
        CombinedDetector["CombinedDetector"]:::frontend
        VideoPlayer["VideoPlayer"]:::frontend
        VideoSelector["VideoSelector"]:::frontend
        UIStyling["UI Styling/Utility"]:::frontend
    end

    subgraph "ML & Static Assets"
        TFLite["TensorFlow Lite Model"]:::asset
        StaticAssets["Static Assets (index.html, manifest, robots.txt)"]:::asset
    end

    subgraph "External Libraries & Configurations"
        MediaPipe["MediaPipe Library"]:::external
        Config["Configuration (package.json,config-overrides.js)"]:::external
        CRA["React (Create React App)"]:::external
    end

    Browser -->|"WebcamData"| CombinedDetector
    Browser -->|"LoadsStatic"| StaticAssets

    ReactFront -->|"Supports"| CombinedDetector
    ReactFront -->|"Supports"| VideoPlayer
    ReactFront -->|"Supports"| VideoSelector
    ReactFront -->|"Utilizes"| UIStyling
    Config -->|"Configures"| ReactFront
    CRA -->|"Bootstraps"| ReactFront

    CombinedDetector -->|"UsesModel"| TFLite
    CombinedDetector -->|"HandTracking"| MediaPipe
    CombinedDetector -->|"GestureEvents"| VideoPlayer
    CombinedDetector -->|"GestureEvents"| VideoSelector

    classDef frontend fill:#CDEB8B,stroke:#333,stroke-width:2px;
    classDef asset fill:#F9E79F,stroke:#333,stroke-width:2px;
    classDef external fill:#AED6F1,stroke:#333,stroke-width:2px;

    click ReactFront "https://github.com/sy17258/-gesture-controlled-media-player/tree/main/src/"
    click CombinedDetector "https://github.com/sy17258/-gesture-controlled-media-player/blob/main/src/components/CombinedDetector.js"
    click VideoPlayer "https://github.com/sy17258/-gesture-controlled-media-player/blob/main/src/components/VideoPlayer.js"
    click VideoSelector "https://github.com/sy17258/-gesture-controlled-media-player/blob/main/src/components/VideoSelector.js"
    click UIStyling "https://github.com/sy17258/-gesture-controlled-media-player/tree/main/src/ui"
    click TFLite "https://github.com/sy17258/-gesture-controlled-media-player/blob/main/public/gesture_recognizer_model.tflite"
    click StaticAssets "https://github.com/sy17258/-gesture-controlled-media-player/tree/main/public/"
```
