# hnam61617-art/mini-netflix architecture

> Architecture diagram of the GitHub repository hnam61617-art/mini-netflix, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hnam61617-art/mini-netflix
- Repository: https://github.com/hnam61617-art/mini-netflix

## Overview

Mini-Netflix is a Flask streaming-platform demo backed by MySQL, with an offline, provenance-aware dataset build. The user workflow is browsing and filtering titles, viewing details and episodes, managing profiles and watch history, and—after selecting a simulated subscription—recording progress or starting a play session. Separate management and reporting capabilities cover catalog edits, lookups, and SQL reports. The graph preserves the documented data-ingestion and database-init stages; unsampled app internals are represented only where README or excerpts support them.

Main entry points: [`scripts/init_db.py`](https://github.com/hnam61617-art/mini-netflix/blob/main/scripts/init_db.py) (Database initializer), [`scripts/build_sources.py`](https://github.com/hnam61617-art/mini-netflix/blob/main/scripts/build_sources.py) (Provenance ETL), [`datasets/raw`](https://github.com/hnam61617-art/mini-netflix/tree/main/datasets/raw) (Source snapshots), [`demo/app.py`](https://github.com/hnam61617-art/mini-netflix/blob/main/demo/app.py) (Flask application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Source data"]
  node_raw["Source snapshots"]
  node_tvmaze_fetch["TVmaze fetch"]
  node_source_build["Provenance ETL<br/>[build_sources.py]"]
  node_generated["Generated provenance"]
end

subgraph group_db["MySQL database"]
  node_seed_sql["Database seed<br/>[02_seed.sql]"]
  node_db_init["Database initializer<br/>[init_db.py]"]
  node_schema["Schema and rules<br/>[01_schema.sql]"]
  node_mysql[("MySQL")]
end

subgraph group_consumer["Consumer experience"]
  node_flask_app["Flask application<br/>[app.py]"]
  node_consumer_routes["Consumer pages<br/>[consumer.py]"]
  node_accounts["Accounts and profiles<br/>[accounts.py]"]
  node_catalog_view["Catalog browsing<br/>[catalog.py]"]
end

subgraph group_management["Management and reports"]
  node_management["Catalog management<br/>[management.py]"]
  node_lab["Management lab<br/>[lab.py]"]
  node_report_queries["SQL reports<br/>[03_queries.sql]"]
  node_renewals["Subscription renewal worker"]
end

node_viewer(("Viewer"))

node_viewer -->|"uses"| node_flask_app
node_raw -->|"transforms"| node_source_build
node_tvmaze_fetch -->|"updates snapshots"| node_raw
node_source_build -->|"writes provenance"| node_generated
node_source_build -->|"rebuilds seed"| node_seed_sql
node_db_init -->|"executes"| node_schema
node_db_init -->|"executes"| node_seed_sql
node_db_init -->|"initializes"| node_mysql
node_flask_app -->|"reads and writes"| node_mysql
node_viewer -->|"browses titles"| node_consumer_routes
node_viewer -->|"manages profiles"| node_accounts
node_viewer -->|"searches and views"| node_catalog_view
node_viewer -->|"edits catalog"| node_management
node_management -.->|"stores catalog"| node_mysql
node_viewer -->|"runs lookups"| node_lab
node_lab -.->|"queries data"| node_mysql
node_report_queries -->|"reports from"| node_mysql
node_renewals -->|"processes renewals"| node_mysql

click node_raw "https://github.com/hnam61617-art/mini-netflix/tree/main/datasets/raw"
click node_tvmaze_fetch "https://github.com/hnam61617-art/mini-netflix/blob/main/scripts/fetch_episode_sources.py"
click node_source_build "https://github.com/hnam61617-art/mini-netflix/blob/main/scripts/build_sources.py"
click node_generated "https://github.com/hnam61617-art/mini-netflix/tree/main/datasets/generated"
click node_seed_sql "https://github.com/hnam61617-art/mini-netflix/blob/main/sql/02_seed.sql"
click node_db_init "https://github.com/hnam61617-art/mini-netflix/blob/main/scripts/init_db.py"
click node_schema "https://github.com/hnam61617-art/mini-netflix/blob/main/sql/01_schema.sql"
click node_flask_app "https://github.com/hnam61617-art/mini-netflix/blob/main/demo/app.py"
click node_consumer_routes "https://github.com/hnam61617-art/mini-netflix/blob/main/demo/consumer.py"
click node_accounts "https://github.com/hnam61617-art/mini-netflix/blob/main/demo/accounts.py"
click node_catalog_view "https://github.com/hnam61617-art/mini-netflix/blob/main/demo/catalog.py"
click node_management "https://github.com/hnam61617-art/mini-netflix/blob/main/demo/management.py"
click node_lab "https://github.com/hnam61617-art/mini-netflix/blob/main/demo/lab.py"
click node_report_queries "https://github.com/hnam61617-art/mini-netflix/blob/main/sql/03_queries.sql"
click node_renewals "https://github.com/hnam61617-art/mini-netflix/blob/main/scripts/process_renewals.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_raw,node_tvmaze_fetch,node_source_build,node_generated,node_viewer toneBlue
class node_seed_sql,node_db_init,node_schema,node_mysql toneAmber
class node_flask_app,node_consumer_routes,node_accounts,node_catalog_view toneMint
class node_management,node_lab,node_report_queries,node_renewals toneRose
```

## Components

### Source data

- [Source snapshots](https://github.com/hnam61617-art/mini-netflix/tree/main/datasets/raw): `datasets/raw`
- [TVmaze fetch](https://github.com/hnam61617-art/mini-netflix/blob/main/scripts/fetch_episode_sources.py): `scripts/fetch_episode_sources.py`
- [Provenance ETL](https://github.com/hnam61617-art/mini-netflix/blob/main/scripts/build_sources.py): `scripts/build_sources.py`
- [Generated provenance](https://github.com/hnam61617-art/mini-netflix/tree/main/datasets/generated): `datasets/generated`

### MySQL database

- [Database seed](https://github.com/hnam61617-art/mini-netflix/blob/main/sql/02_seed.sql): `sql/02_seed.sql`
- [Database initializer](https://github.com/hnam61617-art/mini-netflix/blob/main/scripts/init_db.py): `scripts/init_db.py`
- [Schema and rules](https://github.com/hnam61617-art/mini-netflix/blob/main/sql/01_schema.sql): `sql/01_schema.sql`
- **MySQL**

### Consumer experience

- [Flask application](https://github.com/hnam61617-art/mini-netflix/blob/main/demo/app.py): `demo/app.py`
- [Consumer pages](https://github.com/hnam61617-art/mini-netflix/blob/main/demo/consumer.py): `demo/consumer.py`
- [Accounts and profiles](https://github.com/hnam61617-art/mini-netflix/blob/main/demo/accounts.py): `demo/accounts.py`
- [Catalog browsing](https://github.com/hnam61617-art/mini-netflix/blob/main/demo/catalog.py): `demo/catalog.py`

### Management and reports

- [Catalog management](https://github.com/hnam61617-art/mini-netflix/blob/main/demo/management.py): `demo/management.py`
- [Management lab](https://github.com/hnam61617-art/mini-netflix/blob/main/demo/lab.py): `demo/lab.py`
- [SQL reports](https://github.com/hnam61617-art/mini-netflix/blob/main/sql/03_queries.sql): `sql/03_queries.sql`
- [Subscription renewal worker](https://github.com/hnam61617-art/mini-netflix/blob/main/scripts/process_renewals.py): `scripts/process_renewals.py`

### Other components

- **Viewer**

## Connections

- Viewer → Flask application: uses (evidence: `README.md`)
- Source snapshots → Provenance ETL: transforms (evidence: `README.md`)
- TVmaze fetch → Source snapshots: updates snapshots (evidence: `scripts/fetch_episode_sources.py`)
- Provenance ETL → Generated provenance: writes provenance (evidence: `scripts/build_sources.py`)
- Provenance ETL → Database seed: rebuilds seed (evidence: `README.md`)
- Database initializer → Schema and rules: executes (evidence: `scripts/init_db.py`)
- Database initializer → Database seed: executes (evidence: `scripts/init_db.py`)
- Database initializer → MySQL: initializes (evidence: `scripts/init_db.py`)
- Flask application → MySQL: reads and writes
- Viewer → Consumer pages: browses titles (evidence: `README.md`)
- Viewer → Accounts and profiles: manages profiles (evidence: `README.md`)
- Viewer → Catalog browsing: searches and views (evidence: `README.md`)
- Viewer → Catalog management: edits catalog (evidence: `README.md`)
- Catalog management → MySQL: stores catalog
- Viewer → Management lab: runs lookups (evidence: `README.md`)
- Management lab → MySQL: queries data
- SQL reports → MySQL: reports from (evidence: `README.md`)
- Subscription renewal worker → MySQL: processes renewals (evidence: `scripts/process_renewals.py`)
