# johanssonjacob/movie-list architecture

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

- Interactive diagram: https://gitdiagram.com/johanssonjacob/movie-list
- Repository: https://github.com/johanssonjacob/movie-list

## Overview

Kvällens film is a React movie-discovery app. Users browse popular films or search TMDb, open a film’s details and trailer, then optionally save it with a 1–5 hype rating and note; the watchlist supports search and sorting. Routing, page-level orchestration, fetch logic, TMDb access, reusable UI, and persistent shared watchlist state form the main layers. The map follows README capabilities and indexed imports; unsampled component internals are not inferred beyond those references.

Main entry points: [`src/App.jsx`](https://github.com/johanssonjacob/movie-list/blob/main/src/App.jsx) (Route shell), [`src/pages/HomePage.jsx`](https://github.com/johanssonjacob/movie-list/blob/main/src/pages/HomePage.jsx) (Browse movies), [`src/pages/MovieDetailPage.jsx`](https://github.com/johanssonjacob/movie-list/blob/main/src/pages/MovieDetailPage.jsx) (Movie details), [`src/pages/WatchlistPage.jsx`](https://github.com/johanssonjacob/movie-list/blob/main/src/pages/WatchlistPage.jsx) (My list)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and pages"]
  node_app["Route shell<br/>[App.jsx]"]
  node_home["Browse movies<br/>[HomePage.jsx]"]
  node_detail["Movie details"]
  node_watchpage["My list<br/>[WatchlistPage.jsx]"]
  node_navbar["Navigation bar<br/>[Navbar.jsx]"]
end

subgraph group_discovery["Movie discovery"]
  node_moviecard["Movie card<br/>[MovieCard.jsx]"]
  node_search["Search field<br/>[SearchBar.jsx]"]
  node_pagination["Pagination<br/>[Pagination.jsx]"]
  node_fetch["Fetch state<br/>[useFetch.js]"]
  node_movies["Movie query hook<br/>[useMovies.js]"]
  node_trailer["Trailer action<br/>[TrailerButton.jsx]"]
end

subgraph group_watchlist["Watchlist state"]
  node_watchbutton["Save movie form"]
  node_watchhook["Watchlist hook<br/>[useWatchlist.js]"]
  node_provider["Watchlist provider"]
  node_context["Watchlist context"]
  node_storage[("Local storage<br/>[useLocalStorage.js]")]
end

subgraph group_integrations["TMDb integration"]
  node_tmdb["TMDb client<br/>[tmdb.js]"]
  node_api["TMDb API"]
end

node_user(("Viewer"))

node_user -->|"opens"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_detail
node_app -->|"routes to"| node_watchpage
node_app -->|"wraps"| node_provider
node_app -->|"renders"| node_navbar
node_home -->|"queries via"| node_movies
node_home -->|"renders"| node_search
node_home -->|"renders"| node_moviecard
node_home -->|"renders"| node_pagination
node_movies -->|"loads through"| node_fetch
node_movies -->|"requests movies"| node_tmdb
node_detail -->|"loads through"| node_fetch
node_detail -->|"requests details"| node_tmdb
node_detail -->|"renders"| node_trailer
node_detail -->|"renders"| node_watchbutton
node_trailer -->|"requests videos"| node_tmdb
node_watchpage -->|"reads list"| node_watchhook
node_watchpage -->|"renders"| node_search
node_watchpage -->|"renders"| node_moviecard
node_watchpage -->|"renders"| node_pagination
node_watchbutton -->|"updates list"| node_watchhook
node_watchhook -->|"reads context"| node_context
node_provider -->|"provides state"| node_context
node_provider -->|"persists state"| node_storage
node_tmdb -->|"calls"| node_api

click node_app "https://github.com/johanssonjacob/movie-list/blob/main/src/App.jsx"
click node_home "https://github.com/johanssonjacob/movie-list/blob/main/src/pages/HomePage.jsx"
click node_detail "https://github.com/johanssonjacob/movie-list/blob/main/src/pages/MovieDetailPage.jsx"
click node_watchpage "https://github.com/johanssonjacob/movie-list/blob/main/src/pages/WatchlistPage.jsx"
click node_navbar "https://github.com/johanssonjacob/movie-list/blob/main/src/components/Navbar.jsx"
click node_moviecard "https://github.com/johanssonjacob/movie-list/blob/main/src/components/MovieCard.jsx"
click node_search "https://github.com/johanssonjacob/movie-list/blob/main/src/components/SearchBar.jsx"
click node_pagination "https://github.com/johanssonjacob/movie-list/blob/main/src/components/Pagination.jsx"
click node_fetch "https://github.com/johanssonjacob/movie-list/blob/main/src/hooks/useFetch.js"
click node_movies "https://github.com/johanssonjacob/movie-list/blob/main/src/hooks/useMovies.js"
click node_trailer "https://github.com/johanssonjacob/movie-list/blob/main/src/components/TrailerButton.jsx"
click node_watchbutton "https://github.com/johanssonjacob/movie-list/blob/main/src/components/WatchlistButton.jsx"
click node_watchhook "https://github.com/johanssonjacob/movie-list/blob/main/src/hooks/useWatchlist.js"
click node_provider "https://github.com/johanssonjacob/movie-list/blob/main/src/context/WatchlistContext.jsx"
click node_context "https://github.com/johanssonjacob/movie-list/blob/main/src/context/watchlist-context.js"
click node_storage "https://github.com/johanssonjacob/movie-list/blob/main/src/hooks/useLocalStorage.js"
click node_tmdb "https://github.com/johanssonjacob/movie-list/blob/main/src/services/tmdb.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_home,node_detail,node_watchpage,node_navbar,node_user toneBlue
class node_moviecard,node_search,node_pagination,node_fetch,node_movies,node_trailer toneAmber
class node_watchbutton,node_watchhook,node_provider,node_context,node_storage toneMint
class node_tmdb,node_api toneRose
```

## Components

### App and pages

- [Route shell](https://github.com/johanssonjacob/movie-list/blob/main/src/App.jsx): `src/App.jsx`
- [Browse movies](https://github.com/johanssonjacob/movie-list/blob/main/src/pages/HomePage.jsx): `src/pages/HomePage.jsx`
- [Movie details](https://github.com/johanssonjacob/movie-list/blob/main/src/pages/MovieDetailPage.jsx): `src/pages/MovieDetailPage.jsx`
- [My list](https://github.com/johanssonjacob/movie-list/blob/main/src/pages/WatchlistPage.jsx): `src/pages/WatchlistPage.jsx`
- [Navigation bar](https://github.com/johanssonjacob/movie-list/blob/main/src/components/Navbar.jsx): `src/components/Navbar.jsx`

### Movie discovery

- [Movie card](https://github.com/johanssonjacob/movie-list/blob/main/src/components/MovieCard.jsx): `src/components/MovieCard.jsx`
- [Search field](https://github.com/johanssonjacob/movie-list/blob/main/src/components/SearchBar.jsx): `src/components/SearchBar.jsx`
- [Pagination](https://github.com/johanssonjacob/movie-list/blob/main/src/components/Pagination.jsx): `src/components/Pagination.jsx`
- [Fetch state](https://github.com/johanssonjacob/movie-list/blob/main/src/hooks/useFetch.js): `src/hooks/useFetch.js`
- [Movie query hook](https://github.com/johanssonjacob/movie-list/blob/main/src/hooks/useMovies.js): `src/hooks/useMovies.js`
- [Trailer action](https://github.com/johanssonjacob/movie-list/blob/main/src/components/TrailerButton.jsx): `src/components/TrailerButton.jsx`

### Watchlist state

- [Save movie form](https://github.com/johanssonjacob/movie-list/blob/main/src/components/WatchlistButton.jsx): `src/components/WatchlistButton.jsx`
- [Watchlist hook](https://github.com/johanssonjacob/movie-list/blob/main/src/hooks/useWatchlist.js): `src/hooks/useWatchlist.js`
- [Watchlist provider](https://github.com/johanssonjacob/movie-list/blob/main/src/context/WatchlistContext.jsx): `src/context/WatchlistContext.jsx`
- [Watchlist context](https://github.com/johanssonjacob/movie-list/blob/main/src/context/watchlist-context.js): `src/context/watchlist-context.js`
- [Local storage](https://github.com/johanssonjacob/movie-list/blob/main/src/hooks/useLocalStorage.js): `src/hooks/useLocalStorage.js`

### TMDb integration

- [TMDb client](https://github.com/johanssonjacob/movie-list/blob/main/src/services/tmdb.js): `src/services/tmdb.js`
- **TMDb API**

### Other components

- **Viewer**

## Connections

- Viewer → Route shell: opens (evidence: `README.md`)
- Route shell → Browse movies: routes to (evidence: `src/App.jsx`)
- Route shell → Movie details: routes to (evidence: `src/App.jsx`)
- Route shell → My list: routes to (evidence: `src/App.jsx`)
- Route shell → Watchlist provider: wraps (evidence: `src/App.jsx`)
- Route shell → Navigation bar: renders (evidence: `src/App.jsx`)
- Browse movies → Movie query hook: queries via (evidence: `src/pages/HomePage.jsx`)
- Browse movies → Search field: renders (evidence: `src/pages/HomePage.jsx`)
- Browse movies → Movie card: renders (evidence: `src/pages/HomePage.jsx`)
- Browse movies → Pagination: renders (evidence: `src/pages/HomePage.jsx`)
- Movie query hook → Fetch state: loads through (evidence: `src/hooks/useMovies.js`)
- Movie query hook → TMDb client: requests movies (evidence: `src/hooks/useMovies.js`)
- Movie details → Fetch state: loads through (evidence: `src/pages/MovieDetailPage.jsx`)
- Movie details → TMDb client: requests details (evidence: `src/pages/MovieDetailPage.jsx`)
- Movie details → Trailer action: renders (evidence: `src/pages/MovieDetailPage.jsx`)
- Movie details → Save movie form: renders (evidence: `src/pages/MovieDetailPage.jsx`)
- Trailer action → TMDb client: requests videos (evidence: `src/components/TrailerButton.jsx`)
- My list → Watchlist hook: reads list (evidence: `src/pages/WatchlistPage.jsx`)
- My list → Search field: renders (evidence: `src/pages/WatchlistPage.jsx`)
- My list → Movie card: renders (evidence: `src/pages/WatchlistPage.jsx`)
- My list → Pagination: renders (evidence: `src/pages/WatchlistPage.jsx`)
- Save movie form → Watchlist hook: updates list (evidence: `src/components/WatchlistButton.jsx`)
- Watchlist hook → Watchlist context: reads context (evidence: `src/hooks/useWatchlist.js`)
- Watchlist provider → Watchlist context: provides state (evidence: `src/context/WatchlistContext.jsx`)
- Watchlist provider → Local storage: persists state (evidence: `src/context/WatchlistContext.jsx`)
- TMDb client → TMDb API: calls (evidence: `src/services/tmdb.js`)
