# prabhjot-arora31/amazonprimefrontend architecture

> Architecture diagram of the GitHub repository prabhjot-arora31/amazonprimefrontend, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/prabhjot-arora31/amazonprimefrontend
- Repository: https://github.com/prabhjot-arora31/amazonprimefrontend

## Overview

##### Project Type & Purpose
- From the README and file tree, this is a front-end single-page application for browsing movies, built with React, Vite, and Redux.
- It loads static JSON data (in src/data) to render lists, details, trailers, and user-related screens (Login/Register/Profile).

##### File Structure
- Top-level: index.html (entry point), vite.config.js (build tool), vercel.json (deployment), package.json
- src/main.jsx → mounts <App />
- src/App.jsx + router/route-based screens under src/screens
- src/components: reusable UI pieces (Header, Carousel, Spotlight, Trailer, etc.)
- src/redux: Flux/Redux store, actions, reducers, constants
- src/data: local JSON files + data_converter.js (data layer)
- public: static assets and redirects

##### Extract Architecture Insights from README
- Minimal React + Vite setup with fast HMR via Babel or SWC plugin
- No backend API—static JSON files act as data source
- Deployed on Vercel (vercel.json)

##### Main Components & Their Relationships
a. Browser / Client
- Makes initial HTTP GET to serve index.html and JS bundles from Vercel (or dev server)
b. Build Pipeline & Hosting
- Vite dev server during development
- Vite build → static assets → deployed via Vercel
c. React Single-Page App
- main.jsx initializes Redux store & ReactDOM.render(<App />)
- App.jsx configures React Router to load screens
d. Redux Store (src/redux/store.js)
- Reducers for movies, user, mobile header
- Actions dispatch from UI to update state
e. Data Layer
- data_converter.js transforms JSON files under src/data
- Components & screens import JSON directly or via converter
f. UI Components & Screens
- Screens (Home, MoviesList, MovieDetail, Trailer, WatchMovie, Login, Register, Profile)
- Shared Components (Header, Carousel, Spotlight, TrailerCard, etc.)

##### Important Patterns & Principles
- SPA with client-side routing (React Router)
- Flux architecture (Redux): unidirectional data flow
- Component-based design: separation of layout (Header, Hero) vs feature screens
- Static asset hosting; no separate backend

- “Routing Layer” (React Router) → connects paths to screens

## Diagram (Mermaid)

