# psukawala-art/cinematch-movie-recommendation architecture

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

- Interactive diagram: https://gitdiagram.com/psukawala-art/cinematch-movie-recommendation
- Repository: https://github.com/psukawala-art/cinematch-movie-recommendation

## Overview

CineMatch is a learning prototype for recommending movies from a selected user’s highly rated genres. The user selects a sample account in the Streamlit app; on request, the app queries MySQL for unrated matching movies and displays the results. SQL files define and populate the database and provide queries. A separate Python module contains cosine-similarity and rated-movie exclusion helpers, but the sampled app does not call it; the README describes linear algebra as an extension. Connections shown are limited to those supported by the excerpts or README.

Main entry points: [`app.py`](https://github.com/psukawala-art/cinematch-movie-recommendation/blob/main/app.py) (Streamlit app), [`src/db.py`](https://github.com/psukawala-art/cinematch-movie-recommendation/blob/main/src/db.py) (MySQL access), [`sql/01_schema.sql`](https://github.com/psukawala-art/cinematch-movie-recommendation/blob/main/sql/01_schema.sql) (Data schema), [`sql/02_sample_data.sql`](https://github.com/psukawala-art/cinematch-movie-recommendation/blob/main/sql/02_sample_data.sql) (Sample data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_app["Streamlit app<br/>[app.py]"]
end

subgraph group_recommendation["Recommendation logic"]
  node_rule_query["Genre-based suggestions<br/>[app.py]"]
  node_similarity["Cosine similarity<br/>[recommender.py]"]
  node_rated_exclusion["Rated-movie exclusion<br/>[recommender.py]"]
end

subgraph group_persistence["Data and storage"]
  node_db_client["MySQL access<br/>[db.py]"]
  node_mysql[("MySQL database")]
  node_schema["Data schema<br/>[01_schema.sql]"]
  node_sample_data["Sample data<br/>[02_sample_data.sql]"]
  node_sql_queries["SQL queries<br/>[03_queries.sql]"]
end

node_user(("Movie viewer"))

node_user -->|"selects user"| node_app
node_user -->|"requests recommendations"| node_app
node_app -->|"fetches rows"| node_db_client
node_db_client -->|"executes SQL"| node_mysql
node_app -->|"runs query"| node_rule_query
node_schema -->|"sets up schema"| node_mysql
node_sample_data -->|"loads sample data"| node_mysql

click node_app "https://github.com/psukawala-art/cinematch-movie-recommendation/blob/main/app.py"
click node_db_client "https://github.com/psukawala-art/cinematch-movie-recommendation/blob/main/src/db.py"
click node_schema "https://github.com/psukawala-art/cinematch-movie-recommendation/blob/main/sql/01_schema.sql"
click node_sample_data "https://github.com/psukawala-art/cinematch-movie-recommendation/blob/main/sql/02_sample_data.sql"
click node_sql_queries "https://github.com/psukawala-art/cinematch-movie-recommendation/blob/main/sql/03_queries.sql"
click node_rule_query "https://github.com/psukawala-art/cinematch-movie-recommendation/blob/main/app.py"
click node_similarity "https://github.com/psukawala-art/cinematch-movie-recommendation/blob/main/src/recommender.py"
click node_rated_exclusion "https://github.com/psukawala-art/cinematch-movie-recommendation/blob/main/src/recommender.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_app,node_user toneBlue
class node_rule_query,node_similarity,node_rated_exclusion toneAmber
class node_db_client,node_mysql,node_schema,node_sample_data,node_sql_queries toneMint
```

## Components

### User interface

- [Streamlit app](https://github.com/psukawala-art/cinematch-movie-recommendation/blob/main/app.py): `app.py`

### Recommendation logic

- [Genre-based suggestions](https://github.com/psukawala-art/cinematch-movie-recommendation/blob/main/app.py): `app.py`
- [Cosine similarity](https://github.com/psukawala-art/cinematch-movie-recommendation/blob/main/src/recommender.py): `src/recommender.py`
- [Rated-movie exclusion](https://github.com/psukawala-art/cinematch-movie-recommendation/blob/main/src/recommender.py): `src/recommender.py`

### Data and storage

- [MySQL access](https://github.com/psukawala-art/cinematch-movie-recommendation/blob/main/src/db.py): `src/db.py`
- **MySQL database**
- [Data schema](https://github.com/psukawala-art/cinematch-movie-recommendation/blob/main/sql/01_schema.sql): `sql/01_schema.sql`
- [Sample data](https://github.com/psukawala-art/cinematch-movie-recommendation/blob/main/sql/02_sample_data.sql): `sql/02_sample_data.sql`
- [SQL queries](https://github.com/psukawala-art/cinematch-movie-recommendation/blob/main/sql/03_queries.sql): `sql/03_queries.sql`

### Other components

- **Movie viewer**

## Connections

- Movie viewer → Streamlit app: selects user (evidence: `app.py`)
- Movie viewer → Streamlit app: requests recommendations (evidence: `app.py`)
- Streamlit app → MySQL access: fetches rows (evidence: `app.py`)
- MySQL access → MySQL database: executes SQL (evidence: `src/db.py`)
- Streamlit app → Genre-based suggestions: runs query (evidence: `app.py`)
- Data schema → MySQL database: sets up schema (evidence: `README.md`)
- Sample data → MySQL database: loads sample data (evidence: `README.md`)
