# haileamlak-bekele/hb-movie-center architecture

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

- Interactive diagram: https://gitdiagram.com/haileamlak-bekele/hb-movie-center
- Repository: https://github.com/haileamlak-bekele/hb-movie-center

## Overview

HB-movie-center is a small browser-based movie discovery project using The Movie Database (TMDB). The visible user journey is to enter a title, view search results, open a movie’s details, and browse recommendations; a separate trending view fetches and displays trending titles. The repository also includes a server API handler for trending data and a shared request-options module, though the sampled trending script defines its own options. HTML-to-script wiring and other unsampled behavior are not asserted.

Main entry points: [`search.js`](https://github.com/haileamlak-bekele/hb-movie-center/blob/main/search.js) (Movie search), [`search-details.html`](https://github.com/haileamlak-bekele/hb-movie-center/blob/main/search-details.html) (Movie details page), [`search-detail.js`](https://github.com/haileamlak-bekele/hb-movie-center/blob/main/search-detail.js) (Movie details and recommendations), [`tranding-movies.js`](https://github.com/haileamlak-bekele/hb-movie-center/blob/main/tranding-movies.js) (Trending carousel)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Movie discovery"]
  node_search["Movie search<br/>[search.js]"]
  node_details["Movie details and recommendations<br/>[search-detail.js]"]
  node_trending["Trending carousel<br/>[tranding-movies.js]"]
  node_requestopts["Shared request options<br/>[apicallheader.js]"]
end

subgraph group_presentation["Browser presentation"]
  node_banner["Banner and search UI<br/>[bannner.js]"]
  node_results["Search results page<br/>[search-result.html]"]
  node_detailpage["Movie details page"]
  node_home["Home page<br/>[index.html]"]
end

subgraph group_server["Server API"]
  node_route["Trending API handler<br/>[movies.js]"]
end

node_user(("Movie viewer"))
node_tmdb{{"TMDB API"}}

node_user -->|"uses"| node_banner
node_banner -->|"navigates to"| node_search
node_search -->|"renders results"| node_results
node_search -->|"searches"| node_tmdb
node_search -->|"opens detail"| node_detailpage
node_details -->|"fetches details and recommendations"| node_tmdb
node_details -->|"renders detail"| node_detailpage
node_details -->|"links recommendations"| node_detailpage
node_trending -->|"fetches trending"| node_tmdb
node_trending -->|"opens detail"| node_detailpage
node_route -->|"fetches trending"| node_tmdb
node_requestopts -.->|"referenced by"| node_trending

click node_banner "https://github.com/haileamlak-bekele/hb-movie-center/blob/main/bannner.js"
click node_search "https://github.com/haileamlak-bekele/hb-movie-center/blob/main/search.js"
click node_results "https://github.com/haileamlak-bekele/hb-movie-center/blob/main/search-result.html"
click node_details "https://github.com/haileamlak-bekele/hb-movie-center/blob/main/search-detail.js"
click node_detailpage "https://github.com/haileamlak-bekele/hb-movie-center/blob/main/search-details.html"
click node_trending "https://github.com/haileamlak-bekele/hb-movie-center/blob/main/tranding-movies.js"
click node_home "https://github.com/haileamlak-bekele/hb-movie-center/blob/main/index.html"
click node_route "https://github.com/haileamlak-bekele/hb-movie-center/blob/main/api/movies.js"
click node_requestopts "https://github.com/haileamlak-bekele/hb-movie-center/blob/main/apicallheader.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_search,node_details,node_trending,node_requestopts,node_user toneBlue
class node_banner,node_results,node_detailpage,node_home toneAmber
class node_route,node_tmdb toneMint
```

## Components

### Movie discovery

- [Movie search](https://github.com/haileamlak-bekele/hb-movie-center/blob/main/search.js): `search.js`
- [Movie details and recommendations](https://github.com/haileamlak-bekele/hb-movie-center/blob/main/search-detail.js): `search-detail.js`
- [Trending carousel](https://github.com/haileamlak-bekele/hb-movie-center/blob/main/tranding-movies.js): `tranding-movies.js`
- [Shared request options](https://github.com/haileamlak-bekele/hb-movie-center/blob/main/apicallheader.js): `apicallheader.js`

### Browser presentation

- [Banner and search UI](https://github.com/haileamlak-bekele/hb-movie-center/blob/main/bannner.js): `bannner.js`
- [Search results page](https://github.com/haileamlak-bekele/hb-movie-center/blob/main/search-result.html): `search-result.html`
- [Movie details page](https://github.com/haileamlak-bekele/hb-movie-center/blob/main/search-details.html): `search-details.html`
- [Home page](https://github.com/haileamlak-bekele/hb-movie-center/blob/main/index.html): `index.html`

### Server API

- [Trending API handler](https://github.com/haileamlak-bekele/hb-movie-center/blob/main/api/movies.js): `api/movies.js`

### Other components

- **Movie viewer**
- **TMDB API**

## Connections

- Movie viewer → Banner and search UI: uses (evidence: `bannner.js`)
- Banner and search UI → Movie search: navigates to (evidence: `bannner.js`)
- Movie search → Search results page: renders results (evidence: `search.js`)
- Movie search → TMDB API: searches (evidence: `search.js`)
- Movie search → Movie details page: opens detail (evidence: `search.js`)
- Movie details and recommendations → TMDB API: fetches details and recommendations (evidence: `search-detail.js`)
- Movie details and recommendations → Movie details page: renders detail (evidence: `search-detail.js`)
- Movie details and recommendations → Movie details page: links recommendations (evidence: `search-detail.js`)
- Trending carousel → TMDB API: fetches trending (evidence: `tranding-movies.js`)
- Trending carousel → Movie details page: opens detail (evidence: `tranding-movies.js`)
- Trending API handler → TMDB API: fetches trending (evidence: `api/movies.js`)
- Shared request options → Trending carousel: referenced by (evidence: `tranding-movies.js`)
