# gallikattip-pixel/smart-movie-recommender architecture

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

- Interactive diagram: https://gitdiagram.com/gallikattip-pixel/smart-movie-recommender
- Repository: https://github.com/gallikattip-pixel/smart-movie-recommender

## Overview

Smart Movie Recommender is a React/FastAPI app for searching movies and TV, exploring details, saving favorites and feedback, and generating personalized recommendations. The main workflow runs from the frontend through API routes to intent parsing, candidate discovery, ranking, and results; TMDB supplies catalog data, while favorites and feedback persist in browser localStorage. The graph preserves the documented graph-search and explanation capabilities. Some internal links are based on SOURCE INDEX references rather than sampled function bodies.

Main entry points: [`frontend/src/App.tsx`](https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/frontend/src/App.tsx) (App shell), [`backend/app/api/recommend.py`](https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/backend/app/api/recommend.py) (Recommend route), [`backend/app/tmdb/client.py`](https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/backend/app/tmdb/client.py) (TMDB client), [`frontend/src/services/favorites.ts`](https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/frontend/src/services/favorites.ts) (Favorites service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Frontend experience"]
  node_app["App shell<br/>[App.tsx]"]
  node_search_ui["Search UI<br/>[Search.tsx]"]
  node_recommend_ui["Recommendations UI"]
  node_details_ui["Media details<br/>[MediaDetails.tsx]"]
  node_favorites_ui["Favorites views"]
  node_preferences_ui["Preference filters"]
  node_search_client["Search client<br/>[search.ts]"]
  node_recommend_client["Recommend client<br/>[recommend.ts]"]
  node_details_client["Details client<br/>[details.ts]"]
  node_favorites_store["Favorites service<br/>[favorites.ts]"]
  node_feedback_store["Feedback service<br/>[feedback.tsx]"]
end

subgraph group_api["API routes"]
  node_search_api["Search route<br/>[search.py]"]
  node_recommend_api["Recommend route<br/>[recommend.py]"]
  node_favorites_api["Favorites route<br/>[favorites.py]"]
  node_feedback_api["Feedback route<br/>[feedback.py]"]
  node_schemas["API schemas<br/>[schemas.py]"]
end

subgraph group_engine["Recommendation engine"]
  node_intent["Intent parsing<br/>[intent.py]"]
  node_profile["Preference profile<br/>[profile.py]"]
  node_candidates["Candidate discovery<br/>[candidates.py]"]
  node_graph_search["Graph search<br/>[graph.py]"]
  node_algorithms["Search algorithms"]
  node_ranking["Ranking<br/>[ranking.py]"]
  node_explanations["Recommendation explanations<br/>[explain.py]"]
end

subgraph group_catalog["Catalog integration"]
  node_tmdb_client["TMDB client<br/>[client.py]"]
  node_tmdb_models["TMDB response models<br/>[models.py]"]
end

node_user(("Viewer"))
node_browser_storage[("Browser localStorage")]
node_tmdb["TMDB API"]

node_user -->|"uses"| node_app
node_app -->|"calls"| node_search_client
node_app -->|"calls"| node_recommend_client
node_app -->|"renders"| node_search_ui
node_app -->|"renders"| node_recommend_ui
node_app -->|"renders"| node_preferences_ui
node_search_ui -->|"calls"| node_search_client
node_recommend_ui -->|"calls"| node_recommend_client
node_recommend_ui -->|"reads"| node_favorites_store
node_recommend_ui -->|"uses"| node_feedback_store
node_details_ui -->|"calls"| node_details_client
node_details_ui -->|"uses"| node_favorites_store
node_details_ui -->|"uses"| node_feedback_store
node_favorites_ui -->|"reads"| node_favorites_store
node_favorites_ui -->|"loads details"| node_details_client
node_favorites_store -->|"reads/writes"| node_browser_storage
node_feedback_store -->|"reads/writes"| node_browser_storage
node_search_client -->|"HTTP request"| node_search_api
node_recommend_client -->|"HTTP request"| node_recommend_api
node_details_client -.->|"HTTP request"| node_favorites_api
node_app -->|"updates"| node_favorites_store
node_app -->|"updates"| node_feedback_store
node_search_api -->|"parses query"| node_intent
node_search_api -->|"searches catalog"| node_tmdb_client
node_recommend_api -->|"parses query"| node_intent
node_recommend_api -->|"builds profile"| node_profile
node_recommend_api -->|"ranks results"| node_ranking
node_recommend_api -.->|"discovers candidates"| node_candidates
node_recommend_api -->|"validates payload"| node_schemas
node_search_api -->|"validates payload"| node_schemas
node_favorites_api -->|"resolves titles"| node_tmdb_client
node_favorites_api -->|"uses models"| node_schemas
node_feedback_api -->|"uses models"| node_schemas
node_candidates -->|"fetches candidates"| node_tmdb_client
node_candidates -->|"uses intent"| node_intent
node_candidates -->|"uses profile"| node_profile
node_ranking -->|"uses graph"| node_graph_search
node_algorithms -->|"searches graph"| node_graph_search
node_tmdb_client -->|"requests data"| node_tmdb
node_tmdb_client -->|"normalizes responses"| node_tmdb_models
node_graph_search -->|"uses media data"| node_tmdb_models
node_ranking -.->|"provides reasons"| node_explanations

click node_app "https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/frontend/src/App.tsx"
click node_search_ui "https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/frontend/src/components/Search.tsx"
click node_recommend_ui "https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/frontend/src/components/Recommendations.tsx"
click node_details_ui "https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/frontend/src/components/MediaDetails.tsx"
click node_favorites_ui "https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/frontend/src/components/FavoritesDrawer.tsx"
click node_preferences_ui "https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/frontend/src/components/PreferencesFilter.tsx"
click node_search_client "https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/frontend/src/services/search.ts"
click node_recommend_client "https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/frontend/src/services/recommend.ts"
click node_details_client "https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/frontend/src/services/details.ts"
click node_favorites_store "https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/frontend/src/services/favorites.ts"
click node_feedback_store "https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/frontend/src/services/feedback.tsx"
click node_search_api "https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/backend/app/api/search.py"
click node_recommend_api "https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/backend/app/api/recommend.py"
click node_favorites_api "https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/backend/app/api/favorites.py"
click node_feedback_api "https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/backend/app/api/feedback.py"
click node_intent "https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/backend/app/recommender/intent.py"
click node_profile "https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/backend/app/recommender/profile.py"
click node_candidates "https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/backend/app/recommender/candidates.py"
click node_graph_search "https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/backend/app/recommender/graph.py"
click node_algorithms "https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/backend/app/recommender/search_algorithms.py"
click node_ranking "https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/backend/app/recommender/ranking.py"
click node_explanations "https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/backend/app/recommender/explain.py"
click node_schemas "https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/backend/app/schemas.py"
click node_tmdb_client "https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/backend/app/tmdb/client.py"
click node_tmdb_models "https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/backend/app/tmdb/models.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_app,node_search_ui,node_recommend_ui,node_details_ui,node_favorites_ui,node_preferences_ui,node_search_client,node_recommend_client,node_details_client,node_favorites_store,node_feedback_store,node_user toneBlue
class node_search_api,node_recommend_api,node_favorites_api,node_feedback_api,node_schemas,node_browser_storage toneAmber
class node_intent,node_profile,node_candidates,node_graph_search,node_algorithms,node_ranking,node_explanations,node_tmdb toneMint
class node_tmdb_client,node_tmdb_models toneRose
```

## Components

### Frontend experience

- [App shell](https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Search UI](https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/frontend/src/components/Search.tsx): `frontend/src/components/Search.tsx`
- [Recommendations UI](https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/frontend/src/components/Recommendations.tsx): `frontend/src/components/Recommendations.tsx`
- [Media details](https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/frontend/src/components/MediaDetails.tsx): `frontend/src/components/MediaDetails.tsx`
- [Favorites views](https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/frontend/src/components/FavoritesDrawer.tsx): `frontend/src/components/FavoritesDrawer.tsx`
- [Preference filters](https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/frontend/src/components/PreferencesFilter.tsx): `frontend/src/components/PreferencesFilter.tsx`
- [Search client](https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/frontend/src/services/search.ts): `frontend/src/services/search.ts`
- [Recommend client](https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/frontend/src/services/recommend.ts): `frontend/src/services/recommend.ts`
- [Details client](https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/frontend/src/services/details.ts): `frontend/src/services/details.ts`
- [Favorites service](https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/frontend/src/services/favorites.ts): `frontend/src/services/favorites.ts`
- [Feedback service](https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/frontend/src/services/feedback.tsx): `frontend/src/services/feedback.tsx`

### API routes

- [Search route](https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/backend/app/api/search.py): `backend/app/api/search.py`
- [Recommend route](https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/backend/app/api/recommend.py): `backend/app/api/recommend.py`
- [Favorites route](https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/backend/app/api/favorites.py): `backend/app/api/favorites.py`
- [Feedback route](https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/backend/app/api/feedback.py): `backend/app/api/feedback.py`
- [API schemas](https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/backend/app/schemas.py): `backend/app/schemas.py`

### Recommendation engine

- [Intent parsing](https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/backend/app/recommender/intent.py): `backend/app/recommender/intent.py`
- [Preference profile](https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/backend/app/recommender/profile.py): `backend/app/recommender/profile.py`
- [Candidate discovery](https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/backend/app/recommender/candidates.py): `backend/app/recommender/candidates.py`
- [Graph search](https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/backend/app/recommender/graph.py): `backend/app/recommender/graph.py`
- [Search algorithms](https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/backend/app/recommender/search_algorithms.py): `backend/app/recommender/search_algorithms.py`
- [Ranking](https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/backend/app/recommender/ranking.py): `backend/app/recommender/ranking.py`
- [Recommendation explanations](https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/backend/app/recommender/explain.py): `backend/app/recommender/explain.py`

### Catalog integration

- [TMDB client](https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/backend/app/tmdb/client.py): `backend/app/tmdb/client.py`
- [TMDB response models](https://github.com/gallikattip-pixel/smart-movie-recommender/blob/main/backend/app/tmdb/models.py): `backend/app/tmdb/models.py`

### Other components

- **Viewer**
- **Browser localStorage**
- **TMDB API**

## Connections

- Viewer → App shell: uses (evidence: `README.md`)
- App shell → Search client: calls (evidence: `frontend/src/App.tsx`)
- App shell → Recommend client: calls (evidence: `frontend/src/App.tsx`)
- App shell → Search UI: renders (evidence: `frontend/src/App.tsx`)
- App shell → Recommendations UI: renders (evidence: `frontend/src/App.tsx`)
- App shell → Preference filters: renders (evidence: `frontend/src/App.tsx`)
- Search UI → Search client: calls (evidence: `frontend/src/components/Search.tsx`)
- Recommendations UI → Recommend client: calls (evidence: `frontend/src/components/Recommendations.tsx`)
- Recommendations UI → Favorites service: reads (evidence: `frontend/src/components/Recommendations.tsx`)
- Recommendations UI → Feedback service: uses (evidence: `frontend/src/components/Recommendations.tsx`)
- Media details → Details client: calls (evidence: `frontend/src/components/MediaDetails.tsx`)
- Media details → Favorites service: uses (evidence: `frontend/src/components/MediaDetails.tsx`)
- Media details → Feedback service: uses (evidence: `frontend/src/components/MediaDetails.tsx`)
- Favorites views → Favorites service: reads (evidence: `frontend/src/components/FavoritesDrawer.tsx`)
- Favorites views → Details client: loads details (evidence: `frontend/src/components/FavoritesDrawer.tsx`)
- Favorites service → Browser localStorage: reads/writes (evidence: `frontend/src/services/favorites.ts`)
- Feedback service → Browser localStorage: reads/writes (evidence: `frontend/src/services/feedback.tsx`)
- Search client → Search route: HTTP request (evidence: `README.md`)
- Recommend client → Recommend route: HTTP request (evidence: `README.md`)
- Details client → Favorites route: HTTP request
- App shell → Favorites service: updates (evidence: `frontend/src/App.tsx`)
- App shell → Feedback service: updates (evidence: `frontend/src/App.tsx`)
- Search route → Intent parsing: parses query (evidence: `backend/app/api/search.py`)
- Search route → TMDB client: searches catalog (evidence: `backend/app/api/search.py`)
- Recommend route → Intent parsing: parses query (evidence: `backend/app/api/recommend.py`)
- Recommend route → Preference profile: builds profile (evidence: `backend/app/api/recommend.py`)
- Recommend route → Ranking: ranks results (evidence: `backend/app/api/recommend.py`)
- Recommend route → Candidate discovery: discovers candidates
- Recommend route → API schemas: validates payload (evidence: `backend/app/api/recommend.py`)
- Search route → API schemas: validates payload (evidence: `backend/app/api/search.py`)
- Favorites route → TMDB client: resolves titles (evidence: `backend/app/api/favorites.py`)
- Favorites route → API schemas: uses models (evidence: `backend/app/api/favorites.py`)
- Feedback route → API schemas: uses models (evidence: `backend/app/api/feedback.py`)
- Candidate discovery → TMDB client: fetches candidates (evidence: `backend/app/recommender/candidates.py`)
- Candidate discovery → Intent parsing: uses intent (evidence: `backend/app/recommender/candidates.py`)
- Candidate discovery → Preference profile: uses profile (evidence: `backend/app/recommender/candidates.py`)
- Ranking → Graph search: uses graph (evidence: `backend/app/recommender/ranking.py`)
- Search algorithms → Graph search: searches graph (evidence: `backend/app/recommender/search_algorithms.py`)
- TMDB client → TMDB API: requests data (evidence: `README.md`)
- TMDB client → TMDB response models: normalizes responses (evidence: `backend/app/tmdb/client.py`)
- Graph search → TMDB response models: uses media data (evidence: `backend/app/recommender/graph.py`)
- Ranking → Recommendation explanations: provides reasons
