# lazhari/react-movies-finder architecture

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

- Interactive diagram: https://gitdiagram.com/lazhari/react-movies-finder
- Repository: https://github.com/lazhari/react-movies-finder

## Overview

Screenbox is a Next.js movie and TV discovery app. Users browse or search titles, open detail pages, and explore related material; other flows support genre browsing, upcoming releases, actor and collection pages, season episodes, random picks, and shareable watchlists. App Router pages coordinate requests through server actions or the TMDB client and render reusable media components. The README documents major capabilities not fully represented in sampled source; those branches are included, with relationships left out where source evidence is unavailable.

Main entry points: [`src/lib/api/tmdb.ts`](https://github.com/lazhari/react-movies-finder/blob/master/src/lib/api/tmdb.ts) (TMDB Client), [`src/app/movies/[id]/page.tsx`](https://github.com/lazhari/react-movies-finder/blob/master/src/app/movies/%5Bid%5D/page.tsx) (Movie Details), [`src/app/tv/[id]/page.tsx`](https://github.com/lazhari/react-movies-finder/blob/master/src/app/tv/%5Bid%5D/page.tsx) (TV Details), [`src/app/search/page.tsx`](https://github.com/lazhari/react-movies-finder/blob/master/src/app/search/page.tsx) (Search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Discovery"]
  node_home["Home Feed<br/>[page.tsx]"]
  node_search["Search<br/>[page.tsx]"]
  node_surprise["Surprise Picker<br/>[page.tsx]"]
  node_surprise_actions["Picker Actions<br/>[actions.tsx]"]
  node_genres["Genre Browsing"]
  node_tv_browse["TV Browsing"]
  node_upcoming["Upcoming Titles<br/>[page.tsx]"]
  node_home_actions["Home Actions<br/>[actions.tsx]"]
  node_search_actions["Search Actions<br/>[actions.tsx]"]
end

subgraph group_details["Title Details"]
  node_movie_detail["Movie Details<br/>[page.tsx]"]
  node_movie_hero["Movie Hero<br/>[hero.tsx]"]
  node_reviews["Reviews<br/>[reviews.tsx]"]
  node_tv_detail["TV Details<br/>[page.tsx]"]
  node_tv_hero["TV Hero<br/>[hero.tsx]"]
  node_seasons["Season Episodes<br/>[page.tsx]"]
  node_actors["Actor Filmography<br/>[page.tsx]"]
  node_collections["Collections<br/>[page.tsx]"]
end

subgraph group_data["Data Access"]
  node_tmdb["TMDB Client<br/>[tmdb.ts]"]
  node_tmdb_service["TMDB API"]
end

subgraph group_shared["Shared UI And State"]
  node_watchlist["Watchlist<br/>[page.tsx]"]
  node_watchlist_state["Watchlist State<br/>[use-watchlist.ts]"]
  node_media_cards["Media Cards<br/>[media-card.tsx]"]
  node_media_carousel["Media Carousels<br/>[media-carousel.tsx]"]
  node_local_storage[("Browser Local Storage")]
end

node_visitor(("Viewer"))

node_visitor -->|"browses"| node_home
node_visitor -->|"searches"| node_search
node_visitor -->|"requests pick"| node_surprise
node_visitor -->|"browses genres"| node_genres
node_visitor -->|"browses TV"| node_tv_browse
node_visitor -->|"browses releases"| node_upcoming
node_visitor -->|"opens list"| node_watchlist
node_home -->|"loads feed"| node_home_actions
node_home_actions -->|"requests data"| node_tmdb
node_search -->|"renders results"| node_media_cards
node_search -.->|"calls search actions"| node_search_actions
node_surprise -->|"loads picks"| node_surprise_actions
node_surprise_actions -.->|"queries catalog"| node_tmdb
node_genres -->|"loads genres"| node_tmdb
node_tv_browse -->|"loads shows"| node_tmdb
node_upcoming -->|"loads releases"| node_tmdb
node_movie_detail -->|"renders hero"| node_movie_hero
node_movie_detail -->|"renders reviews"| node_reviews
node_movie_detail -->|"renders recommendations"| node_media_cards
node_movie_detail -.->|"loads details"| node_tmdb
node_tv_detail -->|"renders hero"| node_tv_hero
node_tv_detail -->|"presents seasons"| node_seasons
node_tv_detail -->|"renders reviews"| node_reviews
node_tv_detail -.->|"loads details"| node_tmdb
node_seasons -.->|"loads episodes"| node_tmdb
node_actors -.->|"loads filmography"| node_tmdb
node_collections -->|"loads collection"| node_tmdb
node_watchlist -->|"reads list"| node_watchlist_state
node_watchlist_state -.->|"persists locally"| node_local_storage
node_tmdb -->|"fetches JSON"| node_tmdb_service

click node_home "https://github.com/lazhari/react-movies-finder/blob/master/src/app/page.tsx"
click node_search "https://github.com/lazhari/react-movies-finder/blob/master/src/app/search/page.tsx"
click node_surprise "https://github.com/lazhari/react-movies-finder/blob/master/src/app/surprise/page.tsx"
click node_surprise_actions "https://github.com/lazhari/react-movies-finder/blob/master/src/app/surprise/actions.tsx"
click node_genres "https://github.com/lazhari/react-movies-finder/tree/master/src/app/genres"
click node_tv_browse "https://github.com/lazhari/react-movies-finder/tree/master/src/app/tv"
click node_upcoming "https://github.com/lazhari/react-movies-finder/blob/master/src/app/upcoming/page.tsx"
click node_movie_detail "https://github.com/lazhari/react-movies-finder/blob/master/src/app/movies/%5Bid%5D/page.tsx"
click node_movie_hero "https://github.com/lazhari/react-movies-finder/blob/master/src/components/movies/hero.tsx"
click node_reviews "https://github.com/lazhari/react-movies-finder/blob/master/src/components/movies/reviews.tsx"
click node_tv_detail "https://github.com/lazhari/react-movies-finder/blob/master/src/app/tv/%5Bid%5D/page.tsx"
click node_tv_hero "https://github.com/lazhari/react-movies-finder/blob/master/src/components/tv/hero.tsx"
click node_seasons "https://github.com/lazhari/react-movies-finder/blob/master/src/app/tv/%5Bid%5D/seasons/%5BseasonNumber%5D/page.tsx"
click node_actors "https://github.com/lazhari/react-movies-finder/blob/master/src/app/actors/%5Bid%5D/page.tsx"
click node_collections "https://github.com/lazhari/react-movies-finder/blob/master/src/app/collections/%5Bid%5D/page.tsx"
click node_watchlist "https://github.com/lazhari/react-movies-finder/blob/master/src/app/watchlist/page.tsx"
click node_watchlist_state "https://github.com/lazhari/react-movies-finder/blob/master/src/hooks/use-watchlist.ts"
click node_media_cards "https://github.com/lazhari/react-movies-finder/blob/master/src/components/media/media-card.tsx"
click node_media_carousel "https://github.com/lazhari/react-movies-finder/blob/master/src/components/media/media-carousel.tsx"
click node_home_actions "https://github.com/lazhari/react-movies-finder/blob/master/src/app/actions.tsx"
click node_tmdb "https://github.com/lazhari/react-movies-finder/blob/master/src/lib/api/tmdb.ts"
click node_search_actions "https://github.com/lazhari/react-movies-finder/blob/master/src/app/search/actions.tsx"

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_search,node_surprise,node_surprise_actions,node_genres,node_tv_browse,node_upcoming,node_home_actions,node_search_actions,node_visitor toneBlue
class node_movie_detail,node_movie_hero,node_reviews,node_tv_detail,node_tv_hero,node_seasons,node_actors,node_collections toneAmber
class node_tmdb,node_tmdb_service toneMint
class node_watchlist,node_watchlist_state,node_media_cards,node_media_carousel,node_local_storage toneRose
```

## Components

### Discovery

- [Home Feed](https://github.com/lazhari/react-movies-finder/blob/master/src/app/page.tsx): `src/app/page.tsx`
- [Search](https://github.com/lazhari/react-movies-finder/blob/master/src/app/search/page.tsx): `src/app/search/page.tsx`
- [Surprise Picker](https://github.com/lazhari/react-movies-finder/blob/master/src/app/surprise/page.tsx): `src/app/surprise/page.tsx`
- [Picker Actions](https://github.com/lazhari/react-movies-finder/blob/master/src/app/surprise/actions.tsx): `src/app/surprise/actions.tsx`
- [Genre Browsing](https://github.com/lazhari/react-movies-finder/tree/master/src/app/genres): `src/app/genres`
- [TV Browsing](https://github.com/lazhari/react-movies-finder/tree/master/src/app/tv): `src/app/tv`
- [Upcoming Titles](https://github.com/lazhari/react-movies-finder/blob/master/src/app/upcoming/page.tsx): `src/app/upcoming/page.tsx`
- [Home Actions](https://github.com/lazhari/react-movies-finder/blob/master/src/app/actions.tsx): `src/app/actions.tsx`
- [Search Actions](https://github.com/lazhari/react-movies-finder/blob/master/src/app/search/actions.tsx): `src/app/search/actions.tsx`

### Title Details

- [Movie Details](https://github.com/lazhari/react-movies-finder/blob/master/src/app/movies/%5Bid%5D/page.tsx): `src/app/movies/[id]/page.tsx`
- [Movie Hero](https://github.com/lazhari/react-movies-finder/blob/master/src/components/movies/hero.tsx): `src/components/movies/hero.tsx`
- [Reviews](https://github.com/lazhari/react-movies-finder/blob/master/src/components/movies/reviews.tsx): `src/components/movies/reviews.tsx`
- [TV Details](https://github.com/lazhari/react-movies-finder/blob/master/src/app/tv/%5Bid%5D/page.tsx): `src/app/tv/[id]/page.tsx`
- [TV Hero](https://github.com/lazhari/react-movies-finder/blob/master/src/components/tv/hero.tsx): `src/components/tv/hero.tsx`
- [Season Episodes](https://github.com/lazhari/react-movies-finder/blob/master/src/app/tv/%5Bid%5D/seasons/%5BseasonNumber%5D/page.tsx): `src/app/tv/[id]/seasons/[seasonNumber]/page.tsx`
- [Actor Filmography](https://github.com/lazhari/react-movies-finder/blob/master/src/app/actors/%5Bid%5D/page.tsx): `src/app/actors/[id]/page.tsx`
- [Collections](https://github.com/lazhari/react-movies-finder/blob/master/src/app/collections/%5Bid%5D/page.tsx): `src/app/collections/[id]/page.tsx`

### Data Access

- [TMDB Client](https://github.com/lazhari/react-movies-finder/blob/master/src/lib/api/tmdb.ts): `src/lib/api/tmdb.ts`
- **TMDB API**

### Shared UI And State

- [Watchlist](https://github.com/lazhari/react-movies-finder/blob/master/src/app/watchlist/page.tsx): `src/app/watchlist/page.tsx`
- [Watchlist State](https://github.com/lazhari/react-movies-finder/blob/master/src/hooks/use-watchlist.ts): `src/hooks/use-watchlist.ts`
- [Media Cards](https://github.com/lazhari/react-movies-finder/blob/master/src/components/media/media-card.tsx): `src/components/media/media-card.tsx`
- [Media Carousels](https://github.com/lazhari/react-movies-finder/blob/master/src/components/media/media-carousel.tsx): `src/components/media/media-carousel.tsx`
- **Browser Local Storage**

### Other components

- **Viewer**

## Connections

- Viewer → Home Feed: browses
- Viewer → Search: searches
- Viewer → Surprise Picker: requests pick
- Viewer → Genre Browsing: browses genres
- Viewer → TV Browsing: browses TV
- Viewer → Upcoming Titles: browses releases
- Viewer → Watchlist: opens list
- Home Feed → Home Actions: loads feed (evidence: `src/app/page.tsx`)
- Home Actions → TMDB Client: requests data (evidence: `src/app/actions.tsx`)
- Search → Media Cards: renders results (evidence: `src/app/search/page.tsx`)
- Search → Search Actions: calls search actions (evidence: `src/app/search/page.tsx`)
- Surprise Picker → Picker Actions: loads picks (evidence: `src/app/surprise/page.tsx`)
- Picker Actions → TMDB Client: queries catalog
- Genre Browsing → TMDB Client: loads genres (evidence: `src/app/genres/page.tsx`)
- TV Browsing → TMDB Client: loads shows (evidence: `src/app/tv/page.tsx`)
- Upcoming Titles → TMDB Client: loads releases (evidence: `src/app/upcoming/page.tsx`)
- Movie Details → Movie Hero: renders hero (evidence: `src/app/movies/[id]/page.tsx`)
- Movie Details → Reviews: renders reviews (evidence: `src/app/movies/[id]/page.tsx`)
- Movie Details → Media Cards: renders recommendations (evidence: `src/app/movies/[id]/page.tsx`)
- Movie Details → TMDB Client: loads details
- TV Details → TV Hero: renders hero (evidence: `src/app/tv/[id]/page.tsx`)
- TV Details → Season Episodes: presents seasons
- TV Details → Reviews: renders reviews (evidence: `src/app/tv/[id]/page.tsx`)
- TV Details → TMDB Client: loads details
- Season Episodes → TMDB Client: loads episodes
- Actor Filmography → TMDB Client: loads filmography
- Collections → TMDB Client: loads collection (evidence: `src/app/collections/[id]/page.tsx`)
- Watchlist → Watchlist State: reads list (evidence: `src/app/watchlist/page.tsx`)
- Watchlist State → Browser Local Storage: persists locally
- TMDB Client → TMDB API: fetches JSON (evidence: `src/lib/api/tmdb.ts`)
