# githubnali/netflix-gpt architecture

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

- Interactive diagram: https://gitdiagram.com/githubnali/netflix-gpt
- Repository: https://github.com/githubnali/netflix-gpt

## Overview

Netflix+GPT is a React movie-discovery app with Firebase sign-in, a browsable movie catalog, movie details, and GPT-powered recommendations. The main journey is sign in, enter the protected browse experience, explore catalog rows or open a movie, and optionally search for recommendations. Redux slices hold user, catalog, details, GPT, and language state. The README documents these product capabilities; some browse subcomponents and slice interactions are not excerpted, so only documented or indexed relationships are shown, with uncertain links omitted.

Main entry points: [`src/components/Body.jsx`](https://github.com/githubnali/netflix-gpt/blob/main/src/components/Body.jsx) (Routes and auth sync), [`src/components/Browse/Browse.jsx`](https://github.com/githubnali/netflix-gpt/blob/main/src/components/Browse/Browse.jsx) (Browse page), [`src/utils/appStore.js`](https://github.com/githubnali/netflix-gpt/blob/main/src/utils/appStore.js) (Redux store), [`src/components/GptSearch/GptSearchBar.jsx`](https://github.com/githubnali/netflix-gpt/blob/main/src/components/GptSearch/GptSearchBar.jsx) (Recommendation search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_routing["App and access"]
  node_app["App provider<br/>[App.jsx]"]
  node_router["Routes and auth sync<br/>[Body.jsx]"]
  node_protected["Protected route<br/>[ProtectedRoute.jsx]"]
  node_login["Sign-in and signup<br/>[Login.jsx]"]
end

subgraph group_discovery["Movie discovery"]
  node_header["App header<br/>[Header.jsx]"]
  node_browse["Browse page<br/>[Browse.jsx]"]
  node_main["Featured movie<br/>[MainContainer.jsx]"]
  node_secondary["Catalog rows"]
  node_trailer["Featured trailer"]
  node_catalog_hooks["Catalog fetch hooks"]
  node_trailer_hook["Trailer fetch hook<br/>[useMovieTrailer.js]"]
  node_movie_list["Movie lists<br/>[MovieList.jsx]"]
  node_movie_card["Movie card<br/>[MovieCard.jsx]"]
  node_details["Movie details page<br/>[MovieDetails.jsx]"]
  node_details_hook["Details fetch hook<br/>[useMovieDetails.js]"]
end

subgraph group_recommendations["GPT recommendations"]
  node_gpt_page["GPT search page<br/>[GptSearch.jsx]"]
  node_gpt_bar["Recommendation search<br/>[GptSearchBar.jsx]"]
  node_gpt_results["Recommendation results"]
end

subgraph group_state["Application state"]
  node_store[("Redux store<br/>[appStore.js]")]
  node_user_state[("User state<br/>[useSlice.js]")]
  node_movie_state[("Catalog state<br/>[moviesSlice.js]")]
  node_details_state[("Details state")]
  node_gpt_state[("GPT state<br/>[gptSlice.js]")]
  node_config_state[("Language state<br/>[configSlice.js]")]
  node_language["Language labels"]
end

node_viewer(("Viewer"))
node_firebase["Firebase auth<br/>[firebase.js]"]
node_tmdb["TMDB API"]
node_youtube["YouTube player"]
node_openai["OpenAI API"]

node_viewer -->|"signs in"| node_login
node_viewer -->|"browses"| node_browse
node_app -->|"provides store"| node_router
node_router -->|"observes auth"| node_firebase
node_router -->|"updates user"| node_user_state
node_router -->|"resets search"| node_gpt_state
node_router -->|"guards routes"| node_protected
node_router -->|"routes to"| node_login
node_router -->|"routes to"| node_browse
node_router -->|"routes to"| node_details
node_login -->|"authenticates"| node_firebase
node_login -->|"sets user"| node_user_state
node_login -->|"renders"| node_header
node_header -->|"signs out"| node_firebase
node_header -->|"toggles search"| node_gpt_state
node_header -->|"changes language"| node_config_state
node_browse -->|"renders"| node_header
node_browse -->|"loads catalogs"| node_catalog_hooks
node_browse -->|"renders feature"| node_main
node_browse -->|"renders rows"| node_secondary
node_browse -->|"shows search"| node_gpt_page
node_trailer -->|"loads trailer"| node_trailer_hook
node_trailer_hook -->|"fetches videos"| node_tmdb
node_trailer_hook -->|"stores trailer"| node_movie_state
node_catalog_hooks -->|"fetches catalogs"| node_tmdb
node_catalog_hooks -->|"stores catalogs"| node_movie_state
node_details -->|"loads details"| node_details_hook
node_details_hook -->|"fetches movie data"| node_tmdb
node_details_hook -->|"stores details"| node_details_state
node_details -->|"shows similar titles"| node_movie_list
node_details -->|"embeds trailer"| node_youtube
node_gpt_page -->|"renders search"| node_gpt_bar
node_gpt_page -->|"renders results"| node_gpt_results
node_gpt_bar -->|"requests suggestions"| node_openai
node_gpt_bar -->|"searches titles"| node_tmdb
node_gpt_bar -->|"stores results"| node_gpt_state
node_gpt_results -->|"reuses lists"| node_movie_list
node_movie_list -->|"renders cards"| node_movie_card
node_store -->|"registers reducer"| node_user_state
node_store -->|"registers reducer"| node_movie_state
node_store -->|"registers reducer"| node_details_state
node_store -->|"registers reducer"| node_gpt_state
node_store -->|"registers reducer"| node_config_state
node_gpt_bar -->|"uses labels"| node_language

click node_app "https://github.com/githubnali/netflix-gpt/blob/main/src/App.jsx"
click node_router "https://github.com/githubnali/netflix-gpt/blob/main/src/components/Body.jsx"
click node_protected "https://github.com/githubnali/netflix-gpt/blob/main/src/components/common/ProtectedRoute.jsx"
click node_login "https://github.com/githubnali/netflix-gpt/blob/main/src/components/Login/Login.jsx"
click node_firebase "https://github.com/githubnali/netflix-gpt/blob/main/src/utils/firebase.js"
click node_header "https://github.com/githubnali/netflix-gpt/blob/main/src/components/common/Header.jsx"
click node_browse "https://github.com/githubnali/netflix-gpt/blob/main/src/components/Browse/Browse.jsx"
click node_main "https://github.com/githubnali/netflix-gpt/blob/main/src/components/Browse/MainContainer.jsx"
click node_secondary "https://github.com/githubnali/netflix-gpt/blob/main/src/components/Browse/SecondaryContainer.jsx"
click node_trailer "https://github.com/githubnali/netflix-gpt/blob/main/src/components/Browse/VideoBackground.jsx"
click node_catalog_hooks "https://github.com/githubnali/netflix-gpt/tree/main/src/hooks"
click node_trailer_hook "https://github.com/githubnali/netflix-gpt/blob/main/src/hooks/useMovieTrailer.js"
click node_movie_list "https://github.com/githubnali/netflix-gpt/blob/main/src/components/movies/MovieList.jsx"
click node_movie_card "https://github.com/githubnali/netflix-gpt/blob/main/src/components/movies/MovieCard.jsx"
click node_details "https://github.com/githubnali/netflix-gpt/blob/main/src/components/MovieDetails/MovieDetails.jsx"
click node_details_hook "https://github.com/githubnali/netflix-gpt/blob/main/src/hooks/useMovieDetails.js"
click node_gpt_page "https://github.com/githubnali/netflix-gpt/blob/main/src/components/GptSearch/GptSearch.jsx"
click node_gpt_bar "https://github.com/githubnali/netflix-gpt/blob/main/src/components/GptSearch/GptSearchBar.jsx"
click node_gpt_results "https://github.com/githubnali/netflix-gpt/blob/main/src/components/GptSearch/GptMovieSuggestions.jsx"
click node_store "https://github.com/githubnali/netflix-gpt/blob/main/src/utils/appStore.js"
click node_user_state "https://github.com/githubnali/netflix-gpt/blob/main/src/utils/useSlice.js"
click node_movie_state "https://github.com/githubnali/netflix-gpt/blob/main/src/utils/moviesSlice.js"
click node_details_state "https://github.com/githubnali/netflix-gpt/blob/main/src/utils/movieDetailsSlice.js"
click node_gpt_state "https://github.com/githubnali/netflix-gpt/blob/main/src/utils/gptSlice.js"
click node_config_state "https://github.com/githubnali/netflix-gpt/blob/main/src/utils/configSlice.js"
click node_language "https://github.com/githubnali/netflix-gpt/blob/main/src/utils/languageConstants.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_app,node_router,node_protected,node_login,node_viewer toneBlue
class node_header,node_browse,node_main,node_secondary,node_trailer,node_catalog_hooks,node_trailer_hook,node_movie_list,node_movie_card,node_details,node_details_hook toneAmber
class node_gpt_page,node_gpt_bar,node_gpt_results,node_tmdb,node_openai toneMint
class node_store,node_user_state,node_movie_state,node_details_state,node_gpt_state,node_config_state,node_language toneRose
class node_firebase toneTeal
class node_youtube toneIndigo
```

## Components

### App and access

- [App provider](https://github.com/githubnali/netflix-gpt/blob/main/src/App.jsx): `src/App.jsx`
- [Routes and auth sync](https://github.com/githubnali/netflix-gpt/blob/main/src/components/Body.jsx): `src/components/Body.jsx`
- [Protected route](https://github.com/githubnali/netflix-gpt/blob/main/src/components/common/ProtectedRoute.jsx): `src/components/common/ProtectedRoute.jsx`
- [Sign-in and signup](https://github.com/githubnali/netflix-gpt/blob/main/src/components/Login/Login.jsx): `src/components/Login/Login.jsx`

### Movie discovery

- [App header](https://github.com/githubnali/netflix-gpt/blob/main/src/components/common/Header.jsx): `src/components/common/Header.jsx`
- [Browse page](https://github.com/githubnali/netflix-gpt/blob/main/src/components/Browse/Browse.jsx): `src/components/Browse/Browse.jsx`
- [Featured movie](https://github.com/githubnali/netflix-gpt/blob/main/src/components/Browse/MainContainer.jsx): `src/components/Browse/MainContainer.jsx`
- [Catalog rows](https://github.com/githubnali/netflix-gpt/blob/main/src/components/Browse/SecondaryContainer.jsx): `src/components/Browse/SecondaryContainer.jsx`
- [Featured trailer](https://github.com/githubnali/netflix-gpt/blob/main/src/components/Browse/VideoBackground.jsx): `src/components/Browse/VideoBackground.jsx`
- [Catalog fetch hooks](https://github.com/githubnali/netflix-gpt/tree/main/src/hooks): `src/hooks`
- [Trailer fetch hook](https://github.com/githubnali/netflix-gpt/blob/main/src/hooks/useMovieTrailer.js): `src/hooks/useMovieTrailer.js`
- [Movie lists](https://github.com/githubnali/netflix-gpt/blob/main/src/components/movies/MovieList.jsx): `src/components/movies/MovieList.jsx`
- [Movie card](https://github.com/githubnali/netflix-gpt/blob/main/src/components/movies/MovieCard.jsx): `src/components/movies/MovieCard.jsx`
- [Movie details page](https://github.com/githubnali/netflix-gpt/blob/main/src/components/MovieDetails/MovieDetails.jsx): `src/components/MovieDetails/MovieDetails.jsx`
- [Details fetch hook](https://github.com/githubnali/netflix-gpt/blob/main/src/hooks/useMovieDetails.js): `src/hooks/useMovieDetails.js`

### GPT recommendations

- [GPT search page](https://github.com/githubnali/netflix-gpt/blob/main/src/components/GptSearch/GptSearch.jsx): `src/components/GptSearch/GptSearch.jsx`
- [Recommendation search](https://github.com/githubnali/netflix-gpt/blob/main/src/components/GptSearch/GptSearchBar.jsx): `src/components/GptSearch/GptSearchBar.jsx`
- [Recommendation results](https://github.com/githubnali/netflix-gpt/blob/main/src/components/GptSearch/GptMovieSuggestions.jsx): `src/components/GptSearch/GptMovieSuggestions.jsx`

### Application state

- [Redux store](https://github.com/githubnali/netflix-gpt/blob/main/src/utils/appStore.js): `src/utils/appStore.js`
- [User state](https://github.com/githubnali/netflix-gpt/blob/main/src/utils/useSlice.js): `src/utils/useSlice.js`
- [Catalog state](https://github.com/githubnali/netflix-gpt/blob/main/src/utils/moviesSlice.js): `src/utils/moviesSlice.js`
- [Details state](https://github.com/githubnali/netflix-gpt/blob/main/src/utils/movieDetailsSlice.js): `src/utils/movieDetailsSlice.js`
- [GPT state](https://github.com/githubnali/netflix-gpt/blob/main/src/utils/gptSlice.js): `src/utils/gptSlice.js`
- [Language state](https://github.com/githubnali/netflix-gpt/blob/main/src/utils/configSlice.js): `src/utils/configSlice.js`
- [Language labels](https://github.com/githubnali/netflix-gpt/blob/main/src/utils/languageConstants.js): `src/utils/languageConstants.js`

### Other components

- **Viewer**
- [Firebase auth](https://github.com/githubnali/netflix-gpt/blob/main/src/utils/firebase.js): `src/utils/firebase.js`
- **TMDB API**
- **YouTube player**
- **OpenAI API**

## Connections

- Viewer → Sign-in and signup: signs in
- Viewer → Browse page: browses
- App provider → Routes and auth sync: provides store (evidence: `src/App.jsx`)
- Routes and auth sync → Firebase auth: observes auth (evidence: `src/components/Body.jsx`)
- Routes and auth sync → User state: updates user (evidence: `src/components/Body.jsx`)
- Routes and auth sync → GPT state: resets search (evidence: `src/components/Body.jsx`)
- Routes and auth sync → Protected route: guards routes (evidence: `src/components/Body.jsx`)
- Routes and auth sync → Sign-in and signup: routes to (evidence: `src/components/Body.jsx`)
- Routes and auth sync → Browse page: routes to (evidence: `src/components/Body.jsx`)
- Routes and auth sync → Movie details page: routes to (evidence: `src/components/Body.jsx`)
- Sign-in and signup → Firebase auth: authenticates (evidence: `src/components/Login/Login.jsx`)
- Sign-in and signup → User state: sets user (evidence: `src/components/Login/Login.jsx`)
- Sign-in and signup → App header: renders (evidence: `src/components/Login/Login.jsx`)
- App header → Firebase auth: signs out (evidence: `src/components/common/Header.jsx`)
- App header → GPT state: toggles search (evidence: `src/components/common/Header.jsx`)
- App header → Language state: changes language (evidence: `src/components/common/Header.jsx`)
- Browse page → App header: renders (evidence: `src/components/Browse/Browse.jsx`)
- Browse page → Catalog fetch hooks: loads catalogs (evidence: `src/components/Browse/Browse.jsx`)
- Browse page → Featured movie: renders feature (evidence: `src/components/Browse/Browse.jsx`)
- Browse page → Catalog rows: renders rows (evidence: `src/components/Browse/Browse.jsx`)
- Browse page → GPT search page: shows search (evidence: `src/components/Browse/Browse.jsx`)
- Featured trailer → Trailer fetch hook: loads trailer (evidence: `src/components/Browse/VideoBackground.jsx`)
- Trailer fetch hook → TMDB API: fetches videos (evidence: `src/hooks/useMovieTrailer.js`)
- Trailer fetch hook → Catalog state: stores trailer (evidence: `src/hooks/useMovieTrailer.js`)
- Catalog fetch hooks → TMDB API: fetches catalogs
- Catalog fetch hooks → Catalog state: stores catalogs (evidence: `src/hooks/useMovieTrailer.js`)
- Movie details page → Details fetch hook: loads details (evidence: `src/components/MovieDetails/MovieDetails.jsx`)
- Details fetch hook → TMDB API: fetches movie data (evidence: `src/hooks/useMovieDetails.js`)
- Details fetch hook → Details state: stores details (evidence: `src/hooks/useMovieDetails.js`)
- Movie details page → Movie lists: shows similar titles (evidence: `src/components/MovieDetails/MovieDetails.jsx`)
- Movie details page → YouTube player: embeds trailer (evidence: `src/components/MovieDetails/MovieDetails.jsx`)
- GPT search page → Recommendation search: renders search (evidence: `src/components/GptSearch/GptSearch.jsx`)
- GPT search page → Recommendation results: renders results (evidence: `src/components/GptSearch/GptSearch.jsx`)
- Recommendation search → OpenAI API: requests suggestions (evidence: `src/components/GptSearch/GptSearchBar.jsx`)
- Recommendation search → TMDB API: searches titles (evidence: `src/components/GptSearch/GptSearchBar.jsx`)
- Recommendation search → GPT state: stores results (evidence: `src/components/GptSearch/GptSearchBar.jsx`)
- Recommendation results → Movie lists: reuses lists (evidence: `src/components/GptSearch/GptMovieSuggestions.jsx`)
- Movie lists → Movie card: renders cards (evidence: `src/components/movies/MovieList.jsx`)
- Redux store → User state: registers reducer (evidence: `src/utils/appStore.js`)
- Redux store → Catalog state: registers reducer (evidence: `src/utils/appStore.js`)
- Redux store → Details state: registers reducer (evidence: `src/utils/appStore.js`)
- Redux store → GPT state: registers reducer (evidence: `src/utils/appStore.js`)
- Redux store → Language state: registers reducer (evidence: `src/utils/appStore.js`)
- Recommendation search → Language labels: uses labels (evidence: `src/components/GptSearch/GptSearchBar.jsx`)
