# bharath6911/cinenest architecture

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

- Interactive diagram: https://gitdiagram.com/bharath6911/cinenest
- Repository: https://github.com/bharath6911/cinenest

## Overview

##### Project type and purpose
- CineNest is a full‑stack, LAMP‑style streaming platform (inspired by Netflix/Prime) that combines static front‑end pages (HTML/CSS/JS), a PHP backend for user auth (log.php, register.php), and a MySQL database. It also has PWA assets (manifest, service worker) and even an Android wrapper (CineNest.apk).

##### File structure
- Top‑level web files:
- index.html, h.html, player.html – main pages & player interface
- styles.css – global stylesheet
- j.js, player.js – front‑end scripts for UI behavior and video player logic
- log.php, register.php – backend authentication endpoints
- log.html – login form page (static)
- image/ – folder of poster assets
- CineNest.apk sits alongside these as a packaged PWA wrapper for Android.
- No native “src” or “lib” folders: it’s a monolithic repo with static + PHP files in root.

##### README for additional insights
- Backend: PHP + MySQL on InfinityFree (via phpMyAdmin)
- Hosting: Render.com for static/PHP, InfinityFree for database
- External services: The Movie Database API for posters/ratings, Streamtape for video streams
- PWA readiness: manifest.json + service-worker.js enable offline caching and installability

##### Elements
- Labels: e.g., “Client Browser”, “Android App (APK)”, “Web Server (PHP)”, “MySQL DB”
- Client components in blue (browser, APK)
- Front‑end/PWA assets in light green
- Backend/PHP in orange
- External services in gray

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Clients
    subgraph "Clients"
        Browser["Client Browser"]:::client
        APK["Android App (APK)"]:::client
    end

    %% Frontend Static & PWA
    subgraph "Frontend Static & PWA"
        index["index.html"]:::frontend
        home["h.html"]:::frontend
        playerPage["player.html"]:::frontend
        loginPage["log.html"]:::frontend
        css["styles.css"]:::frontend
        uiJS["j.js"]:::frontend
        playerJS["player.js"]:::frontend
        manifest["manifest.json"]:::frontend
        sw["service-worker.js"]:::frontend
        images["image/"]:::frontend
    end

    %% Backend PHP
    subgraph "Web Server (PHP)"
        logEndpoint["log.php"]:::backend
        regEndpoint["register.php"]:::backend
    end

    %% Database
    DB["MySQL DB"]:::db

    %% External Services
    subgraph "External Services"
        TMDB["TMDB API"]:::external
        Stream["Streamtape"]:::external
    end

    %% Data Flows
    Browser -->|HTTP GET| index
    Browser -->|HTTP GET| home
    Browser -->|HTTP GET| playerPage
    Browser -->|HTTP GET| css
    Browser -->|HTTP GET| uiJS
    Browser -->|HTTP GET| manifest
    Browser -->|HTTP GET| sw

    Browser -->|fetch poster/metadata| TMDB
    TMDB -->|JSON| Browser

    Browser -->|play video embed| Stream

    Browser -->|AJAX POST login| logEndpoint
    logEndpoint -->|query| DB
    DB -->|result| logEndpoint
    logEndpoint -->|JSON response| Browser

    Browser -->|AJAX POST register| regEndpoint
    regEndpoint -->|query| DB
    DB -->|result| regEndpoint
    regEndpoint -->|JSON response| Browser

    %% Service Worker Caching
    Browser -->|request intercept| sw
    sw -->|serve cache or fetch| logEndpoint
    sw -->|serve cache or fetch| index

    %% APK wraps PWA
    APK -->|loads PWA assets| index
    APK -->|uses service worker| sw

    %% Click events
    click APK "https://github.com/bharath6911/cinenest/blob/main/CineNest.apk"
    click index "https://github.com/bharath6911/cinenest/blob/main/index.html"
    click home "https://github.com/bharath6911/cinenest/blob/main/h.html"
    click playerPage "https://github.com/bharath6911/cinenest/blob/main/player.html"
    click loginPage "https://github.com/bharath6911/cinenest/blob/main/log.html"
    click css "https://github.com/bharath6911/cinenest/blob/main/styles.css"
    click uiJS "https://github.com/bharath6911/cinenest/blob/main/j.js"
    click playerJS "https://github.com/bharath6911/cinenest/blob/main/player.js"
    click logEndpoint "https://github.com/bharath6911/cinenest/blob/main/log.php"
    click regEndpoint "https://github.com/bharath6911/cinenest/blob/main/register.php"
    click images "https://github.com/bharath6911/cinenest/tree/main/image/"
    click README "https://github.com/bharath6911/cinenest/blob/main/README.md"

    %% Styles
    classDef client fill:#c6dbff,stroke:#3182bd
    classDef frontend fill:#e5f5e0,stroke:#31a354
    classDef backend fill:#fee0d2,stroke:#de2d26
    classDef db fill:#edf8fb,stroke:#0868ac,stroke-width:2px
    classDef external fill:#f0f0f0,stroke:#636363,stroke-dasharray: 5 5
```
