# awantigiradkar/movie-recommendation-system architecture

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

- Interactive diagram: https://gitdiagram.com/awantigiradkar/movie-recommendation-system
- Repository: https://github.com/awantigiradkar/movie-recommendation-system

## Overview

##### Project type and purpose
- This is a lightweight full-stack (or more accurately back-end plus UI) content-based movie recommender system built in Python with a Streamlit interface.
- The system reads movie metadata, computes a cosine-similarity matrix, serves recommendations via an interactive web UI, and fetches movie posters from the TMDb API.

##### File structure
Top-level files and their roles:
- app.py              – main Streamlit application (serves UI and handles user interactions)
- Movie_Recommender_System.ipynb – exploratory notebook (data processing and modeling code)
- tmdb_5000_movies.csv, tmdb_5000_credits.csv – raw dataset sources
- movie_list.pkl, movie_dict.pkl, similarity.pkl – serialized model artifacts (pickles for lookup list, metadata dict, similarity matrix)
- README.md, .gitattributes – documentation and version control config

##### README for additional insights
- Recommender pipeline:
– Data collection (TMDb CSVs) → feature engineering (“tags” column) → CountVectorizer → cosine similarity
– UI: Streamlit dropdown, recommendation display with posters
– Poster fetch: HTTP calls to TMDb API at runtime

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User Layer
    User["User"]:::external

    %% Frontend Layer
    subgraph "Streamlit Frontend"
        UI["Streamlit UI"]:::frontend
    end

    %% Backend Layer
    subgraph "Recommendation Engine"
        DL["Data Loader\n(load pickles)"]:::backend
        PV["Preprocessing & CountVectorizer"]:::backend
        SC["Similarity Calculator\n(cosine similarity)"]:::backend
        RS["Recommendation Selector\n(top-5 logic)"]:::backend
    end

    %% Data Storage Layer
    subgraph "Data Storage"
        Pickles["Serialized Artifacts"]:::storage
        ML["movie_list.pkl"]:::storage
        MD["movie_dict.pkl"]:::storage
        SM["similarity.pkl"]:::storage
        Raw["Raw Datasets"]:::storage
        TMDBM["tmdb_5000_movies.csv"]:::storage
        TMDBC["tmdb_5000_credits.csv"]:::storage
    end

    %% External Service Layer
    TMDB["TMDb API"]:::external

    %% Documentation
    subgraph "Documentation & Config"
        NB["Movie_Recommender_System.ipynb"]:::doc
        RD["README.md"]:::doc
        GA[".gitattributes"]:::doc
    end

    %% Connections
    User -->|"select movie"| UI
    UI -->|"request recommendations"| DL
    DL -->|"load movie_list.pkl, movie_dict.pkl, similarity.pkl"| Pickles
    Pickles --> DL
    DL --> PV
    PV --> SC
    SC --> RS
    RS --> TMDB
    TMDB -->|"poster URL"| RS
    RS -->|"return titles & URLs"| UI
    UI -->|"render results"| User

    %% Additional connections to raw datasets (optional)
    DL -->|"optional data reload"| Raw
    Raw --> TMDBM
    Raw --> TMDBC

    %% Project artifacts nodes linking
    UI --> NB
    UI --> RD
    UI --> GA

    %% Click Events
    click UI "https://github.com/awantigiradkar/movie-recommendation-system/blob/main/app.py"
    click NB "https://github.com/awantigiradkar/movie-recommendation-system/blob/main/Movie_Recommender_System.ipynb"
    click ML "https://github.com/awantigiradkar/movie-recommendation-system/blob/main/movie_list.pkl"
    click MD "https://github.com/awantigiradkar/movie-recommendation-system/blob/main/movie_dict.pkl"
    click SM "https://github.com/awantigiradkar/movie-recommendation-system/blob/main/similarity.pkl"
    click TMDBM "https://github.com/awantigiradkar/movie-recommendation-system/blob/main/tmdb_5000_movies.csv"
    click TMDBC "https://github.com/awantigiradkar/movie-recommendation-system/blob/main/tmdb_5000_credits.csv"
    click RD "https://github.com/awantigiradkar/movie-recommendation-system/blob/main/README.md"
    click GA "https://github.com/awantigiradkar/movie-recommendation-system/blob/main/.gitattributes"

    %% Styles
    classDef frontend fill:#E0F7FA,stroke:#0288D1,color:#000
    classDef backend fill:#E8F5E9,stroke:#388E3C,color:#000
    classDef storage fill:#ECEFF1,stroke:#90A4AE,color:#000
    classDef external fill:#FFECB3,stroke:#FFA000,color:#000
    classDef doc fill:#F3E5F5,stroke:#8E24AA,color:#000
```
