# rational-kunal/netflix-hotkeys architecture

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

- Interactive diagram: https://gitdiagram.com/rational-kunal/netflix-hotkeys
- Repository: https://github.com/rational-kunal/netflix-hotkeys

## Overview

##### Main Components Overview

a) Extension Components:
- Popup Interface
- Options Page
- Background Script
- Content Script
- Core Services
- UI Components

##### Specific Implementation Details

a) UI Layer:
**FeatureControl Components**
- AudioToggleControl
- AutoLoginControl
- PowerSeekControl
- Other feature controls

b) Core Services:
**NetflixController**
- Executor
- Hotkeys
- DOM Manipulation

**NetflixCrawler**
- DOM Monitoring

**EventManager**
- HotkeysEvent

##### Key Interactions

Following flows:
##### User Preference Flow
- UI → Preferences → Storage

##### Hotkey Execution Flow
- EventManager → NetflixController → Executor → Netflix DOM

##### Feature Control Flow
- FeatureControl → Preferences → NetflixController

##### Additional Elements

Include:
- Version information
- Clear labels for all components
- Brief descriptions of key interactions

##### Technical Details

Highlight:
- Chrome Extension APIs used
- DOM manipulation points
- Event handling system
- Storage mechanisms
- Feature toggle system

Remember to include notes about:
- How hotkeys are processed
- The role of the Executor in handling DOM updates
- The preference management system
- The event propagation system

This will create a comprehensive visualization that accurately represents the extension's architecture while being understandable to other developers.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles
    classDef ui fill:#3498db,stroke:#2980b9,color:white
    classDef core fill:#2ecc71,stroke:#27ae60,color:white
    classDef script fill:#9b59b6,stroke:#8e44ad,color:white
    classDef storage fill:#f1c40f,stroke:#f39c12,color:black
    classDef manager fill:#e74c3c,stroke:#c0392b,color:white

    %% UI Layer
    subgraph UI
        Popup["Popup Interface"]
        Options["Options Page"]
        FCContainer["Feature Controls Container"]
        Toast["Content Toast Manager"]
        
        subgraph FeatureControls
            Audio["Audio Toggle"]
            AutoLogin["Auto Login"]
            PowerSeek["Power Seek"]
            Subtitle["Subtitle Toggle"]
        end
    end

    %% Core Layer
    subgraph Core
        NC["Netflix Controller"]
        subgraph NCComponents
            Executor["Executor"]
            Hotkeys["Hotkeys Handler"]
        end
        
        Crawler["Netflix Crawler"]
        EventMgr["Event Manager"]
        HotkeysEvent["Hotkeys Event"]
        Prefs["Preferences"]
        Store["Storage"]
    end

    %% Scripts Layer
    Background["Background Script"]
    Content["Content Script"]

    %% Relationships
    Popup --> Prefs
    Options --> Prefs
    FCContainer --> FeatureControls
    FeatureControls --> NC
    
    NC --> Executor
    NC --> Hotkeys
    NC <--> Crawler
    
    EventMgr --> HotkeysEvent
    HotkeysEvent --> NC
    
    Background <--> Content
    Content --> NC
    
    Prefs <--> Store
    NC --> Toast

    %% Styles Application
    class Popup,Options,FCContainer,Toast,Audio,AutoLogin,PowerSeek,Subtitle ui
    class NC,Executor,Hotkeys,Crawler core
    class Background,Content script
    class Store,Prefs storage
    class EventMgr,HotkeysEvent manager

    %% Click Events
    click Popup "https://github.com/rational-kunal/Netflix-Hotkeys/blob/main/src/popup/Popup.jsx"
    click Options "https://github.com/rational-kunal/Netflix-Hotkeys/blob/main/src/options/Options.jsx"
    click FCContainer "https://github.com/rational-kunal/Netflix-Hotkeys/tree/main/src/UI/FeatureControl/"
    click Toast "https://github.com/rational-kunal/Netflix-Hotkeys/tree/main/src/UI/ContentToastManager/"
    click Background "https://github.com/rational-kunal/Netflix-Hotkeys/blob/main/src/background/index.js"
    click Content "https://github.com/rational-kunal/Netflix-Hotkeys/blob/main/src/content/index.js"
    click NC "https://github.com/rational-kunal/Netflix-Hotkeys/tree/main/src/core/NetflixController/"
    click Executor "https://github.com/rational-kunal/Netflix-Hotkeys/blob/main/src/core/NetflixController/Executor.js"
    click Hotkeys "https://github.com/rational-kunal/Netflix-Hotkeys/blob/main/src/core/NetflixController/Hotkeys.js"
    click Crawler "https://github.com/rational-kunal/Netflix-Hotkeys/blob/main/src/core/NetflixCrawler/index.js"
    click EventMgr "https://github.com/rational-kunal/Netflix-Hotkeys/tree/main/src/core/EventManager/"
    click HotkeysEvent "https://github.com/rational-kunal/Netflix-Hotkeys/blob/main/src/core/EventManager/HotkeysEvent.js"
    click Prefs "https://github.com/rational-kunal/Netflix-Hotkeys/blob/main/src/core/Preferences/Preferences.js"
    click Store "https://github.com/rational-kunal/Netflix-Hotkeys/blob/main/src/core/Storage/Storage.js"
    click Audio "https://github.com/rational-kunal/Netflix-Hotkeys/blob/main/src/UI/FeatureControl/AudioToggleControl.jsx"
    click AutoLogin "https://github.com/rational-kunal/Netflix-Hotkeys/blob/main/src/UI/FeatureControl/AutoLoginControl.jsx"
    click PowerSeek "https://github.com/rational-kunal/Netflix-Hotkeys/blob/main/src/UI/FeatureControl/PowerSeekControl.jsx"
    click Subtitle "https://github.com/rational-kunal/Netflix-Hotkeys/blob/main/src/UI/FeatureControl/SubtitleToggleControl.jsx"
```
