# chaitanyakumar-redsec/popcorn architecture

> Architecture diagram of the GitHub repository chaitanyakumar-redsec/popcorn, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/chaitanyakumar-redsec/popcorn
- Repository: https://github.com/chaitanyakumar-redsec/popcorn

## Overview

This is a browser-based movie and series browsing and playback app. The main workflow loads catalog data through CSV utilities, lets users browse or search titles, and launches selected media into a private screening view with playback controls and track options. Local-media browsing and subtitle handling are additional capabilities. The graph follows shown imports and calls; unsampled component details and catalog-file wiring are not inferred.

Main entry points: [`src/App.tsx`](https://github.com/chaitanyakumar-redsec/popcorn/blob/main/src/App.tsx) (App coordinator), [`src/components/PrivateScreen.tsx`](https://github.com/chaitanyakumar-redsec/popcorn/blob/main/src/components/PrivateScreen.tsx) (Screening view), [`src/components/VideoPlayer.tsx`](https://github.com/chaitanyakumar-redsec/popcorn/blob/main/src/components/VideoPlayer.tsx) (Video player), [`src/utils/subtitleLoader.ts`](https://github.com/chaitanyakumar-redsec/popcorn/blob/main/src/utils/subtitleLoader.ts) (Subtitle loader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Catalog and discovery"]
  node_app["App coordinator<br/>[App.tsx]"]
  node_header["Navigation header<br/>[Header.tsx]"]
  node_home["Home browsing<br/>[HomePage.tsx]"]
  node_movies["Movie catalog<br/>[MovieGrid.tsx]"]
  node_series["Series catalog<br/>[SeriesGrid.tsx]"]
  node_csv["CSV catalog loader<br/>[csvLoader.ts]"]
  node_types["Media data types<br/>[types.ts]"]
end

subgraph group_screening["Private screening"]
  node_screen["Screening view<br/>[PrivateScreen.tsx]"]
  node_screenmodal["Screening options"]
  node_player["Video player<br/>[VideoPlayer.tsx]"]
  node_audioflag["Audio track guidance"]
  node_browse["Local media browser"]
  node_streamform["Stream media form"]
  node_subtitlecard["Subtitle controls<br/>[SubtitleCard.tsx]"]
end

subgraph group_media["Media utilities"]
  node_trackdetect["Track detector"]
  node_subtitleload["Subtitle loader<br/>[subtitleLoader.ts]"]
  node_playbackcontrol["Playback cleanup<br/>[mediaControl.ts]"]
end

node_viewer(("Viewer"))
node_corsproxy{{"Subtitle fetch proxies"}}

node_viewer -->|"opens app"| node_app
node_app -->|"renders"| node_header
node_app -->|"renders"| node_home
node_app -->|"renders"| node_movies
node_app -->|"renders"| node_series
node_app -->|"loads catalog"| node_csv
node_app -->|"renders"| node_screen
node_app -->|"stops playback"| node_playbackcontrol
node_home -->|"launches media"| node_screen
node_movies -.->|"launches media"| node_screen
node_series -.->|"launches media"| node_screen
node_screen -.->|"renders"| node_player
node_screen -.->|"renders"| node_browse
node_screen -.->|"uses options"| node_screenmodal
node_screen -.->|"renders"| node_audioflag
node_browse -->|"detects tracks"| node_trackdetect
node_player -->|"formats track names"| node_trackdetect
node_player -->|"loads subtitles"| node_subtitleload
node_subtitlecard -.->|"loads subtitles"| node_subtitleload
node_subtitleload -->|"fetches fallback"| node_corsproxy

click node_app "https://github.com/chaitanyakumar-redsec/popcorn/blob/main/src/App.tsx"
click node_header "https://github.com/chaitanyakumar-redsec/popcorn/blob/main/src/components/Header.tsx"
click node_home "https://github.com/chaitanyakumar-redsec/popcorn/blob/main/src/components/HomePage.tsx"
click node_movies "https://github.com/chaitanyakumar-redsec/popcorn/blob/main/src/components/MovieGrid.tsx"
click node_series "https://github.com/chaitanyakumar-redsec/popcorn/blob/main/src/components/SeriesGrid.tsx"
click node_csv "https://github.com/chaitanyakumar-redsec/popcorn/blob/main/src/utils/csvLoader.ts"
click node_types "https://github.com/chaitanyakumar-redsec/popcorn/blob/main/src/types.ts"
click node_screen "https://github.com/chaitanyakumar-redsec/popcorn/blob/main/src/components/PrivateScreen.tsx"
click node_screenmodal "https://github.com/chaitanyakumar-redsec/popcorn/blob/main/src/components/PrivateScreenModal.tsx"
click node_player "https://github.com/chaitanyakumar-redsec/popcorn/blob/main/src/components/VideoPlayer.tsx"
click node_audioflag "https://github.com/chaitanyakumar-redsec/popcorn/blob/main/src/components/AudioTrackFlagChecker.tsx"
click node_browse "https://github.com/chaitanyakumar-redsec/popcorn/blob/main/src/components/BrowseMediaModal.tsx"
click node_streamform "https://github.com/chaitanyakumar-redsec/popcorn/blob/main/src/components/StreamMediaForm.tsx"
click node_subtitlecard "https://github.com/chaitanyakumar-redsec/popcorn/blob/main/src/components/SubtitleCard.tsx"
click node_trackdetect "https://github.com/chaitanyakumar-redsec/popcorn/blob/main/src/utils/mediaTrackDetector.ts"
click node_subtitleload "https://github.com/chaitanyakumar-redsec/popcorn/blob/main/src/utils/subtitleLoader.ts"
click node_playbackcontrol "https://github.com/chaitanyakumar-redsec/popcorn/blob/main/src/utils/mediaControl.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_header,node_home,node_movies,node_series,node_csv,node_types,node_viewer toneBlue
class node_screen,node_screenmodal,node_player,node_audioflag,node_browse,node_streamform,node_subtitlecard toneAmber
class node_trackdetect,node_subtitleload,node_playbackcontrol toneMint
class node_corsproxy toneIndigo
```

## Components

### Catalog and discovery

- [App coordinator](https://github.com/chaitanyakumar-redsec/popcorn/blob/main/src/App.tsx): `src/App.tsx`
- [Navigation header](https://github.com/chaitanyakumar-redsec/popcorn/blob/main/src/components/Header.tsx): `src/components/Header.tsx`
- [Home browsing](https://github.com/chaitanyakumar-redsec/popcorn/blob/main/src/components/HomePage.tsx): `src/components/HomePage.tsx`
- [Movie catalog](https://github.com/chaitanyakumar-redsec/popcorn/blob/main/src/components/MovieGrid.tsx): `src/components/MovieGrid.tsx`
- [Series catalog](https://github.com/chaitanyakumar-redsec/popcorn/blob/main/src/components/SeriesGrid.tsx): `src/components/SeriesGrid.tsx`
- [CSV catalog loader](https://github.com/chaitanyakumar-redsec/popcorn/blob/main/src/utils/csvLoader.ts): `src/utils/csvLoader.ts`
- [Media data types](https://github.com/chaitanyakumar-redsec/popcorn/blob/main/src/types.ts): `src/types.ts`

### Private screening

- [Screening view](https://github.com/chaitanyakumar-redsec/popcorn/blob/main/src/components/PrivateScreen.tsx): `src/components/PrivateScreen.tsx`
- [Screening options](https://github.com/chaitanyakumar-redsec/popcorn/blob/main/src/components/PrivateScreenModal.tsx): `src/components/PrivateScreenModal.tsx`
- [Video player](https://github.com/chaitanyakumar-redsec/popcorn/blob/main/src/components/VideoPlayer.tsx): `src/components/VideoPlayer.tsx`
- [Audio track guidance](https://github.com/chaitanyakumar-redsec/popcorn/blob/main/src/components/AudioTrackFlagChecker.tsx): `src/components/AudioTrackFlagChecker.tsx`
- [Local media browser](https://github.com/chaitanyakumar-redsec/popcorn/blob/main/src/components/BrowseMediaModal.tsx): `src/components/BrowseMediaModal.tsx`
- [Stream media form](https://github.com/chaitanyakumar-redsec/popcorn/blob/main/src/components/StreamMediaForm.tsx): `src/components/StreamMediaForm.tsx`
- [Subtitle controls](https://github.com/chaitanyakumar-redsec/popcorn/blob/main/src/components/SubtitleCard.tsx): `src/components/SubtitleCard.tsx`

### Media utilities

- [Track detector](https://github.com/chaitanyakumar-redsec/popcorn/blob/main/src/utils/mediaTrackDetector.ts): `src/utils/mediaTrackDetector.ts`
- [Subtitle loader](https://github.com/chaitanyakumar-redsec/popcorn/blob/main/src/utils/subtitleLoader.ts): `src/utils/subtitleLoader.ts`
- [Playback cleanup](https://github.com/chaitanyakumar-redsec/popcorn/blob/main/src/utils/mediaControl.ts): `src/utils/mediaControl.ts`

### Other components

- **Viewer**
- **Subtitle fetch proxies**

## Connections

- Viewer → App coordinator: opens app
- App coordinator → Navigation header: renders (evidence: `src/App.tsx`)
- App coordinator → Home browsing: renders (evidence: `src/App.tsx`)
- App coordinator → Movie catalog: renders (evidence: `src/App.tsx`)
- App coordinator → Series catalog: renders (evidence: `src/App.tsx`)
- App coordinator → CSV catalog loader: loads catalog (evidence: `src/App.tsx`)
- App coordinator → Screening view: renders (evidence: `src/App.tsx`)
- App coordinator → Playback cleanup: stops playback (evidence: `src/App.tsx`)
- Home browsing → Screening view: launches media (evidence: `src/App.tsx`)
- Movie catalog → Screening view: launches media
- Series catalog → Screening view: launches media
- Screening view → Video player: renders (evidence: `src/components/PrivateScreen.tsx`)
- Screening view → Local media browser: renders (evidence: `src/components/PrivateScreen.tsx`)
- Screening view → Screening options: uses options
- Screening view → Audio track guidance: renders (evidence: `src/components/PrivateScreen.tsx`)
- Local media browser → Track detector: detects tracks (evidence: `src/components/BrowseMediaModal.tsx`)
- Video player → Track detector: formats track names (evidence: `src/components/VideoPlayer.tsx`)
- Video player → Subtitle loader: loads subtitles (evidence: `src/components/VideoPlayer.tsx`)
- Subtitle controls → Subtitle loader: loads subtitles (evidence: `src/components/SubtitleCard.tsx`)
- Subtitle loader → Subtitle fetch proxies: fetches fallback (evidence: `src/utils/subtitleLoader.ts`)
