# roopshaghosh/movie-ui architecture

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

- Interactive diagram: https://gitdiagram.com/roopshaghosh/movie-ui
- Repository: https://github.com/roopshaghosh/movie-ui

## Overview

This React movie browser lets users view popular movies, search TMDB, and save favorites. The app entry point provides shared favorite state and routes users between Home and Favourites; Home requests movie results and displays them as cards, whose controls update that shared state. Favorites are persisted in browser localStorage. Evidence is limited to the supplied excerpts; the favorites page excerpt appears to read `favourites`, while the context exposes `favorites`, so that connection is shown as an unverified state dependency.

Main entry points: [`frontend/src/App.jsx`](https://github.com/roopshaghosh/movie-ui/blob/main/frontend/src/App.jsx) (Routes and provider), [`frontend/src/pages/Home.jsx`](https://github.com/roopshaghosh/movie-ui/blob/main/frontend/src/pages/Home.jsx) (Home search), [`frontend/src/components/MovieCard.jsx`](https://github.com/roopshaghosh/movie-ui/blob/main/frontend/src/components/MovieCard.jsx) (Movie card), [`frontend/src/context/MovieContext.jsx`](https://github.com/roopshaghosh/movie-ui/blob/main/frontend/src/context/MovieContext.jsx) (Favorites context)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_navigation["App navigation"]
  node_entry["React entry<br/>[main.jsx]"]
  node_app["Routes and provider<br/>[App.jsx]"]
  node_navbar["Navigation bar<br/>[NavBar.jsx]"]
end

subgraph group_discovery["Movie discovery"]
  node_home["Home search<br/>[Home.jsx]"]
  node_api["Movie API client<br/>[api.js]"]
  node_tmdb["TMDB service"]
  node_card["Movie card<br/>[MovieCard.jsx]"]
end

subgraph group_saved["Favorites and state"]
  node_favorites["Favorites page<br/>[Favourites.jsx]"]
  node_context["Favorites context<br/>[MovieContext.jsx]"]
  node_storage[("Browser localStorage")]
end

node_user(("User"))

node_user -->|"opens app"| node_entry
node_entry -->|"renders"| node_app
node_app -->|"renders"| node_navbar
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_favorites
node_app -->|"provides state"| node_context
node_user -.->|"searches movies"| node_home
node_home -->|"requests results"| node_api
node_api -->|"fetches movies"| node_tmdb
node_home -->|"renders results"| node_card
node_user -.->|"toggles favorite"| node_card
node_card -->|"reads and updates"| node_context
node_favorites -.->|"reads favorites"| node_context
node_favorites -->|"renders saved"| node_card
node_context -->|"loads and saves"| node_storage

click node_entry "https://github.com/roopshaghosh/movie-ui/blob/main/frontend/src/main.jsx"
click node_app "https://github.com/roopshaghosh/movie-ui/blob/main/frontend/src/App.jsx"
click node_navbar "https://github.com/roopshaghosh/movie-ui/blob/main/frontend/src/components/NavBar.jsx"
click node_home "https://github.com/roopshaghosh/movie-ui/blob/main/frontend/src/pages/Home.jsx"
click node_api "https://github.com/roopshaghosh/movie-ui/blob/main/frontend/src/services/api.js"
click node_card "https://github.com/roopshaghosh/movie-ui/blob/main/frontend/src/components/MovieCard.jsx"
click node_favorites "https://github.com/roopshaghosh/movie-ui/blob/main/frontend/src/pages/Favourites.jsx"
click node_context "https://github.com/roopshaghosh/movie-ui/blob/main/frontend/src/context/MovieContext.jsx"

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_entry,node_app,node_navbar,node_user toneBlue
class node_home,node_api,node_tmdb,node_card toneAmber
class node_favorites,node_context,node_storage toneMint
```

## Components

### App navigation

- [React entry](https://github.com/roopshaghosh/movie-ui/blob/main/frontend/src/main.jsx): `frontend/src/main.jsx`
- [Routes and provider](https://github.com/roopshaghosh/movie-ui/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Navigation bar](https://github.com/roopshaghosh/movie-ui/blob/main/frontend/src/components/NavBar.jsx): `frontend/src/components/NavBar.jsx`

### Movie discovery

- [Home search](https://github.com/roopshaghosh/movie-ui/blob/main/frontend/src/pages/Home.jsx): `frontend/src/pages/Home.jsx`
- [Movie API client](https://github.com/roopshaghosh/movie-ui/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`
- **TMDB service**
- [Movie card](https://github.com/roopshaghosh/movie-ui/blob/main/frontend/src/components/MovieCard.jsx): `frontend/src/components/MovieCard.jsx`

### Favorites and state

- [Favorites page](https://github.com/roopshaghosh/movie-ui/blob/main/frontend/src/pages/Favourites.jsx): `frontend/src/pages/Favourites.jsx`
- [Favorites context](https://github.com/roopshaghosh/movie-ui/blob/main/frontend/src/context/MovieContext.jsx): `frontend/src/context/MovieContext.jsx`
- **Browser localStorage**

### Other components

- **User**

## Connections

- User → React entry: opens app (evidence: `frontend/src/main.jsx`)
- React entry → Routes and provider: renders (evidence: `frontend/src/main.jsx`)
- Routes and provider → Navigation bar: renders (evidence: `frontend/src/App.jsx`)
- Routes and provider → Home search: routes to (evidence: `frontend/src/App.jsx`)
- Routes and provider → Favorites page: routes to (evidence: `frontend/src/App.jsx`)
- Routes and provider → Favorites context: provides state (evidence: `frontend/src/App.jsx`)
- User → Home search: searches movies
- Home search → Movie API client: requests results (evidence: `frontend/src/pages/Home.jsx`)
- Movie API client → TMDB service: fetches movies (evidence: `frontend/src/services/api.js`)
- Home search → Movie card: renders results (evidence: `frontend/src/pages/Home.jsx`)
- User → Movie card: toggles favorite
- Movie card → Favorites context: reads and updates (evidence: `frontend/src/components/MovieCard.jsx`)
- Favorites page → Favorites context: reads favorites (evidence: `frontend/src/pages/Favourites.jsx`)
- Favorites page → Movie card: renders saved (evidence: `frontend/src/pages/Favourites.jsx`)
- Favorites context → Browser localStorage: loads and saves (evidence: `frontend/src/context/MovieContext.jsx`)
