# pisethmao/05_pvh_mao_piseth_web_hm007_data_fetching architecture

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

- Interactive diagram: https://gitdiagram.com/pisethmao/05_pvh_mao_piseth_web_hm007_data_fetching
- Repository: https://github.com/pisethmao/05_pvh_mao_piseth_web_hm007_data_fetching

## Overview

This is a Next.js movie-browsing app: visitors land on a home page with all-movie and genre-specific listings, then can open a movie detail page showing its metadata and rating. The root layout adds the navigation bar. Listing and detail components obtain data through a shared movie service, which fetches from an external movie API. The sampled code establishes these component calls and the detail lookup; other category components are included based on the source index, but their internal rendering was not sampled.

Main entry points: [`src/app/page.js`](https://github.com/pisethmao/05_pvh_mao_piseth_web_hm007_data_fetching/blob/master/src/app/page.js) (Home page), [`src/services/movie.service.js`](https://github.com/pisethmao/05_pvh_mao_piseth_web_hm007_data_fetching/blob/master/src/services/movie.service.js) (Movie service), [`src/app/view-movie-details/[movieId]/page.jsx`](https://github.com/pisethmao/05_pvh_mao_piseth_web_hm007_data_fetching/blob/master/src/app/view-movie-details/%5BmovieId%5D/page.jsx) (Movie detail page), [`src/components/CardActionComponent.jsx`](https://github.com/pisethmao/05_pvh_mao_piseth_web_hm007_data_fetching/blob/master/src/components/CardActionComponent.jsx) (Action movies)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shell["App shell"]
  node_layout["Root layout<br/>[layout.js]"]
  node_navbar["Navigation bar"]
end

subgraph group_discovery["Movie discovery"]
  node_home["Home page<br/>[page.js]"]
  node_all["All movies<br/>[CardComponent.jsx]"]
  node_action["Action movies"]
  node_drama["Drama movies"]
  node_sciencefiction["Sci-fi movies"]
  node_hollywood["Hollywood movies"]
  node_anime["Anime movies"]
end

subgraph group_details["Movie details"]
  node_moviepage["Movie detail page<br/>[page.jsx]"]
  node_rating["Star rating<br/>[StarRating.jsx]"]
end

subgraph group_data["Movie data"]
  node_service["Movie service<br/>[movie.service.js]"]
  node_api["Movie API"]
end

node_visitor(("Visitor"))

node_visitor -.->|"opens"| node_home
node_layout -->|"renders"| node_navbar
node_home -->|"renders"| node_all
node_home -->|"renders"| node_action
node_home -->|"renders"| node_drama
node_home -->|"renders"| node_sciencefiction
node_home -->|"renders"| node_hollywood
node_home -->|"renders"| node_anime
node_all -->|"fetches all"| node_service
node_action -->|"fetches genre"| node_service
node_drama -->|"fetches genre"| node_service
node_sciencefiction -->|"fetches genre"| node_service
node_hollywood -->|"fetches genre"| node_service
node_anime -->|"fetches genre"| node_service
node_action -->|"links to"| node_moviepage
node_sciencefiction -->|"links to"| node_moviepage
node_moviepage -->|"loads movie"| node_service
node_moviepage -->|"renders"| node_rating
node_service -->|"fetches data"| node_api

click node_layout "https://github.com/pisethmao/05_pvh_mao_piseth_web_hm007_data_fetching/blob/master/src/app/layout.js"
click node_navbar "https://github.com/pisethmao/05_pvh_mao_piseth_web_hm007_data_fetching/blob/master/src/components/NavbarComponent.jsx"
click node_home "https://github.com/pisethmao/05_pvh_mao_piseth_web_hm007_data_fetching/blob/master/src/app/page.js"
click node_all "https://github.com/pisethmao/05_pvh_mao_piseth_web_hm007_data_fetching/blob/master/src/components/CardComponent.jsx"
click node_action "https://github.com/pisethmao/05_pvh_mao_piseth_web_hm007_data_fetching/blob/master/src/components/CardActionComponent.jsx"
click node_drama "https://github.com/pisethmao/05_pvh_mao_piseth_web_hm007_data_fetching/blob/master/src/components/CardDramaComponent.jsx"
click node_sciencefiction "https://github.com/pisethmao/05_pvh_mao_piseth_web_hm007_data_fetching/blob/master/src/components/CardScienceFictionComponent.jsx"
click node_hollywood "https://github.com/pisethmao/05_pvh_mao_piseth_web_hm007_data_fetching/blob/master/src/components/CardHollywoodComponent.jsx"
click node_anime "https://github.com/pisethmao/05_pvh_mao_piseth_web_hm007_data_fetching/blob/master/src/components/CardAnimeComponent.jsx"
click node_moviepage "https://github.com/pisethmao/05_pvh_mao_piseth_web_hm007_data_fetching/blob/master/src/app/view-movie-details/%5BmovieId%5D/page.jsx"
click node_rating "https://github.com/pisethmao/05_pvh_mao_piseth_web_hm007_data_fetching/blob/master/src/app/view-movie-details/%5BmovieId%5D/StarRating.jsx"
click node_service "https://github.com/pisethmao/05_pvh_mao_piseth_web_hm007_data_fetching/blob/master/src/services/movie.service.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_layout,node_navbar toneBlue
class node_home,node_all,node_action,node_drama,node_sciencefiction,node_hollywood,node_anime toneAmber
class node_moviepage,node_rating toneMint
class node_service,node_api toneRose
class node_visitor toneIndigo
```

## Components

### App shell

- [Root layout](https://github.com/pisethmao/05_pvh_mao_piseth_web_hm007_data_fetching/blob/master/src/app/layout.js): `src/app/layout.js`
- [Navigation bar](https://github.com/pisethmao/05_pvh_mao_piseth_web_hm007_data_fetching/blob/master/src/components/NavbarComponent.jsx): `src/components/NavbarComponent.jsx`

### Movie discovery

- [Home page](https://github.com/pisethmao/05_pvh_mao_piseth_web_hm007_data_fetching/blob/master/src/app/page.js): `src/app/page.js`
- [All movies](https://github.com/pisethmao/05_pvh_mao_piseth_web_hm007_data_fetching/blob/master/src/components/CardComponent.jsx): `src/components/CardComponent.jsx`
- [Action movies](https://github.com/pisethmao/05_pvh_mao_piseth_web_hm007_data_fetching/blob/master/src/components/CardActionComponent.jsx): `src/components/CardActionComponent.jsx`
- [Drama movies](https://github.com/pisethmao/05_pvh_mao_piseth_web_hm007_data_fetching/blob/master/src/components/CardDramaComponent.jsx): `src/components/CardDramaComponent.jsx`
- [Sci-fi movies](https://github.com/pisethmao/05_pvh_mao_piseth_web_hm007_data_fetching/blob/master/src/components/CardScienceFictionComponent.jsx): `src/components/CardScienceFictionComponent.jsx`
- [Hollywood movies](https://github.com/pisethmao/05_pvh_mao_piseth_web_hm007_data_fetching/blob/master/src/components/CardHollywoodComponent.jsx): `src/components/CardHollywoodComponent.jsx`
- [Anime movies](https://github.com/pisethmao/05_pvh_mao_piseth_web_hm007_data_fetching/blob/master/src/components/CardAnimeComponent.jsx): `src/components/CardAnimeComponent.jsx`

### Movie details

- [Movie detail page](https://github.com/pisethmao/05_pvh_mao_piseth_web_hm007_data_fetching/blob/master/src/app/view-movie-details/%5BmovieId%5D/page.jsx): `src/app/view-movie-details/[movieId]/page.jsx`
- [Star rating](https://github.com/pisethmao/05_pvh_mao_piseth_web_hm007_data_fetching/blob/master/src/app/view-movie-details/%5BmovieId%5D/StarRating.jsx): `src/app/view-movie-details/[movieId]/StarRating.jsx`

### Movie data

- [Movie service](https://github.com/pisethmao/05_pvh_mao_piseth_web_hm007_data_fetching/blob/master/src/services/movie.service.js): `src/services/movie.service.js`
- **Movie API**

### Other components

- **Visitor**

## Connections

- Visitor → Home page: opens
- Root layout → Navigation bar: renders (evidence: `src/app/layout.js`)
- Home page → All movies: renders (evidence: `src/app/page.js`)
- Home page → Action movies: renders (evidence: `src/app/page.js`)
- Home page → Drama movies: renders (evidence: `src/app/page.js`)
- Home page → Sci-fi movies: renders (evidence: `src/app/page.js`)
- Home page → Hollywood movies: renders (evidence: `src/app/page.js`)
- Home page → Anime movies: renders (evidence: `src/app/page.js`)
- All movies → Movie service: fetches all (evidence: `src/components/CardComponent.jsx`)
- Action movies → Movie service: fetches genre (evidence: `src/components/CardActionComponent.jsx`)
- Drama movies → Movie service: fetches genre (evidence: `src/components/CardDramaComponent.jsx`)
- Sci-fi movies → Movie service: fetches genre (evidence: `src/components/CardScienceFictionComponent.jsx`)
- Hollywood movies → Movie service: fetches genre (evidence: `src/components/CardHollywoodComponent.jsx`)
- Anime movies → Movie service: fetches genre (evidence: `src/components/CardAnimeComponent.jsx`)
- Action movies → Movie detail page: links to (evidence: `src/components/CardActionComponent.jsx`)
- Sci-fi movies → Movie detail page: links to (evidence: `src/components/CardScienceFictionComponent.jsx`)
- Movie detail page → Movie service: loads movie (evidence: `src/app/view-movie-details/[movieId]/page.jsx`)
- Movie detail page → Star rating: renders (evidence: `src/app/view-movie-details/[movieId]/page.jsx`)
- Movie service → Movie API: fetches data (evidence: `src/services/movie.service.js`)
