# ankit0514/moviestream architecture

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

- Interactive diagram: https://gitdiagram.com/ankit0514/moviestream
- Repository: https://github.com/ankit0514/moviestream

## Overview

This is a browser-based movie and TV discovery and playback site. Users can browse weekly trending titles or search by content type, open a title, and play a movie or choose a TV season and episode. The sampled JavaScript shows these flows and its API calls; the HTML contents were not provided, so page-to-script loading details are not shown.

Main entry points: [`script.js`](https://github.com/ankit0514/moviestream/blob/main/script.js) (Discovery Handlers), [`results.html`](https://github.com/ankit0514/moviestream/blob/main/results.html) (Results Page), [`player.html`](https://github.com/ankit0514/moviestream/blob/main/player.html) (Player Page), [`index.html`](https://github.com/ankit0514/moviestream/blob/main/index.html) (Home Page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_pages["Site Pages"]
  node_home["Home Page<br/>[index.html]"]
  node_results_page["Results Page<br/>[results.html]"]
  node_player_page["Player Page<br/>[player.html]"]
end

subgraph group_discovery["Content Discovery"]
  node_discovery_runtime["Discovery Handlers<br/>[script.js]"]
  node_results_runtime["Search Handler<br/>[script.js]"]
end

subgraph group_playback["Playback"]
  node_player_runtime["Player Handler<br/>[script.js]"]
  node_episode_runtime["Episode Loader<br/>[script.js]"]
end

node_user(("Viewer"))
node_tmdb["TMDB API"]
node_vidking["Vidking Player"]

node_user -->|"opens"| node_home
node_user -->|"searches"| node_discovery_runtime
node_discovery_runtime -->|"redirects"| node_results_page
node_discovery_runtime -->|"fetches trending"| node_tmdb
node_discovery_runtime -->|"renders trending"| node_home
node_user -->|"views"| node_results_page
node_results_runtime -->|"searches"| node_tmdb
node_results_runtime -->|"renders results"| node_results_page
node_user -->|"opens title"| node_player_page
node_results_runtime -->|"redirects"| node_player_page
node_discovery_runtime -->|"redirects"| node_player_page
node_player_runtime -->|"loads series details"| node_tmdb
node_player_runtime -->|"loads first season"| node_episode_runtime
node_episode_runtime -->|"loads episodes"| node_tmdb
node_episode_runtime -->|"selects episode"| node_player_runtime
node_player_runtime -->|"embeds movie"| node_vidking
node_player_runtime -->|"embeds episode"| node_vidking

click node_home "https://github.com/ankit0514/moviestream/blob/main/index.html"
click node_results_page "https://github.com/ankit0514/moviestream/blob/main/results.html"
click node_player_page "https://github.com/ankit0514/moviestream/blob/main/player.html"
click node_discovery_runtime "https://github.com/ankit0514/moviestream/blob/main/script.js"
click node_results_runtime "https://github.com/ankit0514/moviestream/blob/main/script.js"
click node_player_runtime "https://github.com/ankit0514/moviestream/blob/main/script.js"
click node_episode_runtime "https://github.com/ankit0514/moviestream/blob/main/script.js"

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_home,node_results_page,node_player_page,node_user toneBlue
class node_discovery_runtime,node_results_runtime toneAmber
class node_player_runtime,node_episode_runtime,node_tmdb toneMint
class node_vidking toneIndigo
```

## Components

### Site Pages

- [Home Page](https://github.com/ankit0514/moviestream/blob/main/index.html): `index.html`
- [Results Page](https://github.com/ankit0514/moviestream/blob/main/results.html): `results.html`
- [Player Page](https://github.com/ankit0514/moviestream/blob/main/player.html): `player.html`

### Content Discovery

- [Discovery Handlers](https://github.com/ankit0514/moviestream/blob/main/script.js): `script.js`
- [Search Handler](https://github.com/ankit0514/moviestream/blob/main/script.js): `script.js`

### Playback

- [Player Handler](https://github.com/ankit0514/moviestream/blob/main/script.js): `script.js`
- [Episode Loader](https://github.com/ankit0514/moviestream/blob/main/script.js): `script.js`

### Other components

- **Viewer**
- **TMDB API**
- **Vidking Player**

## Connections

- Viewer → Home Page: opens
- Viewer → Discovery Handlers: searches
- Discovery Handlers → Results Page: redirects
- Discovery Handlers → TMDB API: fetches trending
- Discovery Handlers → Home Page: renders trending
- Viewer → Results Page: views
- Search Handler → TMDB API: searches
- Search Handler → Results Page: renders results
- Viewer → Player Page: opens title
- Search Handler → Player Page: redirects
- Discovery Handlers → Player Page: redirects
- Player Handler → TMDB API: loads series details
- Player Handler → Episode Loader: loads first season
- Episode Loader → TMDB API: loads episodes
- Episode Loader → Player Handler: selects episode
- Player Handler → Vidking Player: embeds movie
- Player Handler → Vidking Player: embeds episode
