# mathura-snth/nlp-movie-recommender-dwl architecture

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

- Interactive diagram: https://gitdiagram.com/mathura-snth/nlp-movie-recommender-dwl
- Repository: https://github.com/mathura-snth/nlp-movie-recommender-dwl

## Overview

Don't Watchlist is a fear-driven movie-avoidance search application, with an archived NLP research prototype. In the main workflow, users search the PHP site; its service proxies requests to the Flask API, which invokes semantic search and returns ranked films. Users can add films to a watchlist and manage profiles, settings, and badges through the same service/API boundary. The backend persists application data through its repository and ORM. The README documents both TF-IDF and embedding research branches; their internal details are only partly sampled, so those links are limited to documented capabilities.

Main entry points: [`DWL_PP/siteweb/service/MovieService.php`](https://github.com/mathura-snth/nlp-movie-recommender-dwl/blob/main/DWL_PP/siteweb/service/MovieService.php) (Movie service proxy), [`DWL_PP/app/app.py`](https://github.com/mathura-snth/nlp-movie-recommender-dwl/blob/main/DWL_PP/app/app.py) (Flask API), [`DWL_PP/siteweb/MoteurRecherche.php`](https://github.com/mathura-snth/nlp-movie-recommender-dwl/blob/main/DWL_PP/siteweb/MoteurRecherche.php) (Search page), [`DWL_PP/app/repository.py`](https://github.com/mathura-snth/nlp-movie-recommender-dwl/blob/main/DWL_PP/app/repository.py) (Application repository)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_search_ui["Search page"]
  node_watchlist_ui["Watchlist page<br/>[DWL.php]"]
  node_account_ui["Login and registration<br/>[Login.php]"]
  node_profile_ui["Profile and badges<br/>[MyProfile.php]"]
  node_settings_ui["Account settings<br/>[Settings.php]"]
  node_php_views["Page views"]
  node_movie_service["Movie service proxy<br/>[MovieService.php]"]
end

subgraph group_api["Application API"]
  node_flask_api["Flask API<br/>[app.py]"]
  node_search_engine["Runtime search<br/>[search_moteur.py]"]
  node_tmdb["TMDB metadata"]
end

subgraph group_data["Persistence"]
  node_repository["Application repository<br/>[repository.py]"]
  node_orm["Data models<br/>[orm.py]"]
  node_db_session["Database sessions<br/>[db.py]"]
  node_tidb[("TiDB database")]
end

subgraph group_research["NLP research"]
  node_tfidf["TF-IDF search<br/>[projet_tfidf.py]"]
  node_embeddings["Embedding search<br/>[projet_emb.py]"]
  node_tfidf_eval["TF-IDF evaluation"]
  node_embedding_eval["Embedding evaluation<br/>[evaluation_emb.py]"]
end

node_user(("User"))

node_user -->|"submits query"| node_search_ui
node_search_ui -->|"requests search"| node_movie_service
node_watchlist_ui -.->|"requests watchlist"| node_movie_service
node_account_ui -->|"requests login"| node_movie_service
node_profile_ui -->|"manages profile"| node_movie_service
node_settings_ui -->|"updates settings"| node_movie_service
node_search_ui -->|"renders"| node_php_views
node_movie_service -->|"proxies HTTP"| node_flask_api
node_flask_api -->|"calls search"| node_search_engine
node_flask_api -->|"handles data"| node_repository
node_flask_api -->|"fetches metadata"| node_tmdb
node_repository -->|"opens sessions"| node_db_session
node_repository -->|"queries models"| node_orm
node_db_session -->|"connects to"| node_tidb
node_tfidf -->|"evaluated by"| node_tfidf_eval
node_embeddings -->|"evaluated by"| node_embedding_eval

click node_search_ui "https://github.com/mathura-snth/nlp-movie-recommender-dwl/blob/main/DWL_PP/siteweb/MoteurRecherche.php"
click node_watchlist_ui "https://github.com/mathura-snth/nlp-movie-recommender-dwl/blob/main/DWL_PP/siteweb/DWL.php"
click node_account_ui "https://github.com/mathura-snth/nlp-movie-recommender-dwl/blob/main/DWL_PP/siteweb/Login.php"
click node_profile_ui "https://github.com/mathura-snth/nlp-movie-recommender-dwl/blob/main/DWL_PP/siteweb/MyProfile.php"
click node_settings_ui "https://github.com/mathura-snth/nlp-movie-recommender-dwl/blob/main/DWL_PP/siteweb/Settings.php"
click node_php_views "https://github.com/mathura-snth/nlp-movie-recommender-dwl/tree/main/DWL_PP/siteweb/view"
click node_movie_service "https://github.com/mathura-snth/nlp-movie-recommender-dwl/blob/main/DWL_PP/siteweb/service/MovieService.php"
click node_flask_api "https://github.com/mathura-snth/nlp-movie-recommender-dwl/blob/main/DWL_PP/app/app.py"
click node_search_engine "https://github.com/mathura-snth/nlp-movie-recommender-dwl/blob/main/DWL_PP/app/search_moteur.py"
click node_repository "https://github.com/mathura-snth/nlp-movie-recommender-dwl/blob/main/DWL_PP/app/repository.py"
click node_orm "https://github.com/mathura-snth/nlp-movie-recommender-dwl/blob/main/DWL_PP/app/orm.py"
click node_db_session "https://github.com/mathura-snth/nlp-movie-recommender-dwl/blob/main/DWL_PP/app/db.py"
click node_tfidf "https://github.com/mathura-snth/nlp-movie-recommender-dwl/blob/main/DWL_TAL/projet_tfidf.py"
click node_embeddings "https://github.com/mathura-snth/nlp-movie-recommender-dwl/blob/main/DWL_TAL/projet_emb.py"
click node_tfidf_eval "https://github.com/mathura-snth/nlp-movie-recommender-dwl/blob/main/DWL_TAL/evaluation_tfidf.py"
click node_embedding_eval "https://github.com/mathura-snth/nlp-movie-recommender-dwl/blob/main/DWL_TAL/evaluation_emb.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_search_ui,node_watchlist_ui,node_account_ui,node_profile_ui,node_settings_ui,node_php_views,node_movie_service,node_user toneBlue
class node_flask_api,node_search_engine,node_tmdb toneAmber
class node_repository,node_orm,node_db_session,node_tidb toneMint
class node_tfidf,node_embeddings,node_tfidf_eval,node_embedding_eval toneRose
```

## Components

### Web experience

- [Search page](https://github.com/mathura-snth/nlp-movie-recommender-dwl/blob/main/DWL_PP/siteweb/MoteurRecherche.php): `DWL_PP/siteweb/MoteurRecherche.php`
- [Watchlist page](https://github.com/mathura-snth/nlp-movie-recommender-dwl/blob/main/DWL_PP/siteweb/DWL.php): `DWL_PP/siteweb/DWL.php`
- [Login and registration](https://github.com/mathura-snth/nlp-movie-recommender-dwl/blob/main/DWL_PP/siteweb/Login.php): `DWL_PP/siteweb/Login.php`
- [Profile and badges](https://github.com/mathura-snth/nlp-movie-recommender-dwl/blob/main/DWL_PP/siteweb/MyProfile.php): `DWL_PP/siteweb/MyProfile.php`
- [Account settings](https://github.com/mathura-snth/nlp-movie-recommender-dwl/blob/main/DWL_PP/siteweb/Settings.php): `DWL_PP/siteweb/Settings.php`
- [Page views](https://github.com/mathura-snth/nlp-movie-recommender-dwl/tree/main/DWL_PP/siteweb/view): `DWL_PP/siteweb/view`
- [Movie service proxy](https://github.com/mathura-snth/nlp-movie-recommender-dwl/blob/main/DWL_PP/siteweb/service/MovieService.php): `DWL_PP/siteweb/service/MovieService.php`

### Application API

- [Flask API](https://github.com/mathura-snth/nlp-movie-recommender-dwl/blob/main/DWL_PP/app/app.py): `DWL_PP/app/app.py`
- [Runtime search](https://github.com/mathura-snth/nlp-movie-recommender-dwl/blob/main/DWL_PP/app/search_moteur.py): `DWL_PP/app/search_moteur.py`
- **TMDB metadata**

### Persistence

- [Application repository](https://github.com/mathura-snth/nlp-movie-recommender-dwl/blob/main/DWL_PP/app/repository.py): `DWL_PP/app/repository.py`
- [Data models](https://github.com/mathura-snth/nlp-movie-recommender-dwl/blob/main/DWL_PP/app/orm.py): `DWL_PP/app/orm.py`
- [Database sessions](https://github.com/mathura-snth/nlp-movie-recommender-dwl/blob/main/DWL_PP/app/db.py): `DWL_PP/app/db.py`
- **TiDB database**

### NLP research

- [TF-IDF search](https://github.com/mathura-snth/nlp-movie-recommender-dwl/blob/main/DWL_TAL/projet_tfidf.py): `DWL_TAL/projet_tfidf.py`
- [Embedding search](https://github.com/mathura-snth/nlp-movie-recommender-dwl/blob/main/DWL_TAL/projet_emb.py): `DWL_TAL/projet_emb.py`
- [TF-IDF evaluation](https://github.com/mathura-snth/nlp-movie-recommender-dwl/blob/main/DWL_TAL/evaluation_tfidf.py): `DWL_TAL/evaluation_tfidf.py`
- [Embedding evaluation](https://github.com/mathura-snth/nlp-movie-recommender-dwl/blob/main/DWL_TAL/evaluation_emb.py): `DWL_TAL/evaluation_emb.py`

### Other components

- **User**

## Connections

- User → Search page: submits query
- Search page → Movie service proxy: requests search (evidence: `DWL_PP/siteweb/MoteurRecherche.php`)
- Watchlist page → Movie service proxy: requests watchlist (evidence: `DWL_PP/siteweb/DWL.php`)
- Login and registration → Movie service proxy: requests login (evidence: `DWL_PP/siteweb/Login.php`)
- Profile and badges → Movie service proxy: manages profile (evidence: `DWL_PP/siteweb/MyProfile.php`)
- Account settings → Movie service proxy: updates settings (evidence: `DWL_PP/siteweb/Settings.php`)
- Search page → Page views: renders (evidence: `DWL_PP/siteweb/MoteurRecherche.php`)
- Movie service proxy → Flask API: proxies HTTP (evidence: `DWL_PP/siteweb/service/MovieService.php`)
- Flask API → Runtime search: calls search (evidence: `DWL_PP/app/app.py`)
- Flask API → Application repository: handles data (evidence: `DWL_PP/app/app.py`)
- Flask API → TMDB metadata: fetches metadata (evidence: `DWL_PP/app/app.py`)
- Application repository → Database sessions: opens sessions (evidence: `DWL_PP/app/repository.py`)
- Application repository → Data models: queries models (evidence: `DWL_PP/app/repository.py`)
- Database sessions → TiDB database: connects to (evidence: `README.md`)
- TF-IDF search → TF-IDF evaluation: evaluated by (evidence: `DWL_TAL/evaluation_tfidf.py`)
- Embedding search → Embedding evaluation: evaluated by (evidence: `DWL_TAL/evaluation_emb.py`)
