# kulagama/movie-finder architecture

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

- Interactive diagram: https://gitdiagram.com/kulagama/movie-finder
- Repository: https://github.com/kulagama/movie-finder

## Overview

Movie Finder lets users browse movies or TV shows by genre and search for titles or keywords. Users choose a media type in the navigation, then the start page fetches genre-grouped results and renders carousels of media cards; search submits to a results page that fetches and displays matching cards. API routes retrieve and normalize data from TMDb, while cards link to TMDb titles. The graph covers these workflows and the shared app shell. Source excerpts show route calls and rendering; unsampled details are omitted.

Main entry points: [`app/api/media-by-genres/route.ts`](https://github.com/kulagama/movie-finder/blob/main/app/api/media-by-genres/route.ts) (Genre media API), [`app/api/search/route.ts`](https://github.com/kulagama/movie-finder/blob/main/app/api/search/route.ts) (Search API), [`app/layout.tsx`](https://github.com/kulagama/movie-finder/blob/main/app/layout.tsx) (App shell), [`app/(start)/page.tsx`](https://github.com/kulagama/movie-finder/blob/main/app/(start)/page.tsx) (Genre browsing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_navigation["Navigation and shell"]
  node_layout["App shell<br/>[layout.tsx]"]
  node_navigation_bar["Media navigation<br/>[index.tsx]"]
  node_search_box["Search input<br/>[index.tsx]"]
end

subgraph group_discovery["Browse and search"]
  node_start_page["Genre browsing<br/>[page.tsx]"]
  node_carousel["Genre carousel<br/>[index.tsx]"]
  node_results_page["Search results<br/>[page.tsx]"]
end

subgraph group_data["Media data"]
  node_genre_api["Genre media API<br/>[route.ts]"]
  node_search_api["Search API<br/>[route.ts]"]
  node_tmdb_api{{"TMDb API"}}
  node_tmdb_images{{"TMDb images"}}
  node_media_types["Media definitions<br/>[definitions.ts]"]
  node_api_constants["API constants<br/>[constants.ts]"]
end

subgraph group_presentation["Presentation"]
  node_media_card["Media card<br/>[index.tsx]"]
  node_info_badge["Info badge<br/>[index.tsx]"]
  node_footer["Footer<br/>[index.tsx]"]
  node_theme["UI theme<br/>[theme.ts]"]
end

node_visitor(("Visitor"))
node_tmdb_title{{"TMDb title pages"}}

node_visitor -->|"chooses type"| node_navigation_bar
node_visitor -->|"enters query"| node_search_box
node_navigation_bar -->|"routes to"| node_start_page
node_search_box -->|"routes to"| node_results_page
node_layout -->|"renders"| node_navigation_bar
node_layout -->|"renders"| node_search_box
node_layout -->|"renders"| node_footer
node_layout -->|"configures"| node_theme
node_start_page -->|"fetches"| node_genre_api
node_start_page -->|"renders"| node_carousel
node_start_page -->|"renders"| node_media_card
node_results_page -->|"fetches"| node_search_api
node_results_page -->|"renders"| node_media_card
node_genre_api -->|"fetches genres"| node_tmdb_api
node_search_api -->|"fetches search"| node_tmdb_api
node_genre_api -->|"uses config"| node_api_constants
node_search_api -->|"uses config"| node_api_constants
node_genre_api -->|"maps responses"| node_media_types
node_search_api -->|"maps responses"| node_media_types
node_genre_api -->|"builds image URLs"| node_tmdb_images
node_search_api -->|"builds image URLs"| node_tmdb_images
node_media_card -->|"renders"| node_info_badge
node_media_card -->|"links to"| node_tmdb_title

click node_layout "https://github.com/kulagama/movie-finder/blob/main/app/layout.tsx"
click node_navigation_bar "https://github.com/kulagama/movie-finder/blob/main/app/components/NavigationBar/index.tsx"
click node_search_box "https://github.com/kulagama/movie-finder/blob/main/app/components/SearchBox/index.tsx"
click node_start_page "https://github.com/kulagama/movie-finder/blob/main/app/(start)/page.tsx"
click node_carousel "https://github.com/kulagama/movie-finder/blob/main/app/(start)/components/ClientCarousel/index.tsx"
click node_results_page "https://github.com/kulagama/movie-finder/blob/main/app/results/page.tsx"
click node_genre_api "https://github.com/kulagama/movie-finder/blob/main/app/api/media-by-genres/route.ts"
click node_search_api "https://github.com/kulagama/movie-finder/blob/main/app/api/search/route.ts"
click node_media_types "https://github.com/kulagama/movie-finder/blob/main/app/lib/definitions.ts"
click node_api_constants "https://github.com/kulagama/movie-finder/blob/main/app/lib/constants.ts"
click node_media_card "https://github.com/kulagama/movie-finder/blob/main/app/components/MediaCard/index.tsx"
click node_info_badge "https://github.com/kulagama/movie-finder/blob/main/app/components/MediaCard/components/InfoBadge/index.tsx"
click node_footer "https://github.com/kulagama/movie-finder/blob/main/app/components/Footer/index.tsx"
click node_theme "https://github.com/kulagama/movie-finder/blob/main/theme.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_layout,node_navigation_bar,node_search_box toneBlue
class node_start_page,node_carousel,node_results_page toneAmber
class node_genre_api,node_search_api,node_tmdb_api,node_tmdb_images,node_media_types,node_api_constants toneMint
class node_media_card,node_info_badge,node_footer,node_theme toneRose
class node_visitor,node_tmdb_title toneIndigo
```

## Components

### Navigation and shell

- [App shell](https://github.com/kulagama/movie-finder/blob/main/app/layout.tsx): `app/layout.tsx`
- [Media navigation](https://github.com/kulagama/movie-finder/blob/main/app/components/NavigationBar/index.tsx): `app/components/NavigationBar/index.tsx`
- [Search input](https://github.com/kulagama/movie-finder/blob/main/app/components/SearchBox/index.tsx): `app/components/SearchBox/index.tsx`

### Browse and search

- [Genre browsing](https://github.com/kulagama/movie-finder/blob/main/app/(start)/page.tsx): `app/(start)/page.tsx`
- [Genre carousel](https://github.com/kulagama/movie-finder/blob/main/app/(start)/components/ClientCarousel/index.tsx): `app/(start)/components/ClientCarousel/index.tsx`
- [Search results](https://github.com/kulagama/movie-finder/blob/main/app/results/page.tsx): `app/results/page.tsx`

### Media data

- [Genre media API](https://github.com/kulagama/movie-finder/blob/main/app/api/media-by-genres/route.ts): `app/api/media-by-genres/route.ts`
- [Search API](https://github.com/kulagama/movie-finder/blob/main/app/api/search/route.ts): `app/api/search/route.ts`
- **TMDb API**
- **TMDb images**
- [Media definitions](https://github.com/kulagama/movie-finder/blob/main/app/lib/definitions.ts): `app/lib/definitions.ts`
- [API constants](https://github.com/kulagama/movie-finder/blob/main/app/lib/constants.ts): `app/lib/constants.ts`

### Presentation

- [Media card](https://github.com/kulagama/movie-finder/blob/main/app/components/MediaCard/index.tsx): `app/components/MediaCard/index.tsx`
- [Info badge](https://github.com/kulagama/movie-finder/blob/main/app/components/MediaCard/components/InfoBadge/index.tsx): `app/components/MediaCard/components/InfoBadge/index.tsx`
- [Footer](https://github.com/kulagama/movie-finder/blob/main/app/components/Footer/index.tsx): `app/components/Footer/index.tsx`
- [UI theme](https://github.com/kulagama/movie-finder/blob/main/theme.ts): `theme.ts`

### Other components

- **Visitor**
- **TMDb title pages**

## Connections

- Visitor → Media navigation: chooses type (evidence: `app/components/NavigationBar/index.tsx`)
- Visitor → Search input: enters query (evidence: `app/components/SearchBox/index.tsx`)
- Media navigation → Genre browsing: routes to (evidence: `app/components/NavigationBar/index.tsx`)
- Search input → Search results: routes to (evidence: `app/components/SearchBox/index.tsx`)
- App shell → Media navigation: renders (evidence: `app/layout.tsx`)
- App shell → Search input: renders (evidence: `app/layout.tsx`)
- App shell → Footer: renders (evidence: `app/layout.tsx`)
- App shell → UI theme: configures (evidence: `app/layout.tsx`)
- Genre browsing → Genre media API: fetches (evidence: `app/(start)/page.tsx`)
- Genre browsing → Genre carousel: renders (evidence: `app/(start)/page.tsx`)
- Genre browsing → Media card: renders (evidence: `app/(start)/page.tsx`)
- Search results → Search API: fetches (evidence: `app/results/page.tsx`)
- Search results → Media card: renders (evidence: `app/results/page.tsx`)
- Genre media API → TMDb API: fetches genres (evidence: `app/api/media-by-genres/route.ts`)
- Search API → TMDb API: fetches search (evidence: `app/api/search/route.ts`)
- Genre media API → API constants: uses config (evidence: `app/api/media-by-genres/route.ts`)
- Search API → API constants: uses config (evidence: `app/api/search/route.ts`)
- Genre media API → Media definitions: maps responses (evidence: `app/api/media-by-genres/route.ts`)
- Search API → Media definitions: maps responses (evidence: `app/api/search/route.ts`)
- Genre media API → TMDb images: builds image URLs (evidence: `app/api/media-by-genres/route.ts`)
- Search API → TMDb images: builds image URLs (evidence: `app/api/search/route.ts`)
- Media card → Info badge: renders (evidence: `app/components/MediaCard/index.tsx`)
- Media card → TMDb title pages: links to (evidence: `app/components/MediaCard/index.tsx`)
