# subhashguptha30/entertainmenthub architecture

> Architecture diagram of the GitHub repository subhashguptha30/entertainmenthub, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/subhashguptha30/entertainmenthub
- Repository: https://github.com/subhashguptha30/entertainmenthub

## Overview

Entertainment Hub is a Flask-based streaming catalogue with browser-rendered discovery, accounts, playback details, franchises, and an administrator portal. The main user flow loads catalogue data from the API, filters and searches it in the browser, then links to a content detail/player page. Flask routes handle page/API requests and delegate persistence to the database module. The README describes SQLite/local operation, while sampled source describes Firestore and optional Cloud Storage; the graph reflects sampled implementation and documents the mismatch. Unsampled routes and templates limit some wiring detail.

Main entry points: [`app.py`](https://github.com/subhashguptha30/entertainmenthub/blob/main/app.py) (Flask Routes), [`static/js/main.js`](https://github.com/subhashguptha30/entertainmenthub/blob/main/static/js/main.js) (Data Manager), [`database.py`](https://github.com/subhashguptha30/entertainmenthub/blob/main/database.py) (Content Records), [`static/js/franchise.js`](https://github.com/subhashguptha30/entertainmenthub/blob/main/static/js/franchise.js) (Franchise Browser)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Catalogue Discovery"]
  node_flask["Flask Routes<br/>[app.py]"]
  node_catalogue["Catalogue Pages"]
  node_data_manager["Data Manager<br/>[main.js]"]
  node_home_slides["Hero Slides<br/>[head-slides.js]"]
  node_sections["Browse Sections<br/>[section-sliders.js]"]
  node_franchises["Franchise Browser<br/>[franchise.js]"]
  node_player["Detail Player<br/>[play.html]"]
end

subgraph group_accounts["Accounts"]
  node_auth_pages["Login Pages"]
  node_profile["User Profile<br/>[profile.html]"]
end

subgraph group_management["Content Management"]
  node_admin_ui["Admin Portal"]
  node_admin_client["Admin Client<br/>[admin.js]"]
  node_image_upload["Image Uploads<br/>[app.py]"]
end

subgraph group_persistence["Persistence"]
  node_content_store[("Content Records<br/>[database.py]")]
  node_user_store[("User Records<br/>[database.py]")]
  node_selector_store[("Selectors<br/>[database.py]")]
end

node_viewer(("Viewer"))
node_browser(("Web Browser"))
node_firestore[("Firestore")]
node_gcs[("Cloud Storage")]

node_viewer -->|"uses"| node_browser
node_browser -->|"requests pages"| node_flask
node_flask -->|"serves pages"| node_catalogue
node_browser -->|"runs"| node_data_manager
node_data_manager -->|"fetches catalogue"| node_flask
node_flask -->|"queries content"| node_content_store
node_content_store -->|"reads and writes"| node_firestore
node_data_manager -->|"provides catalogue"| node_home_slides
node_data_manager -->|"provides catalogue"| node_sections
node_browser -->|"runs"| node_franchises
node_franchises -->|"fetches franchises"| node_flask
node_browser -->|"opens content"| node_player
node_browser -->|"opens account pages"| node_auth_pages
node_auth_pages -->|"submits credentials"| node_flask
node_flask -->|"authenticates and updates"| node_user_store
node_user_store -->|"reads and writes"| node_firestore
node_browser -->|"opens profile"| node_profile
node_profile -->|"updates account"| node_flask
node_browser -->|"opens portal"| node_admin_ui
node_admin_ui -->|"loads scripts"| node_admin_client
node_admin_client -->|"calls admin API"| node_flask
node_flask -->|"manages content"| node_content_store
node_flask -->|"manages users"| node_user_store
node_flask -->|"manages selectors"| node_selector_store
node_selector_store -->|"reads and writes"| node_firestore
node_browser -->|"submits images"| node_image_upload
node_image_upload -.->|"uploads when configured"| node_gcs

click node_flask "https://github.com/subhashguptha30/entertainmenthub/blob/main/app.py"
click node_catalogue "https://github.com/subhashguptha30/entertainmenthub/tree/main/templates"
click node_data_manager "https://github.com/subhashguptha30/entertainmenthub/blob/main/static/js/main.js"
click node_home_slides "https://github.com/subhashguptha30/entertainmenthub/blob/main/static/js/head-slides.js"
click node_sections "https://github.com/subhashguptha30/entertainmenthub/blob/main/static/js/section-sliders.js"
click node_franchises "https://github.com/subhashguptha30/entertainmenthub/blob/main/static/js/franchise.js"
click node_player "https://github.com/subhashguptha30/entertainmenthub/blob/main/templates/play.html"
click node_auth_pages "https://github.com/subhashguptha30/entertainmenthub/tree/main/templates/login"
click node_profile "https://github.com/subhashguptha30/entertainmenthub/blob/main/templates/profile.html"
click node_admin_ui "https://github.com/subhashguptha30/entertainmenthub/tree/main/templates/admin"
click node_admin_client "https://github.com/subhashguptha30/entertainmenthub/blob/main/static/admin/admin.js"
click node_content_store "https://github.com/subhashguptha30/entertainmenthub/blob/main/database.py"
click node_user_store "https://github.com/subhashguptha30/entertainmenthub/blob/main/database.py"
click node_selector_store "https://github.com/subhashguptha30/entertainmenthub/blob/main/database.py"
click node_image_upload "https://github.com/subhashguptha30/entertainmenthub/blob/main/app.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_flask,node_catalogue,node_data_manager,node_home_slides,node_sections,node_franchises,node_player,node_viewer,node_browser toneBlue
class node_auth_pages,node_profile,node_firestore,node_gcs toneAmber
class node_admin_ui,node_admin_client,node_image_upload toneMint
class node_content_store,node_user_store,node_selector_store toneRose
```

## Components

### Catalogue Discovery

- [Flask Routes](https://github.com/subhashguptha30/entertainmenthub/blob/main/app.py): `app.py`
- [Catalogue Pages](https://github.com/subhashguptha30/entertainmenthub/tree/main/templates): `templates`
- [Data Manager](https://github.com/subhashguptha30/entertainmenthub/blob/main/static/js/main.js): `static/js/main.js`
- [Hero Slides](https://github.com/subhashguptha30/entertainmenthub/blob/main/static/js/head-slides.js): `static/js/head-slides.js`
- [Browse Sections](https://github.com/subhashguptha30/entertainmenthub/blob/main/static/js/section-sliders.js): `static/js/section-sliders.js`
- [Franchise Browser](https://github.com/subhashguptha30/entertainmenthub/blob/main/static/js/franchise.js): `static/js/franchise.js`
- [Detail Player](https://github.com/subhashguptha30/entertainmenthub/blob/main/templates/play.html): `templates/play.html`

### Accounts

- [Login Pages](https://github.com/subhashguptha30/entertainmenthub/tree/main/templates/login): `templates/login`
- [User Profile](https://github.com/subhashguptha30/entertainmenthub/blob/main/templates/profile.html): `templates/profile.html`

### Content Management

- [Admin Portal](https://github.com/subhashguptha30/entertainmenthub/tree/main/templates/admin): `templates/admin`
- [Admin Client](https://github.com/subhashguptha30/entertainmenthub/blob/main/static/admin/admin.js): `static/admin/admin.js`
- [Image Uploads](https://github.com/subhashguptha30/entertainmenthub/blob/main/app.py): `app.py`

### Persistence

- [Content Records](https://github.com/subhashguptha30/entertainmenthub/blob/main/database.py): `database.py`
- [User Records](https://github.com/subhashguptha30/entertainmenthub/blob/main/database.py): `database.py`
- [Selectors](https://github.com/subhashguptha30/entertainmenthub/blob/main/database.py): `database.py`

### Other components

- **Viewer**
- **Web Browser**
- **Firestore**
- **Cloud Storage**

## Connections

- Viewer → Web Browser: uses
- Web Browser → Flask Routes: requests pages
- Flask Routes → Catalogue Pages: serves pages
- Web Browser → Data Manager: runs
- Data Manager → Flask Routes: fetches catalogue
- Flask Routes → Content Records: queries content
- Content Records → Firestore: reads and writes
- Data Manager → Hero Slides: provides catalogue
- Data Manager → Browse Sections: provides catalogue
- Web Browser → Franchise Browser: runs
- Franchise Browser → Flask Routes: fetches franchises
- Web Browser → Detail Player: opens content
- Web Browser → Login Pages: opens account pages
- Login Pages → Flask Routes: submits credentials
- Flask Routes → User Records: authenticates and updates
- User Records → Firestore: reads and writes
- Web Browser → User Profile: opens profile
- User Profile → Flask Routes: updates account
- Web Browser → Admin Portal: opens portal
- Admin Portal → Admin Client: loads scripts
- Admin Client → Flask Routes: calls admin API
- Flask Routes → Content Records: manages content
- Flask Routes → User Records: manages users
- Flask Routes → Selectors: manages selectors
- Selectors → Firestore: reads and writes
- Web Browser → Image Uploads: submits images
- Image Uploads → Cloud Storage: uploads when configured
