# kiranatyam-05/usepopcorn-modern architecture

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

- Interactive diagram: https://gitdiagram.com/kiranatyam-05/usepopcorn-modern
- Repository: https://github.com/kiranatyam-05/usepopcorn-modern

## Overview

usePopcorn is a React movie-discovery and personal watchlist app. A user searches titles, inspects a selected movie, rates it, and saves or removes it from a locally persisted watched list. The main app also includes a simulated registration/login flow. The README documents App_v2.js as an alternate, not the entry point shown in index.js. Edges reflect the sampled calls and explicit README capabilities; UI stages implemented inside App.js share its path.

Main entry points: [`src/App.js`](https://github.com/kiranatyam-05/usepopcorn-modern/blob/main/src/App.js) (Movie dashboard), [`src/App_v2.js`](https://github.com/kiranatyam-05/usepopcorn-modern/blob/main/src/App_v2.js) (Alternate app), [`src/AuthContext.js`](https://github.com/kiranatyam-05/usepopcorn-modern/blob/main/src/AuthContext.js) (Auth provider), [`src/index.js`](https://github.com/kiranatyam-05/usepopcorn-modern/blob/main/src/index.js) (React entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Movie experience"]
  node_entry["React entry<br/>[index.js]"]
  node_app["Movie dashboard<br/>[App.js]"]
  node_alternate["Alternate app<br/>[App_v2.js]"]
  node_search["Movie search<br/>[useMovies.js]"]
  node_rating["Star rating<br/>[StarRating.js]"]
  node_shortcuts["Keyboard shortcuts<br/>[useKey.js]"]
end

subgraph group_persistence["Local state"]
  node_watched["Watched state"]
  node_storage[("Browser storage")]
end

subgraph group_accounts["Simulated accounts"]
  node_auth["Auth provider<br/>[AuthContext.js]"]
  node_login["Login form<br/>[Login.js]"]
  node_registration["Registration form<br/>[Registration.js]"]
end

node_user(("Movie fan"))
node_omdb{{"OMDb API"}}

node_user -->|"opens app"| node_entry
node_entry -->|"renders"| node_app
node_entry -->|"wraps app"| node_auth
node_user -.->|"searches and rates"| node_app
node_app -->|"queries"| node_search
node_search -->|"fetches results"| node_omdb
node_app -->|"fetches details"| node_omdb
node_app -->|"renders"| node_rating
node_app -->|"registers keys"| node_shortcuts
node_app -->|"reads and updates"| node_watched
node_watched -->|"persists list"| node_storage
node_auth -->|"persists accounts"| node_storage
node_app -->|"reads auth state"| node_auth
node_app -->|"renders"| node_login
node_app -->|"renders"| node_registration
node_login -->|"calls login"| node_auth
node_registration -->|"calls register"| node_auth
node_alternate -->|"queries"| node_search
node_alternate -->|"reads and updates"| node_watched
node_alternate -->|"renders"| node_rating
node_alternate -->|"uses provider"| node_auth
node_alternate -->|"renders"| node_login
node_alternate -->|"renders"| node_registration

click node_entry "https://github.com/kiranatyam-05/usepopcorn-modern/blob/main/src/index.js"
click node_app "https://github.com/kiranatyam-05/usepopcorn-modern/blob/main/src/App.js"
click node_alternate "https://github.com/kiranatyam-05/usepopcorn-modern/blob/main/src/App_v2.js"
click node_search "https://github.com/kiranatyam-05/usepopcorn-modern/blob/main/src/useMovies.js"
click node_rating "https://github.com/kiranatyam-05/usepopcorn-modern/blob/main/src/StarRating.js"
click node_shortcuts "https://github.com/kiranatyam-05/usepopcorn-modern/blob/main/src/useKey.js"
click node_watched "https://github.com/kiranatyam-05/usepopcorn-modern/blob/main/src/useLocalStorageState.js"
click node_auth "https://github.com/kiranatyam-05/usepopcorn-modern/blob/main/src/AuthContext.js"
click node_login "https://github.com/kiranatyam-05/usepopcorn-modern/blob/main/src/Login.js"
click node_registration "https://github.com/kiranatyam-05/usepopcorn-modern/blob/main/src/Registration.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_entry,node_app,node_alternate,node_search,node_rating,node_shortcuts toneBlue
class node_watched,node_storage toneAmber
class node_auth,node_login,node_registration,node_omdb toneMint
class node_user toneIndigo
```

## Components

### Movie experience

- [React entry](https://github.com/kiranatyam-05/usepopcorn-modern/blob/main/src/index.js): `src/index.js`
- [Movie dashboard](https://github.com/kiranatyam-05/usepopcorn-modern/blob/main/src/App.js): `src/App.js`
- [Alternate app](https://github.com/kiranatyam-05/usepopcorn-modern/blob/main/src/App_v2.js): `src/App_v2.js`
- [Movie search](https://github.com/kiranatyam-05/usepopcorn-modern/blob/main/src/useMovies.js): `src/useMovies.js`
- [Star rating](https://github.com/kiranatyam-05/usepopcorn-modern/blob/main/src/StarRating.js): `src/StarRating.js`
- [Keyboard shortcuts](https://github.com/kiranatyam-05/usepopcorn-modern/blob/main/src/useKey.js): `src/useKey.js`

### Local state

- [Watched state](https://github.com/kiranatyam-05/usepopcorn-modern/blob/main/src/useLocalStorageState.js): `src/useLocalStorageState.js`
- **Browser storage**

### Simulated accounts

- [Auth provider](https://github.com/kiranatyam-05/usepopcorn-modern/blob/main/src/AuthContext.js): `src/AuthContext.js`
- [Login form](https://github.com/kiranatyam-05/usepopcorn-modern/blob/main/src/Login.js): `src/Login.js`
- [Registration form](https://github.com/kiranatyam-05/usepopcorn-modern/blob/main/src/Registration.js): `src/Registration.js`

### Other components

- **Movie fan**
- **OMDb API**

## Connections

- Movie fan → React entry: opens app (evidence: `src/index.js`)
- React entry → Movie dashboard: renders (evidence: `src/index.js`)
- React entry → Auth provider: wraps app (evidence: `src/index.js`)
- Movie fan → Movie dashboard: searches and rates (evidence: `README.md`)
- Movie dashboard → Movie search: queries (evidence: `src/App.js`)
- Movie search → OMDb API: fetches results (evidence: `src/useMovies.js`)
- Movie dashboard → OMDb API: fetches details (evidence: `src/App.js`)
- Movie dashboard → Star rating: renders (evidence: `src/App.js`)
- Movie dashboard → Keyboard shortcuts: registers keys (evidence: `src/App.js`)
- Movie dashboard → Watched state: reads and updates (evidence: `src/App.js`)
- Watched state → Browser storage: persists list (evidence: `src/useLocalStorageState.js`)
- Auth provider → Browser storage: persists accounts (evidence: `src/AuthContext.js`)
- Movie dashboard → Auth provider: reads auth state (evidence: `src/App.js`)
- Movie dashboard → Login form: renders (evidence: `src/App.js`)
- Movie dashboard → Registration form: renders (evidence: `src/App.js`)
- Login form → Auth provider: calls login (evidence: `src/Login.js`)
- Registration form → Auth provider: calls register (evidence: `src/Registration.js`)
- Alternate app → Movie search: queries (evidence: `src/App_v2.js`)
- Alternate app → Watched state: reads and updates (evidence: `src/App_v2.js`)
- Alternate app → Star rating: renders (evidence: `src/App_v2.js`)
- Alternate app → Auth provider: uses provider (evidence: `src/App_v2.js`)
- Alternate app → Login form: renders (evidence: `src/App_v2.js`)
- Alternate app → Registration form: renders (evidence: `src/App_v2.js`)
