# shahnawaz119/movie-recommender-system architecture

> Architecture diagram of the GitHub repository shahnawaz119/movie-recommender-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shahnawaz119/movie-recommender-system
- Repository: https://github.com/shahnawaz119/movie-recommender-system

## Overview

This is a Streamlit movie-recommendation app. A viewer selects a title, requests recommendations, and sees five matches with posters, overviews, cast, and trailer links. The app loads precomputed movie metadata, builds tag-based cosine similarity at startup, and fetches presentation details from TMDB when recommendations are shown. The only source excerpt is app.py; the pickle is listed in the tree but its contents are unavailable, so its internal structure is not modeled.

Main entry points: [`app.py`](https://github.com/shahnawaz119/movie-recommender-system/blob/main/app.py) (Movie recommender UI), [`movies_dict.pkl`](https://github.com/shahnawaz119/movie-recommender-system/blob/main/movies_dict.pkl) (Movie metadata)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_recommendation["Recommendation workflow"]
  node_streamlit_app["Movie recommender UI<br/>[app.py]"]
  node_movie_data[("Movie metadata<br/>[movies_dict.pkl]")]
  node_tag_similarity["Tag similarity index<br/>[app.py]"]
  node_recommendation_engine["Recommendation engine<br/>[app.py]"]
end

subgraph group_movie_details["Movie details"]
  node_tmdb{{"TMDB API"}}
  node_youtube{{"YouTube trailers"}}
end

node_viewer(("Viewer"))

node_viewer -->|"selects and requests"| node_streamlit_app
node_streamlit_app -->|"loads"| node_movie_data
node_streamlit_app -->|"builds"| node_tag_similarity
node_streamlit_app -->|"calls"| node_recommendation_engine
node_recommendation_engine -->|"reads titles and IDs"| node_movie_data
node_recommendation_engine -->|"ranks by similarity"| node_tag_similarity
node_streamlit_app -->|"fetches details and cast"| node_tmdb
node_streamlit_app -->|"links to trailer"| node_youtube

click node_streamlit_app "https://github.com/shahnawaz119/movie-recommender-system/blob/main/app.py"
click node_movie_data "https://github.com/shahnawaz119/movie-recommender-system/blob/main/movies_dict.pkl"
click node_tag_similarity "https://github.com/shahnawaz119/movie-recommender-system/blob/main/app.py"
click node_recommendation_engine "https://github.com/shahnawaz119/movie-recommender-system/blob/main/app.py"

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_streamlit_app,node_movie_data,node_tag_similarity,node_recommendation_engine,node_viewer toneBlue
class node_tmdb,node_youtube toneAmber
```

## Components

### Recommendation workflow

- [Movie recommender UI](https://github.com/shahnawaz119/movie-recommender-system/blob/main/app.py): `app.py`
- [Movie metadata](https://github.com/shahnawaz119/movie-recommender-system/blob/main/movies_dict.pkl): `movies_dict.pkl`
- [Tag similarity index](https://github.com/shahnawaz119/movie-recommender-system/blob/main/app.py): `app.py`
- [Recommendation engine](https://github.com/shahnawaz119/movie-recommender-system/blob/main/app.py): `app.py`

### Movie details

- **TMDB API**
- **YouTube trailers**

### Other components

- **Viewer**

## Connections

- Viewer → Movie recommender UI: selects and requests (evidence: `app.py`)
- Movie recommender UI → Movie metadata: loads (evidence: `app.py`)
- Movie recommender UI → Tag similarity index: builds (evidence: `app.py`)
- Movie recommender UI → Recommendation engine: calls (evidence: `app.py`)
- Recommendation engine → Movie metadata: reads titles and IDs (evidence: `app.py`)
- Recommendation engine → Tag similarity index: ranks by similarity (evidence: `app.py`)
- Movie recommender UI → TMDB API: fetches details and cast (evidence: `app.py`)
- Movie recommender UI → YouTube trailers: links to trailer (evidence: `app.py`)
