# yogeshgit11/hritik-roshan-area_drf-react architecture

> Architecture diagram of the GitHub repository yogeshgit11/hritik-roshan-area_drf-react, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yogeshgit11/hritik-roshan-area_drf-react
- Repository: https://github.com/yogeshgit11/hritik-roshan-area_drf-react

## Overview

##### Project Type and Purpose
- This is a full-stack web application (“HRMOVIES_API”) with a React frontend and a Django REST Framework backend.
- Purpose: display and search Hritik Roshan movies, show detailed info, allow downloads.

##### File Structure
- Top level:
- HRMOVIES_API/ — Django REST backend
- frontend/ — React single-page application
- Backend folders:
- HRMOVIES/ — Django project settings (asgi.py, wsgi.py, urls.py)
- movies/ — Django app: models.py, views.py, admin.py, migrations/
- movies/api/ — DRF serializers, views, URLs
- Frontend folders:
- src/ — React components, App.js, index.js
- Database: db.sqlite3

##### README Insights
- Stack: React (frontend), Django REST Framework (backend), SQLite.

##### Main Components
a. Client / Browser (React SPA)
b. Web Server / CDN (serves React static bundle)
c. Backend API Server (Django w/ DRF)
d. Database (SQLite)
e. (Optional) Media Storage for movie posters or downloads

##### Interactions & Data Flow
1. User opens the React app in a browser.
2. Browser loads static assets (index.html, JS, CSS) from the web server or CDN.
3. React UI (components/FindMovies.js, etc.) issues HTTP(S) requests to Django API endpoints.
4. Django URL router (HRMOVIES/urls.py + movies/api/urls.py) directs requests to DRF views.
5. DRF views use serializers (serializer.py) to translate between Django models (models.py) and JSON.
6. Django ORM reads/writes to SQLite (db.sqlite3).
7. Responses (JSON payload or download stream) return to the React client.

##### Architectural Patterns & Design Principles
- Separation of concerns: UI layer (React) vs. API layer (Django REST).
- MVC within Django: models.py (data), views.py (logic), serializers (presentation).
- Single-page application (SPA) pattern for the frontend.
- Stateless REST endpoints.
- Local relational storage (SQLite) as persistence.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Frontend Layer
    subgraph "Frontend Layer"
        direction TB
        Browser["Browser"]:::frontend
        Static["Static Assets (public)"]:::static
        ReactSPA["React SPA (src)"]:::frontend
        ViewComponents["Components (src/components)"]:::frontend
        Config["package.json & package-lock.json"]:::static
        IndexJS["index.js"]:::frontend
        AppJS["App.js"]:::frontend
        Browser -->|"GET /index.html, bundle.js"| Static
        Static -->|serves| ReactSPA
        ReactSPA -->|renders| ViewComponents
        ReactSPA -->|bootstraps| IndexJS
        ReactSPA -->|loads| AppJS
        ReactSPA -->|uses deps from| Config
    end

    %% Backend Layer
    subgraph "Backend Layer"
        direction TB
        Manage["manage.py"]:::backend
        subgraph "Django Project (HRMOVIES)"
            direction TB
            Settings["settings.py"]:::backend
            UrlsProj["urls.py"]:::backend
            ASGI["asgi.py"]:::backend
            WSGI["wsgi.py"]:::backend
        end
        subgraph "Movies App (movies)"
            direction TB
            Models["models.py"]:::backend
            Admin["admin.py"]:::backend
            ViewsCore["views.py"]:::backend
            Migrations["migrations"]:::backend
        end
        subgraph "API Module (movies/api)"
            direction TB
            Serializer["serializer.py"]:::backend
            ViewsAPI["views.py"]:::backend
            UrlsAPI["urls.py"]:::backend
        end
        Manage --> Settings
        Settings --> UrlsProj
        UrlsProj --> UrlsAPI
        UrlsAPI --> ViewsAPI
        ViewsAPI --> Serializer
        Serializer --> Models
        ViewsAPI -->|ORM| Models
    end

    %% Database
    DB["SQLite Database"]:::db
    Models -->|reads/writes| DB
    Migrations --> DB

    %% Frontend to Backend Interaction
    ReactSPA -->|HTTP/JSON| UrlsProj

    %% Styles
    classDef frontend fill:#cce5ff,stroke:#004085,color:#004085;
    classDef backend fill:#d4edda,stroke:#155724,color:#155724;
    classDef db fill:#fff3cd,stroke:#856404,color:#856404;
    classDef static fill:#e2e3e5,stroke:#6c757d,color:#6c757d;

    %% Click Events
    click ReactSPA "https://github.com/yogeshgit11/hritik-roshan-area_drf-react/tree/master/frontend/src"
    click IndexJS "https://github.com/yogeshgit11/hritik-roshan-area_drf-react/blob/master/frontend/src/index.js"
    click AppJS "https://github.com/yogeshgit11/hritik-roshan-area_drf-react/blob/master/frontend/src/App.js"
    click ViewComponents "https://github.com/yogeshgit11/hritik-roshan-area_drf-react/tree/master/frontend/src/components"
    click Static "https://github.com/yogeshgit11/hritik-roshan-area_drf-react/tree/master/frontend/public"
    click Config "https://github.com/yogeshgit11/hritik-roshan-area_drf-react/blob/master/frontend/package.json"
    click Manage "https://github.com/yogeshgit11/hritik-roshan-area_drf-react/blob/master/HRMOVIES_API/manage.py"
    click Settings "https://github.com/yogeshgit11/hritik-roshan-area_drf-react/blob/master/HRMOVIES_API/HRMOVIES/settings.py"
    click UrlsProj "https://github.com/yogeshgit11/hritik-roshan-area_drf-react/blob/master/HRMOVIES_API/HRMOVIES/urls.py"
    click ASGI "https://github.com/yogeshgit11/hritik-roshan-area_drf-react/blob/master/HRMOVIES_API/HRMOVIES/asgi.py"
    click WSGI "https://github.com/yogeshgit11/hritik-roshan-area_drf-react/blob/master/HRMOVIES_API/HRMOVIES/wsgi.py"
    click Models "https://github.com/yogeshgit11/hritik-roshan-area_drf-react/blob/master/HRMOVIES_API/movies/models.py"
    click Admin "https://github.com/yogeshgit11/hritik-roshan-area_drf-react/blob/master/HRMOVIES_API/movies/admin.py"
    click ViewsCore "https://github.com/yogeshgit11/hritik-roshan-area_drf-react/blob/master/HRMOVIES_API/movies/views.py"
    click Migrations "https://github.com/yogeshgit11/hritik-roshan-area_drf-react/tree/master/HRMOVIES_API/movies/migrations"
    click Serializer "https://github.com/yogeshgit11/hritik-roshan-area_drf-react/blob/master/HRMOVIES_API/movies/api/serializer.py"
    click ViewsAPI "https://github.com/yogeshgit11/hritik-roshan-area_drf-react/blob/master/HRMOVIES_API/movies/api/views.py"
    click UrlsAPI "https://github.com/yogeshgit11/hritik-roshan-area_drf-react/blob/master/HRMOVIES_API/movies/api/urls.py"
    click DB "https://github.com/yogeshgit11/hritik-roshan-area_drf-react/blob/master/HRMOVIES_API/db.sqlite3"
```
