# prashamtogadiya/netflix architecture

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

- Interactive diagram: https://gitdiagram.com/prashamtogadiya/netflix
- Repository: https://github.com/prashamtogadiya/netflix

## Overview

##### Project type and purpose
- This is a full-stack streaming MVP named “Netflix_MVP”:
- Frontend: React + Redux (Vite + Tailwind CSS)
- Backend: Express.js + MongoDB (Mongoose)
- Purpose: Provide Netflix-style streaming features—authentication, profile management, movie browsing, reviews, “My List,” admin panel.

##### File structure
- Top-level split into two main folders:
- backend/ – monolithic Express API
– config/db.js (DB connection)
– controllers/ (auth, movie, profile, review, settings)
– routes/ (auth.routes, movie.routes, etc.)
– models/ (User, Profile, Movie, Setting)
– middlewares/ (auth, error handling)
– uploads/ (file store)
- frontend/ – React SPA
– public/ (static index.html, assets)
– src/
- api/index.jsx (Axios instance)
- app/store.jsx (Redux store)
- features/ (Redux slices for user, profiles, movies)
- components/ (UI pieces, carousels, forms, loader, auth guards)
- pages/ (routing targets: Dashboard, MovieDetail, AdminPanel, etc.)
– tailwind.config.js, vite.config.js
- Key patterns:
- Backend: MVC (models/controllers/routes), JWT auth middleware
- Frontend: Component-based + Redux Ducks (slices), Router + protected routes

