# ayushiee/nextflix architecture

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

- Interactive diagram: https://gitdiagram.com/ayushiee/nextflix
- Repository: https://github.com/ayushiee/nextflix

## Overview

Nextflix is a Netflix-style media browsing UI backed by TMDB data. The main workflow is browsing featured and categorized titles, fetching and displaying media, then opening a selected title’s details in a modal. The graph also includes the documented popular, trending, and discover feeds, plus navigation, responsive behavior, and shared UI state. Relationships follow the README and source index or shown excerpts; unsampled implementation details are not inferred.

Main entry points: [`pages/browse.tsx`](https://github.com/ayushiee/nextflix/blob/main/pages/browse.tsx) (Browse page), [`components/Navbar/index.tsx`](https://github.com/ayushiee/nextflix/blob/main/components/Navbar/index.tsx) (Navigation bar), [`components/Layout/index.tsx`](https://github.com/ayushiee/nextflix/blob/main/components/Layout/index.tsx) (Page layout), [`context/ModalContext.tsx`](https://github.com/ayushiee/nextflix/blob/main/context/ModalContext.tsx) (Modal state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Browsing experience"]
  node_browse["Browse page<br/>[browse.tsx]"]
  node_home["Home page<br/>[index.tsx]"]
  node_searchpage["Search page<br/>[search.tsx]"]
  node_banner["Featured title<br/>[index.tsx]"]
  node_lists["Title lists<br/>[index.tsx]"]
  node_cards["Title cards<br/>[Cards.tsx]"]
  node_featurecards["Ranked cards<br/>[FeatureCards.tsx]"]
  node_modal["Title details<br/>[index.tsx]"]
end

subgraph group_presentation["Shared presentation"]
  node_navbar["Navigation bar<br/>[index.tsx]"]
  node_menu["Navigation menu<br/>[Menu.tsx]"]
  node_profile["Profile menu<br/>[Profile.tsx]"]
  node_searchbar["Search controls<br/>[SearchBar.tsx]"]
  node_layout["Page layout<br/>[index.tsx]"]
  node_footer["Footer<br/>[index.tsx]"]
  node_button["Action button<br/>[index.tsx]"]
  node_dialog["Dialog behavior<br/>[Dialog.tsx]"]
end

subgraph group_feeds["Media feeds"]
  node_popular["Popular feed<br/>[popular.ts]"]
  node_trending["Trending feed<br/>[trending.ts]"]
  node_discover["Discover feed<br/>[discover.ts]"]
  node_resolver["Media resolver<br/>[apiResolvers.ts]"]
end

subgraph group_shared["Shared services"]
  node_axios["HTTP client<br/>[axios.ts]"]
  node_modalstate["Modal state<br/>[ModalContext.tsx]"]
  node_dimensions["Responsive sizing<br/>[useDimensions.ts]"]
  node_breakpoints["Breakpoint values<br/>[breakpoints.ts]"]
  node_genres["Genre mapping<br/>[genres.ts]"]
  node_routes["Route constants<br/>[route.ts]"]
  node_app["App provider<br/>[_app.tsx]"]
  node_icons["Icon exports<br/>[icons.ts]"]
  node_debounce["Debounce hook<br/>[useDebounce.tsx]"]
  node_outsideclick["Outside click"]
  node_scroll["Scroll limit<br/>[useScrollLimit.ts]"]
end

node_viewer(("Viewer"))
node_tmdb["TMDB service"]
node_api(("API request"))

node_viewer -->|"browses"| node_browse
node_viewer -->|"opens"| node_home
node_viewer -->|"opens"| node_searchpage
node_browse -->|"renders"| node_layout
node_browse -->|"renders"| node_banner
node_browse -->|"renders"| node_lists
node_browse -->|"renders"| node_modal
node_searchpage -->|"renders"| node_layout
node_banner -->|"requests popular"| node_api
node_api -.->|"routes request"| node_popular
node_lists -->|"requests endpoint"| node_api
node_api -.->|"routes request"| node_discover
node_api -.->|"routes request"| node_trending
node_lists -->|"renders cards"| node_cards
node_lists -->|"renders ranked cards"| node_featurecards
node_popular -->|"parses media"| node_resolver
node_trending -->|"parses media"| node_resolver
node_discover -->|"parses media"| node_resolver
node_popular -->|"fetches data"| node_axios
node_trending -->|"fetches data"| node_axios
node_discover -->|"fetches data"| node_axios
node_axios -.->|"requests media"| node_tmdb
node_resolver -->|"maps genres"| node_genres
node_banner -->|"sets selection"| node_modalstate
node_cards -->|"uses modal state"| node_modalstate
node_featurecards -->|"uses modal state"| node_modalstate
node_modal -->|"reads selection"| node_modalstate
node_app -->|"provides state"| node_modalstate
node_layout -->|"renders"| node_navbar
node_layout -->|"renders"| node_footer
node_layout -->|"reads scroll limit"| node_scroll
node_navbar -->|"renders"| node_menu
node_navbar -->|"renders"| node_profile
node_navbar -->|"renders"| node_searchbar
node_navbar -->|"reads dimensions"| node_dimensions
node_searchbar -->|"reads dimensions"| node_dimensions
node_searchbar -->|"closes on outside click"| node_outsideclick
node_menu -->|"uses dialog"| node_dialog
node_profile -->|"uses dialog"| node_dialog
node_dialog -->|"detects outside click"| node_outsideclick
node_dimensions -->|"uses thresholds"| node_breakpoints
node_home -->|"uses route constants"| node_routes
node_banner -->|"renders actions"| node_button
node_modal -->|"renders actions"| node_button
node_cards -->|"renders actions"| node_button
node_featurecards -->|"renders actions"| node_button

click node_browse "https://github.com/ayushiee/nextflix/blob/main/pages/browse.tsx"
click node_home "https://github.com/ayushiee/nextflix/blob/main/pages/index.tsx"
click node_searchpage "https://github.com/ayushiee/nextflix/blob/main/pages/search.tsx"
click node_banner "https://github.com/ayushiee/nextflix/blob/main/components/Banner/index.tsx"
click node_lists "https://github.com/ayushiee/nextflix/blob/main/components/List/index.tsx"
click node_cards "https://github.com/ayushiee/nextflix/blob/main/components/List/Cards.tsx"
click node_featurecards "https://github.com/ayushiee/nextflix/blob/main/components/List/FeatureCards.tsx"
click node_modal "https://github.com/ayushiee/nextflix/blob/main/components/Modal/index.tsx"
click node_navbar "https://github.com/ayushiee/nextflix/blob/main/components/Navbar/index.tsx"
click node_menu "https://github.com/ayushiee/nextflix/blob/main/components/Navbar/Menu.tsx"
click node_profile "https://github.com/ayushiee/nextflix/blob/main/components/Navbar/Profile.tsx"
click node_searchbar "https://github.com/ayushiee/nextflix/blob/main/components/Navbar/SearchBar.tsx"
click node_layout "https://github.com/ayushiee/nextflix/blob/main/components/Layout/index.tsx"
click node_footer "https://github.com/ayushiee/nextflix/blob/main/components/Footer/index.tsx"
click node_button "https://github.com/ayushiee/nextflix/blob/main/components/Button/index.tsx"
click node_dialog "https://github.com/ayushiee/nextflix/blob/main/components/Dialog.tsx"
click node_popular "https://github.com/ayushiee/nextflix/blob/main/pages/api/popular.ts"
click node_trending "https://github.com/ayushiee/nextflix/blob/main/pages/api/trending.ts"
click node_discover "https://github.com/ayushiee/nextflix/blob/main/pages/api/discover.ts"
click node_resolver "https://github.com/ayushiee/nextflix/blob/main/utils/apiResolvers.ts"
click node_axios "https://github.com/ayushiee/nextflix/blob/main/utils/axios.ts"
click node_modalstate "https://github.com/ayushiee/nextflix/blob/main/context/ModalContext.tsx"
click node_dimensions "https://github.com/ayushiee/nextflix/blob/main/hooks/useDimensions.ts"
click node_breakpoints "https://github.com/ayushiee/nextflix/blob/main/config/breakpoints.ts"
click node_genres "https://github.com/ayushiee/nextflix/blob/main/config/genres.ts"
click node_routes "https://github.com/ayushiee/nextflix/blob/main/config/route.ts"
click node_app "https://github.com/ayushiee/nextflix/blob/main/pages/_app.tsx"
click node_icons "https://github.com/ayushiee/nextflix/blob/main/utils/icons.ts"
click node_debounce "https://github.com/ayushiee/nextflix/blob/main/hooks/useDebounce.tsx"
click node_outsideclick "https://github.com/ayushiee/nextflix/blob/main/hooks/useExternalClick.ts"
click node_scroll "https://github.com/ayushiee/nextflix/blob/main/hooks/useScrollLimit.ts"

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_browse,node_home,node_searchpage,node_banner,node_lists,node_cards,node_featurecards,node_modal,node_viewer toneBlue
class node_navbar,node_menu,node_profile,node_searchbar,node_layout,node_footer,node_button,node_dialog toneAmber
class node_popular,node_trending,node_discover,node_resolver,node_api toneMint
class node_axios,node_modalstate,node_dimensions,node_breakpoints,node_genres,node_routes,node_app,node_icons,node_debounce,node_outsideclick,node_scroll toneRose
class node_tmdb toneIndigo
```

## Components

### Browsing experience

- [Browse page](https://github.com/ayushiee/nextflix/blob/main/pages/browse.tsx): `pages/browse.tsx`
- [Home page](https://github.com/ayushiee/nextflix/blob/main/pages/index.tsx): `pages/index.tsx`
- [Search page](https://github.com/ayushiee/nextflix/blob/main/pages/search.tsx): `pages/search.tsx`
- [Featured title](https://github.com/ayushiee/nextflix/blob/main/components/Banner/index.tsx): `components/Banner/index.tsx`
- [Title lists](https://github.com/ayushiee/nextflix/blob/main/components/List/index.tsx): `components/List/index.tsx`
- [Title cards](https://github.com/ayushiee/nextflix/blob/main/components/List/Cards.tsx): `components/List/Cards.tsx`
- [Ranked cards](https://github.com/ayushiee/nextflix/blob/main/components/List/FeatureCards.tsx): `components/List/FeatureCards.tsx`
- [Title details](https://github.com/ayushiee/nextflix/blob/main/components/Modal/index.tsx): `components/Modal/index.tsx`

### Shared presentation

- [Navigation bar](https://github.com/ayushiee/nextflix/blob/main/components/Navbar/index.tsx): `components/Navbar/index.tsx`
- [Navigation menu](https://github.com/ayushiee/nextflix/blob/main/components/Navbar/Menu.tsx): `components/Navbar/Menu.tsx`
- [Profile menu](https://github.com/ayushiee/nextflix/blob/main/components/Navbar/Profile.tsx): `components/Navbar/Profile.tsx`
- [Search controls](https://github.com/ayushiee/nextflix/blob/main/components/Navbar/SearchBar.tsx): `components/Navbar/SearchBar.tsx`
- [Page layout](https://github.com/ayushiee/nextflix/blob/main/components/Layout/index.tsx): `components/Layout/index.tsx`
- [Footer](https://github.com/ayushiee/nextflix/blob/main/components/Footer/index.tsx): `components/Footer/index.tsx`
- [Action button](https://github.com/ayushiee/nextflix/blob/main/components/Button/index.tsx): `components/Button/index.tsx`
- [Dialog behavior](https://github.com/ayushiee/nextflix/blob/main/components/Dialog.tsx): `components/Dialog.tsx`

### Media feeds

- [Popular feed](https://github.com/ayushiee/nextflix/blob/main/pages/api/popular.ts): `pages/api/popular.ts`
- [Trending feed](https://github.com/ayushiee/nextflix/blob/main/pages/api/trending.ts): `pages/api/trending.ts`
- [Discover feed](https://github.com/ayushiee/nextflix/blob/main/pages/api/discover.ts): `pages/api/discover.ts`
- [Media resolver](https://github.com/ayushiee/nextflix/blob/main/utils/apiResolvers.ts): `utils/apiResolvers.ts`

### Shared services

- [HTTP client](https://github.com/ayushiee/nextflix/blob/main/utils/axios.ts): `utils/axios.ts`
- [Modal state](https://github.com/ayushiee/nextflix/blob/main/context/ModalContext.tsx): `context/ModalContext.tsx`
- [Responsive sizing](https://github.com/ayushiee/nextflix/blob/main/hooks/useDimensions.ts): `hooks/useDimensions.ts`
- [Breakpoint values](https://github.com/ayushiee/nextflix/blob/main/config/breakpoints.ts): `config/breakpoints.ts`
- [Genre mapping](https://github.com/ayushiee/nextflix/blob/main/config/genres.ts): `config/genres.ts`
- [Route constants](https://github.com/ayushiee/nextflix/blob/main/config/route.ts): `config/route.ts`
- [App provider](https://github.com/ayushiee/nextflix/blob/main/pages/_app.tsx): `pages/_app.tsx`
- [Icon exports](https://github.com/ayushiee/nextflix/blob/main/utils/icons.ts): `utils/icons.ts`
- [Debounce hook](https://github.com/ayushiee/nextflix/blob/main/hooks/useDebounce.tsx): `hooks/useDebounce.tsx`
- [Outside click](https://github.com/ayushiee/nextflix/blob/main/hooks/useExternalClick.ts): `hooks/useExternalClick.ts`
- [Scroll limit](https://github.com/ayushiee/nextflix/blob/main/hooks/useScrollLimit.ts): `hooks/useScrollLimit.ts`

### Other components

- **Viewer**
- **TMDB service**
- **API request**

## Connections

- Viewer → Browse page: browses (evidence: `README.md`)
- Viewer → Home page: opens (evidence: `README.md`)
- Viewer → Search page: opens (evidence: `pages/search.tsx`)
- Browse page → Page layout: renders (evidence: `pages/browse.tsx`)
- Browse page → Featured title: renders (evidence: `pages/browse.tsx`)
- Browse page → Title lists: renders (evidence: `pages/browse.tsx`)
- Browse page → Title details: renders (evidence: `pages/browse.tsx`)
- Search page → Page layout: renders (evidence: `pages/search.tsx`)
- Featured title → API request: requests popular (evidence: `components/Banner/index.tsx`)
- API request → Popular feed: routes request
- Title lists → API request: requests endpoint (evidence: `components/List/index.tsx`)
- API request → Discover feed: routes request
- API request → Trending feed: routes request
- Title lists → Title cards: renders cards (evidence: `components/List/index.tsx`)
- Title lists → Ranked cards: renders ranked cards (evidence: `components/List/index.tsx`)
- Popular feed → Media resolver: parses media (evidence: `pages/api/popular.ts`)
- Trending feed → Media resolver: parses media (evidence: `pages/api/trending.ts`)
- Discover feed → Media resolver: parses media (evidence: `pages/api/discover.ts`)
- Popular feed → HTTP client: fetches data (evidence: `pages/api/popular.ts`)
- Trending feed → HTTP client: fetches data (evidence: `pages/api/trending.ts`)
- Discover feed → HTTP client: fetches data (evidence: `pages/api/discover.ts`)
- HTTP client → TMDB service: requests media
- Media resolver → Genre mapping: maps genres (evidence: `utils/apiResolvers.ts`)
- Featured title → Modal state: sets selection (evidence: `components/Banner/index.tsx`)
- Title cards → Modal state: uses modal state (evidence: `components/List/Cards.tsx`)
- Ranked cards → Modal state: uses modal state (evidence: `components/List/FeatureCards.tsx`)
- Title details → Modal state: reads selection (evidence: `components/Modal/index.tsx`)
- App provider → Modal state: provides state (evidence: `pages/_app.tsx`)
- Page layout → Navigation bar: renders (evidence: `components/Layout/index.tsx`)
- Page layout → Footer: renders (evidence: `components/Layout/index.tsx`)
- Page layout → Scroll limit: reads scroll limit (evidence: `components/Layout/index.tsx`)
- Navigation bar → Navigation menu: renders (evidence: `components/Navbar/index.tsx`)
- Navigation bar → Profile menu: renders (evidence: `components/Navbar/index.tsx`)
- Navigation bar → Search controls: renders (evidence: `components/Navbar/index.tsx`)
- Navigation bar → Responsive sizing: reads dimensions (evidence: `components/Navbar/index.tsx`)
- Search controls → Responsive sizing: reads dimensions (evidence: `components/Navbar/SearchBar.tsx`)
- Search controls → Outside click: closes on outside click (evidence: `components/Navbar/SearchBar.tsx`)
- Navigation menu → Dialog behavior: uses dialog (evidence: `components/Navbar/Menu.tsx`)
- Profile menu → Dialog behavior: uses dialog (evidence: `components/Navbar/Profile.tsx`)
- Dialog behavior → Outside click: detects outside click (evidence: `components/Dialog.tsx`)
- Responsive sizing → Breakpoint values: uses thresholds (evidence: `hooks/useDimensions.ts`)
- Home page → Route constants: uses route constants (evidence: `pages/index.tsx`)
- Featured title → Action button: renders actions (evidence: `components/Banner/index.tsx`)
- Title details → Action button: renders actions (evidence: `components/Modal/index.tsx`)
- Title cards → Action button: renders actions (evidence: `components/List/Cards.tsx`)
- Ranked cards → Action button: renders actions (evidence: `components/List/FeatureCards.tsx`)
