# nikhilkumar92976/final-project architecture

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

- Interactive diagram: https://gitdiagram.com/nikhilkumar92976/final-project
- Repository: https://github.com/nikhilkumar92976/final-project

## Overview

##### Project type and purpose
- This is a single-page, full-front-end React application scaffolded with Vite.
- It serves dynamic movie/TV/person data fetched from an external API (via Axios).
- It uses Redux Toolkit slices for client-side state and Tailwind CSS for styling.

##### File structure
- Top level:
- public/index.html + static assets → served by Vite or CDN
- src/ → main app code
- src/Components/ → all React components (pages and partials)
- src/store/ → Redux Toolkit store, slices, actions
- src/utils/Axios.jsx → HTTP client wrapper
- vite.config.js, tailwind.config.js → build and styling configs
- Build artifacts appear under static/js when Vite bundles for production.

##### README
- Confirms it’s a React + Vite template with HMR support via Babel or SWC.
- No backend in repo → the only external service is the third-party data API.

a. Main components
- Browser (user agent)
- Vite Dev Server / CDN (serves index.html + JS/CSS bundles)
- React App Shell
- Entry point (main.jsx)
- Router layer (decides which page/component to mount)
- UI Components (Home, Movies, People, Trending, Details, Partials)
- State Management
- Redux Store (store.jsx)
- Slices (MovieSlice, personSlice, TvSlices)
- Actions (MoviesActions, PersonActions, TvActions)
- HTTP Client (Axios wrapper in src/utils)
- External Movie/TV/People Data API
b. Relationships and data flow
1. Browser requests index.html from Vite Dev Server (or CDN in prod).
2. index.html loads main.js bundle.
3. main.jsx bootstraps React, provides the Redux store via Provider, and mounts <App/>.
4. <App/> (via React Router) renders specific page Components.
5. Components dispatch Redux actions (e.g., fetchPopularMovies).
6. Actions use Axios to call the External API.
7. API responds → reducers update the store → subscribed components re-render.
c. Architectural patterns & principles
- Component-based UI (React)
- Unidirectional data flow (Redux Toolkit slices)
- Separation of concerns:
- UI in /Components
- Business logic / side-effects in /store/actions
- State modeling in /store/reducers
- HTTP concerns in /utils/Axios
- Build pipeline: Vite handles module resolution, HMR, and production bundling.
d. Key technologies
- React with Vite (@vitejs/plugin-react)
- Redux Toolkit (store, slices)
- Axios (for HTTP)
- Tailwind CSS (utility-first styling)
- ESLint, PostCSS

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User and Static Server
    Browser["Browser (User Agent)"]:::external
    subgraph "Static Asset Server"
        direction TB
        ViteServer["Vite Dev Server / CDN"]:::build
        PublicIndex["public/index.html + static assets"]:::build
    end

    %% Application Bundles
    AppBundle["main.js bundle"]:::build

    %% React Application Shell
    subgraph "React App Shell"
        direction TB
        Main["Entry Point\n(src/main.jsx)"]:::frontend
        Root["Root Component\n(src/App.jsx)\n(Router Layer)"]:::frontend
    end

    %% React UI Components
    subgraph "React UI"
        direction TB
        subgraph "Pages"
            direction TB
            Home["Home"]:::frontend
            Movies["Movies List"]:::frontend
            MovieDetails["Movie Details"]:::frontend
            TvShow["TV Shows List"]:::frontend
            TvDetails["TV Details"]:::frontend
            People["People List"]:::frontend
            PersonDetails["Person Details"]:::frontend
            Trending["Trending"]:::frontend
            LoginPage["Login Page"]:::frontend
            About["About Page"]:::frontend
            Contact["Contact Page"]:::frontend
            Loader["Loader"]:::frontend
            ErrorPage["Error Page"]:::frontend
        end
        subgraph "Partials"
            direction TB
            Header["Header"]:::frontend
            Sidenav["Side Navigation"]:::frontend
            Topnav["Top Navigation"]:::frontend
            Cards["Cards"]:::frontend
            HorizontalCards["Horizontal Cards"]:::frontend
            Dropdown["Dropdown"]:::frontend
            TrailerModal["Trailer Modal"]:::frontend
        end
    end

    %% State Management
    subgraph "State Management"
        direction TB
        Store["Redux Store\n(src/store/store.jsx)"]:::state
        subgraph "Slices / Reducers"
            direction TB
            MovieSlice["Movies Slice"]:::state
            TvSlice["TV Slice"]:::state
            PersonSlice["Person Slice"]:::state
        end
        subgraph "Actions / Thunks"
            direction TB
            MoviesActions["Movies Actions"]:::state
            TvActions["TV Actions"]:::state
            PersonActions["Person Actions"]:::state
        end
    end

    %% HTTP Client and External API
    AxiosClient["Axios Wrapper\n(src/utils/Axios.jsx)"]:::build
    ExternalAPI["External Movie/TV/People Data API"]:::external

    %% Relationships
    Browser -->|"GET /index.html"| ViteServer
    ViteServer -->|"serves index.html & assets"| PublicIndex
    PublicIndex -->|"loads JS/CSS"| Browser
    Browser -->|"loads main.js bundle"| AppBundle
    AppBundle -->|"executes"| Main
    Main -->|"renders"| Root
    Root -->|"mounts via Router"| Home
    Root --> Movies
    Root --> MovieDetails
    Root --> TvShow
    Root --> TvDetails
    Root --> People
    Root --> PersonDetails
    Root --> Trending
    Root --> LoginPage
    Root --> About
    Root --> Contact
    Root --> Loader
    Root --> ErrorPage
    Root --> Header
    Root --> Sidenav
    Root --> Topnav
    Root --> Cards
    Root --> HorizontalCards
    Root --> Dropdown
    Root --> TrailerModal

    %% Data Flow
    Home -->|"dispatch fetchPopularMovies"| MoviesActions
    Movies -->|"dispatch fetchPopularMovies"| MoviesActions
    MovieDetails -->|"dispatch fetchMovieDetails"| MoviesActions
    TvShow -->|"dispatch fetchPopularTV"| TvActions
    TvDetails -->|"dispatch fetchTVDetails"| TvActions
    People -->|"dispatch fetchPopularPeople"| PersonActions
    PersonDetails -->|"dispatch fetchPersonDetails"| PersonActions
    Trending -->|"dispatch fetchTrending"| MoviesActions
    MoviesActions --> AxiosClient
    TvActions --> AxiosClient
    PersonActions --> AxiosClient
    AxiosClient -->|"HTTP GET /... "| ExternalAPI
    ExternalAPI -->|"response data"| Store
    Store -->|"state update"| Home
    Store -->|"state update"| Movies
    Store -->|"state update"| MovieDetails
    Store -->|"state update"| TvShow
    Store -->|"state update"| TvDetails
    Store -->|"state update"| People
    Store -->|"state update"| PersonDetails
    Store -->|"state update"| Trending

    %% Click Events
    click ViteServer "https://github.com/nikhilkumar92976/final-project/blob/main/vite.config.js"
    click PublicIndex "https://github.com/nikhilkumar92976/final-project/blob/main/public/index.html"
    click Main "https://github.com/nikhilkumar92976/final-project/blob/main/src/main.jsx"
    click Root "https://github.com/nikhilkumar92976/final-project/blob/main/src/App.jsx"
    click Home "https://github.com/nikhilkumar92976/final-project/blob/main/src/Components/Home.jsx"
    click Movies "https://github.com/nikhilkumar92976/final-project/blob/main/src/Components/Movies.jsx"
    click MovieDetails "https://github.com/nikhilkumar92976/final-project/blob/main/src/Components/MovieDetails.jsx"
    click TvShow "https://github.com/nikhilkumar92976/final-project/blob/main/src/Components/TvShow.jsx"
    click TvDetails "https://github.com/nikhilkumar92976/final-project/blob/main/src/Components/TvDetails.jsx"
    click People "https://github.com/nikhilkumar92976/final-project/blob/main/src/Components/People.jsx"
    click PersonDetails "https://github.com/nikhilkumar92976/final-project/blob/main/src/Components/PersonDetails.jsx"
    click Trending "https://github.com/nikhilkumar92976/final-project/blob/main/src/Components/Trending.jsx"
    click LoginPage "https://github.com/nikhilkumar92976/final-project/blob/main/src/Components/LoginPage.jsx"
    click About "https://github.com/nikhilkumar92976/final-project/blob/main/src/Components/About.jsx"
    click Contact "https://github.com/nikhilkumar92976/final-project/blob/main/src/Components/Contact.jsx"
    click Loader "https://github.com/nikhilkumar92976/final-project/blob/main/src/Components/Loader.jsx"
    click ErrorPage "https://github.com/nikhilkumar92976/final-project/blob/main/src/Components/partials/Errorpage.jsx"
    click Header "https://github.com/nikhilkumar92976/final-project/blob/main/src/Components/partials/Header.jsx"
    click Sidenav "https://github.com/nikhilkumar92976/final-project/blob/main/src/Components/partials/Sidenav.jsx"
    click Topnav "https://github.com/nikhilkumar92976/final-project/blob/main/src/Components/partials/Topnav.jsx"
    click Cards "https://github.com/nikhilkumar92976/final-project/blob/main/src/Components/partials/Cards.jsx"
    click HorizontalCards "https://github.com/nikhilkumar92976/final-project/blob/main/src/Components/partials/Horizontilacards.jsx"
    click Dropdown "https://github.com/nikhilkumar92976/final-project/blob/main/src/Components/partials/Dropdown.jsx"
    click TrailerModal "https://github.com/nikhilkumar92976/final-project/blob/main/src/Components/partials/Trailer.jsx"
    click Store "https://github.com/nikhilkumar92976/final-project/blob/main/src/store/store.jsx"
    click MovieSlice "https://github.com/nikhilkumar92976/final-project/blob/main/src/store/reducers/MovieSlice.jsx"
    click TvSlice "https://github.com/nikhilkumar92976/final-project/blob/main/src/store/reducers/TvSlices.jsx"
    click PersonSlice "https://github.com/nikhilkumar92976/final-project/blob/main/src/store/reducers/personSlice.jsx"
    click MoviesActions "https://github.com/nikhilkumar92976/final-project/blob/main/src/store/actions/MoviesActions.jsx"
    click TvActions "https://github.com/nikhilkumar92976/final-project/blob/main/src/store/actions/TvActions.jsx"
    click PersonActions "https://github.com/nikhilkumar92976/final-project/blob/main/src/store/actions/PersonActions.jsx"
    click AxiosClient "https://github.com/nikhilkumar92976/final-project/blob/main/src/utils/Axios.jsx"
    click PublicIndex "https://github.com/nikhilkumar92976/final-project/blob/main/public/index.html"
    click ViteServer "https://github.com/nikhilkumar92976/final-project/blob/main/vite.config.js"

    %% Styles
    classDef frontend fill:#AEDFF7,stroke:#333,stroke-width:1px
    classDef state fill:#C1E1C1,stroke:#333,stroke-width:1px
    classDef external fill:#FFD8A8,stroke:#333,stroke-width:1px
    classDef build fill:#D3D3D3,stroke:#333,stroke-width:1px
```