##### Supplementary README insights
- Tech stack badges reinforce chosen frameworks/libraries
- Features section confirms use cases: auth (JWT), profiles, CRUD movie/admin flows, reviews, “My List,” infinite scroll, carousels
- README’s project-structure section matches the file tree

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Presentation Layer
    subgraph "Presentation Layer"
        direction TB
        User["User (Browser)"]:::external
        ReactApp["React App"]:::frontend
        Store["Redux Store"]:::frontend
        Axios["Axios API Instance"]:::frontend
        Pages["Routing Pages"]:::frontend
        UIComp["UI Components"]:::frontend
    end

    %% Service Layer
    subgraph "Service Layer"
        direction TB
        Server["Express API Server"]:::backend
        AuthMW["Auth Middleware (JWT)"]:::backend
        ErrorMW["Error Handler Middleware"]:::backend
        subgraph "Routes"
            direction TB
            AuthRoutes["Auth Routes"]:::backend
            MovieRoutes["Movie Routes"]:::backend
            ProfileRoutes["Profile Routes"]:::backend
            ReviewRoutes["Review Routes"]:::backend
            SettingsRoutes["Settings Routes"]:::backend
        end
        subgraph "Controllers"
            direction TB
            AuthCtrl["Auth Controller"]:::backend
            MovieCtrl["Movie Controller"]:::backend
            ProfileCtrl["Profile Controller"]:::backend
            ReviewCtrl["Review Controller"]:::backend
            SettingsCtrl["Settings Controller"]:::backend
        end
    end

    %% Data Layer
    subgraph "Data Layer"
        direction TB
        MongoDB["MongoDB"]:::database
        FileStore["File Store (Uploads)"]:::storage
    end

    %% Connections
    User -->|"interacts with"| ReactApp
    ReactApp -->|"dispatch actions"| Store
    ReactApp -->|"renders pages"| Pages
    ReactApp -->|"renders components"| UIComp
    ReactApp -->|"API calls (HTTP/HTTPS)"| Axios
    Store -->|uses| ReactApp
    Axios -->|"requests"| Server
    Server -->|"use"| AuthMW
    Server -->|"use"| ErrorMW
    Server -->|"routes to"| AuthRoutes
    Server -->|"routes to"| MovieRoutes
    Server -->|"routes to"| ProfileRoutes
    Server -->|"routes to"| ReviewRoutes
    Server -->|"routes to"| SettingsRoutes

    AuthRoutes -->|"calls"| AuthCtrl
    MovieRoutes -->|"calls"| MovieCtrl
    ProfileRoutes -->|"calls"| ProfileCtrl
    ReviewRoutes -->|"calls"| ReviewCtrl
    SettingsRoutes -->|"calls"| SettingsCtrl

    AuthCtrl -->|"CRUD via Mongoose"| MongoDB
    MovieCtrl -->|"CRUD via Mongoose"| MongoDB
    ProfileCtrl -->|"CRUD via Mongoose"| MongoDB
    ReviewCtrl -->|"CRUD via Mongoose"| MongoDB
    SettingsCtrl -->|"CRUD via Mongoose"| MongoDB

    MovieCtrl -->|"manage files"| FileStore
    ProfileCtrl -->|"manage files"| FileStore

    %% Click Events - Frontend
    click ReactApp "https://github.com/prashamtogadiya/netflix/tree/main/frontend/src"
    click Store "https://github.com/prashamtogadiya/netflix/blob/main/frontend/src/app/store.jsx"
    click Axios "https://github.com/prashamtogadiya/netflix/blob/main/frontend/src/api/index.jsx"
    click AuthSlice "https://github.com/prashamtogadiya/netflix/blob/main/frontend/src/features/user/userSlice.jsx"
    click ProfilesSlice "https://github.com/prashamtogadiya/netflix/blob/main/frontend/src/features/profiles/profileSlice.jsx"
    click MoviesSlice "https://github.com/prashamtogadiya/netflix/blob/main/frontend/src/features/movies/movieSlice.jsx"
    click UIComp "https://github.com/prashamtogadiya/netflix/tree/main/frontend/src/components"
    click Pages "https://github.com/prashamtogadiya/netflix/tree/main/frontend/src/pages"
    click Tailwind "https://github.com/prashamtogadiya/netflix/blob/main/frontend/tailwind.config.js"
    click ViteConfig "https://github.com/prashamtogadiya/netflix/blob/main/frontend/vite.config.js"

    %% Click Events - Backend
    click Server "https://github.com/prashamtogadiya/netflix/blob/main/backend/server.js"
    click DBConfig "https://github.com/prashamtogadiya/netflix/blob/main/backend/config/db.js"
    click AuthCtrl "https://github.com/prashamtogadiya/netflix/blob/main/backend/controllers/auth.controller.js"
    click MovieCtrl "https://github.com/prashamtogadiya/netflix/blob/main/backend/controllers/movie.controller.js"
    click ProfileCtrl "https://github.com/prashamtogadiya/netflix/blob/main/backend/controllers/profile.controller.js"
    click ReviewCtrl "https://github.com/prashamtogadiya/netflix/blob/main/backend/controllers/review.controller.js"
    click SettingsCtrl "https://github.com/prashamtogadiya/netflix/blob/main/backend/controllers/settings.controller.js"
    click AuthMW "https://github.com/prashamtogadiya/netflix/blob/main/backend/middlewares/auth.middleware.js"
    click UserModel "https://github.com/prashamtogadiya/netflix/blob/main/backend/models/User.js"
    click ProfileModel "https://github.com/prashamtogadiya/netflix/blob/main/backend/models/Profile.js"
    click MovieModel "https://github.com/prashamtogadiya/netflix/blob/main/backend/models/Movie.js"
    click SettingModel "https://github.com/prashamtogadiya/netflix/blob/main/backend/models/Setting.js"
    click AuthRoutes "https://github.com/prashamtogadiya/netflix/blob/main/backend/routes/auth.routes.js"
    click MovieRoutes "https://github.com/prashamtogadiya/netflix/blob/main/backend/routes/movie.routes.js"
    click ProfileRoutes "https://github.com/prashamtogadiya/netflix/blob/main/backend/routes/profile.routes.js"
    click ReviewRoutes "https://github.com/prashamtogadiya/netflix/blob/main/backend/routes/review.routes.js"
    click SettingsRoutes "https://github.com/prashamtogadiya/netflix/blob/main/backend/routes/settings.routes.js"
    click FileStore "https://github.com/prashamtogadiya/netflix/tree/main/backend/uploads"

    %% Styles
    classDef frontend fill:#bbdefb,stroke:#1e88e5,stroke-width:1px
    classDef backend fill:#ffe0b2,stroke:#fb8c00,stroke-width:1px
    classDef database fill:#c8e6c9,stroke:#43a047,stroke-width:1px
    classDef storage fill:#eeeeee,stroke:#9e9e9e,stroke-width:1px
    classDef external fill:#e0e0e0,stroke:#616161,stroke-width:1px,stroke-dasharray: 5 5
```