```mermaid
flowchart TD
    Browser["Browser / Client"]:::external
    Server["Static Asset Server\n(Vercel / Dev Server)"]:::server
    SPA["React SPA\n(index.html + JS Bundles)"]:::app

    Browser -->|"HTTP GET"| Server
    Server -->|"Serves index.html & Bundles"| SPA

    subgraph "SPA Application"
        direction TB

        subgraph "Entry Point & App Initialization"
            direction TB
            Index["index.html"]:::config
            Main["main.jsx"]:::app
            App["App.jsx"]:::app
        end

        subgraph "Routing Layer" 
            direction TB
            Home["Home.jsx"]:::router
            MoviesList["Movies.jsx"]:::router
            MovieDetail["MovieDetail.jsx"]:::router
            TrailerScreen["Trailer.jsx"]:::router
            WatchMovie["WatchMovie.jsx"]:::router
            Login["Login.jsx"]:::router
            Register["Register.jsx"]:::router
            Profile["Profile.jsx"]:::router
            SpecificType["SpecificMovieType.jsx"]:::router
        end

        subgraph "Redux Store (Flux Architecture)"
            direction TB
            Store["store.js"]:::store
            subgraph Actions
                direction TB
                ActionHeader["mobileScreenHeader.js"]:::store
                ActionMovie["movieActions.js"]:::store
                ActionUser["userActions.js"]:::store
            end
            subgraph Reducers
                direction TB
                ReducerHeader["mobileScreenHeader.js"]:::store
                ReducerMovie["movieReducer.js"]:::store
                ReducerUser["userReducer.js"]:::store
            end
            subgraph Constants
                direction TB
                ConstMovie["movieConstants.js"]:::store
                ConstUser["userConstants.js"]:::store
            end
        end

        subgraph "Data Layer (Static JSON + Converter)"
            direction TB
            Converter["data_converter.js"]:::data
            MoviesData["Movies.js"]:::data
            JSONFiles["*.json"]:::data
            GenresTxt["all_genres.txt"]:::data
            SeriesData["series_data/thrill.json"]:::data
        end

        subgraph "Shared UI Components"
            direction TB
            Carousel["Carousel.jsx"]:::ui
            HeaderComp["Header.jsx"]:::ui
            MainHeader["MainHeader.jsx"]:::ui
            Hero["Hero.jsx"]:::ui
            SpotlightComp["Spotlight.jsx"]:::ui
            TrailerComp["TrailerC.jsx"]:::ui
            MoviesComp["Movies.jsx"]:::ui
            HomeContainer["HomePageContainer.jsx"]:::ui
        end

        subgraph "Build & Deployment Configuration"
            direction TB
            Vite["vite.config.js"]:::config
            Vercel["vercel.json"]:::config
            Package["package.json"]:::config
            Redirects["public/_redirects"]:::config
        end

        %% Flows inside SPA
        Main -->|imports| App
        App -->|configures Router| Home
        App -->|configures Router| MoviesList
        App -->|configures Router| MovieDetail
        App -->|configures Router| TrailerScreen
        App -->|configures Router| WatchMovie
        App -->|configures Router| Login
        App -->|configures Router| Register
        App -->|configures Router| Profile
        App -->|configures Router| SpecificType

        %% Data to Screens
        Converter -->|transforms| JSONFiles
        Converter -->|outputs| MoviesData
        MoviesData -->|imported by| Home
        JSONFiles -->|imported by| MoviesList

        %% UI components used in Screens
        Home -->|uses| HeaderComp
        Home -->|uses| Hero
        Home -->|uses| SpotlightComp
        MoviesList -->|uses| MoviesComp
        MovieDetail -->|uses| TrailerComp
        SpecificType -->|uses| Carousel

        %% Redux interactions
        Home -->|dispatches| ActionMovie
        MoviesList -->|dispatches| ActionMovie
        Login -->|dispatches| ActionUser
        Profile -->|dispatches| ActionUser
        AnyScreen[/"Any Screen"/] -->|dispatches| ActionHeader
        ActionMovie -->|handled by| ReducerMovie
        ActionUser -->|handled by| ReducerUser
        ActionHeader -->|handled by| ReducerHeader
        ReducerMovie -->|updates State| Store
        ReducerUser -->|updates State| Store
        ReducerHeader -->|updates State| Store
        Store -->|provides State| Home
        Store -->|provides State| MoviesList
        Store -->|provides State| MovieDetail
        Store -->|provides State| TrailerScreen
        Store -->|provides State| WatchMovie
        Store -->|provides State| Login
        Store -->|provides State| Register
        Store -->|provides State| Profile
        Store -->|provides State| SpecificType

    end

    classDef external fill:#f9f,stroke:#333,stroke-width:1px
    classDef server fill:#bbf,stroke:#333,stroke-width:1px
    classDef app fill:#bfb,stroke:#333,stroke-width:1px
    classDef router fill:#ffb,stroke:#333,stroke-width:1px
    classDef store fill:#fbf,stroke:#333,stroke-width:1px
    classDef data fill:#ffc,stroke:#333,stroke-width:1px
    classDef ui fill:#cff,stroke:#333,stroke-width:1px
    classDef config fill:#fbc,stroke:#333,stroke-width:1px

    %% Click Events
    click Index "https://github.com/prabhjot-arora31/amazonprimefrontend/blob/main/index.html"
    click Main "https://github.com/prabhjot-arora31/amazonprimefrontend/blob/main/src/main.jsx"
    click App "https://github.com/prabhjot-arora31/amazonprimefrontend/blob/main/src/App.jsx"
    click Home "https://github.com/prabhjot-arora31/amazonprimefrontend/blob/main/src/screens/Home.jsx"
    click MoviesList "https://github.com/prabhjot-arora31/amazonprimefrontend/blob/main/src/screens/Movies.jsx"
    click MovieDetail "https://github.com/prabhjot-arora31/amazonprimefrontend/blob/main/src/screens/MovieDetail.jsx"
    click TrailerScreen "https://github.com/prabhjot-arora31/amazonprimefrontend/blob/main/src/screens/Trailer.jsx"
    click WatchMovie "https://github.com/prabhjot-arora31/amazonprimefrontend/blob/main/src/screens/WatchMovie.jsx"
    click Login "https://github.com/prabhjot-arora31/amazonprimefrontend/blob/main/src/screens/Login.jsx"
    click Register "https://github.com/prabhjot-arora31/amazonprimefrontend/blob/main/src/screens/Register.jsx"
    click Profile "https://github.com/prabhjot-arora31/amazonprimefrontend/blob/main/src/screens/Profile.jsx"
    click SpecificType "https://github.com/prabhjot-arora31/amazonprimefrontend/blob/main/src/screens/SpecificMovieType.jsx"
    click Store "https://github.com/prabhjot-arora31/amazonprimefrontend/blob/main/src/redux/store.js"
    click ActionHeader "https://github.com/prabhjot-arora31/amazonprimefrontend/blob/main/src/redux/actions/mobileScreenHeader.js"
    click ActionMovie "https://github.com/prabhjot-arora31/amazonprimefrontend/blob/main/src/redux/actions/movieActions.js"
    click ActionUser "https://github.com/prabhjot-arora31/amazonprimefrontend/blob/main/src/redux/actions/userActions.js"
    click ReducerHeader "https://github.com/prabhjot-arora31/amazonprimefrontend/blob/main/src/redux/reducers/mobileScreenHeader.js"
    click ReducerMovie "https://github.com/prabhjot-arora31/amazonprimefrontend/blob/main/src/redux/reducers/movieReducer.js"
    click ReducerUser "https://github.com/prabhjot-arora31/amazonprimefrontend/blob/main/src/redux/reducers/userReducer.js"
    click ConstMovie "https://github.com/prabhjot-arora31/amazonprimefrontend/blob/main/src/redux/constants/movieConstants.js"
    click ConstUser "https://github.com/prabhjot-arora31/amazonprimefrontend/blob/main/src/redux/constants/userConstants.js"
    click Converter "https://github.com/prabhjot-arora31/amazonprimefrontend/blob/main/src/data/data_converter.js"
    click MoviesData "https://github.com/prabhjot-arora31/amazonprimefrontend/blob/main/src/data/Movies.js"
    click JSONFiles "https://github.com/prabhjot-arora31/amazonprimefrontend/blob/main/src/data/*.json"
    click GenresTxt "https://github.com/prabhjot-arora31/amazonprimefrontend/blob/main/src/data/all_genres.txt"
    click SeriesData "https://github.com/prabhjot-arora31/amazonprimefrontend/blob/main/src/data/series_data/thrill.json"
    click Carousel "https://github.com/prabhjot-arora31/amazonprimefrontend/blob/main/src/components/Carousel.jsx"
    click HeaderComp "https://github.com/prabhjot-arora31/amazonprimefrontend/blob/main/src/components/Header/Header.jsx"
    click MainHeader "https://github.com/prabhjot-arora31/amazonprimefrontend/blob/main/src/components/MainHeader.jsx"
    click Hero "https://github.com/prabhjot-arora31/amazonprimefrontend/blob/main/src/components/Hero.jsx"
    click SpotlightComp "https://github.com/prabhjot-arora31/amazonprimefrontend/blob/main/src/components/Spotlight/Spotlight.jsx"
    click TrailerComp "https://github.com/prabhjot-arora31/amazonprimefrontend/blob/main/src/components/Trailer/TrailerC.jsx"
    click MoviesComp "https://github.com/prabhjot-arora31/amazonprimefrontend/blob/main/src/components/Movies/Movies.jsx"
    click HomeContainer "https://github.com/prabhjot-arora31/amazonprimefrontend/blob/main/src/components/HomePageContainer/HomePageContainer.jsx"
    click Vite "https://github.com/prabhjot-arora31/amazonprimefrontend/blob/main/vite.config.js"
    click Vercel "https://github.com/prabhjot-arora31/amazonprimefrontend/blob/main/vercel.json"
    click Package "https://github.com/prabhjot-arora31/amazonprimefrontend/blob/main/package.json"
    click Redirects "https://github.com/prabhjot-arora31/amazonprimefrontend/tree/main/public/_redirects"
```
