# diegomonterocrc/movie_insights architecture

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

- Interactive diagram: https://gitdiagram.com/diegomonterocrc/movie_insights
- Repository: https://github.com/diegomonterocrc/movie_insights

## Overview

1. **Arquitectura general**
   - El repo está organizado como una canalización de datos simple en Python: **entrada CSV cruda → limpieza/procesamiento → CSV limpio → análisis exploratorio y dashboard**.
   - No hay base de datos ni backend separado; todo el flujo se apoya en archivos locales.

2. **Capa de datos**
   - `Data/raw/tmdb_2020_to_2025.csv` es la fuente original del proyecto, un dataset de TMDB con películas de 2020 a 2025.
   - `Data/processed/tmdb_limpio.csv` es el artefacto derivado que consume el dashboard y probablemente el resto del análisis.

3. **Subsistema de procesamiento**
   - `src/main.py` actúa como punto de entrada para el procesamiento por consola.
   - Su función es ejecutar la carga y limpieza del dataset antes de generar el archivo procesado.

4. **Lógica central de datos**
   - `src/clases/cargadorDatos.py` concentra la funcionalidad principal de ingesta y depuración.
   - Según el README, esta clase encapsula: carga del CSV, vista previa, resumen de nulos, limpieza de columnas y exportación del dataset limpio.
   - Este módulo es el núcleo reutilizable de la arquitectura.

5. **Flujo de transformación**
   - El flujo esperado es: leer CSV crudo, inspeccionar calidad de datos, eliminar columnas no útiles, revisar nulos/duplicados y guardar el resultado en `Data/processed/`.
   - Esa transformación separa claramente el **dato de origen** del **dato listo para análisis**.

6. **Dashboard interactivo**
   - `dashboard/app.py` es la aplicación principal de visualización con **Streamlit**.
   - Consume el dataset limpio para mostrar métricas, distribuciones, filtros por año e idioma, y tendencias temporales.
   - `dashboard/main.py` funciona como punto de entrada auxiliar del dashboard.

7. **Análisis exploratorio**
   - `Notebooks/01_EDA.ipynb` contiene el EDA documentado.
   - Este subsistema es analítico y no productivo: se usa para explorar estadística descriptiva, nulos, outliers, correlaciones y visualizaciones.
   - El archivo HTML exportado indica que el notebook también se presenta como reporte estático.

8. **Separación de responsabilidades**
   - La repo divide bien tres capas: **procesamiento**, **exploración**, y **visualización interactiva**.
   - El procesamiento se hace una sola vez para generar el dataset limpio; el dashboard y el notebook trabajan sobre datos ya preparados.

9. **Tecnologías relevantes**
   - El stack es **Python** con **Pandas** para manipulación de datos.
   - **Streamlit** para la interfaz interactiva.
   - **Jupyter Notebook**, **Matplotlib** y **Seaborn** para el EDA y gráficos.
   - El proyecto se desarrolla y ejecuta localmente, sin infraestructura cloud visible en el repo.

10. **Artefactos importantes para el diagrama**
   - Entrada: CSV bruto de TMDB.
   - Proceso: clase `cargadorDatos` invocada desde `src/main.py`.
   - Salida: CSV limpio en `Data/processed/`.
   - Consumidores: `dashboard/app.py` y `Notebooks/01_EDA.ipynb`.

11. **Límites del sistema**
   - El sistema depende de archivos locales y de la estructura de carpetas; no hay servicios externos en tiempo de ejecución.
   - El dashboard no parece escribir datos, solo leerlos.
   - El notebook es un entorno de análisis manual, separado de la ejecución principal.

12. **Lectura arquitectónica resumida**
   - Piensa en el repo como un pipeline de datos con dos consumidores: un reporte exploratorio y una aplicación visual.
   - El componente central es la clase de carga/limpieza, que convierte el dataset TMDB en una versión consistente para análisis posterior.

Main entry points: [`dashboard/app.py`](https://github.com/diegomonterocrc/movie_insights/blob/main/dashboard/app.py) (Streamlit app), [`Notebooks/01_EDA.ipynb`](https://github.com/diegomonterocrc/movie_insights/blob/main/Notebooks/01_EDA.ipynb) (EDA notebook), [`Data/processed/tmdb_limpio.csv`](https://github.com/diegomonterocrc/movie_insights/blob/main/Data/processed/tmdb_limpio.csv) (Clean CSV), [`src/clases/cargadorDatos.py`](https://github.com/diegomonterocrc/movie_insights/blob/main/src/clases/cargadorDatos.py) (Loader class)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data files"]
  node_data_raw_csv[("Raw CSV<br/>dataset")]
  node_data_clean_csv[("Clean CSV<br/>dataset<br/>[tmdb_limpio.csv]")]
end

subgraph group_processing["Processing"]
  node_src_main["Main entry<br/>python entrypoint<br/>[main.py]"]
  node_cargador_datos["Loader class<br/>data service<br/>[cargadorDatos.py]"]
  node_load_stage(("Load<br/>ingestion stage"))
  node_inspect_stage(("Inspect<br/>quality check"))
  node_clean_stage(("Clean<br/>transform stage"))
  node_export_stage(("Export<br/>output stage"))
end

subgraph group_dashboard["Dashboard"]
  node_dashboard_main["Dashboard entry<br/>streamlit entrypoint<br/>[main.py]"]
  node_dashboard_app["Streamlit app<br/>visualization app<br/>[app.py]"]
  node_dash_metrics(("Metrics<br/>dashboard view"))
  node_dash_filters(("Filters<br/>dashboard view"))
  node_dash_trends(("Trends<br/>dashboard view"))
end

subgraph group_exploration["EDA"]
  node_eda_notebook["EDA notebook<br/>analysis notebook<br/>[01_EDA.ipynb]"]
  node_eda_charts(("EDA charts<br/>analysis visuals"))
  node_eda_report["HTML report<br/>static report<br/>[01_EDA.html]"]
end

node_src_main -->|"runs"| node_cargador_datos
node_cargador_datos -->|"starts"| node_load_stage
node_load_stage -->|"reads"| node_data_raw_csv
node_load_stage -->|"passes"| node_inspect_stage
node_inspect_stage -->|"guides"| node_clean_stage
node_clean_stage -->|"prepares"| node_export_stage
node_export_stage -->|"writes"| node_data_clean_csv
node_dashboard_main -->|"launches"| node_dashboard_app
node_dashboard_app -->|"reads"| node_data_clean_csv
node_dashboard_app -->|"renders"| node_dash_metrics
node_dashboard_app -->|"offers"| node_dash_filters
node_dashboard_app -->|"shows"| node_dash_trends
node_eda_notebook -->|"analyzes"| node_data_clean_csv
node_eda_notebook -->|"produces"| node_eda_charts
node_eda_notebook -->|"exports"| node_eda_report

click node_data_raw_csv "https://github.com/diegomonterocrc/movie_insights/blob/main/Data/raw/tmdb_2020_to_2025.csv"
click node_data_clean_csv "https://github.com/diegomonterocrc/movie_insights/blob/main/Data/processed/tmdb_limpio.csv"
click node_src_main "https://github.com/diegomonterocrc/movie_insights/blob/main/src/main.py"
click node_cargador_datos "https://github.com/diegomonterocrc/movie_insights/blob/main/src/clases/cargadorDatos.py"
click node_dashboard_main "https://github.com/diegomonterocrc/movie_insights/blob/main/dashboard/main.py"
click node_dashboard_app "https://github.com/diegomonterocrc/movie_insights/blob/main/dashboard/app.py"
click node_eda_notebook "https://github.com/diegomonterocrc/movie_insights/blob/main/Notebooks/01_EDA.ipynb"
click node_eda_report "https://github.com/diegomonterocrc/movie_insights/blob/main/Notebooks/01_EDA.ipynb/01_EDA.html"

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_data_raw_csv,node_data_clean_csv toneBlue
class node_src_main,node_cargador_datos,node_load_stage,node_inspect_stage,node_clean_stage,node_export_stage toneAmber
class node_dashboard_main,node_dashboard_app,node_dash_metrics,node_dash_filters,node_dash_trends toneMint
class node_eda_notebook,node_eda_charts,node_eda_report toneRose
```

## Components

### Data files

Local CSV artifacts used as input and output.

- [Raw CSV](https://github.com/diegomonterocrc/movie_insights/blob/main/Data/raw/tmdb_2020_to_2025.csv): dataset · TMDB source dataset for 2020–2025. · `Data/raw/tmdb_2020_to_2025.csv`
- [Clean CSV](https://github.com/diegomonterocrc/movie_insights/blob/main/Data/processed/tmdb_limpio.csv): dataset · Processed dataset consumed by analysis and dashboard. · `Data/processed/tmdb_limpio.csv`

### Processing

Console pipeline that loads, inspects, cleans, and exports the dataset.

- [Main entry](https://github.com/diegomonterocrc/movie_insights/blob/main/src/main.py): python entrypoint · Console entrypoint for the cleaning pipeline. · `src/main.py`
- [Loader class](https://github.com/diegomonterocrc/movie_insights/blob/main/src/clases/cargadorDatos.py): data service · Reusable class that centralizes loading and cleaning logic. · `src/clases/cargadorDatos.py`
- **Load**: ingestion stage · Reads the raw CSV into memory.
- **Inspect**: quality check · Checks preview, nulls, and basic data quality.
- **Clean**: transform stage · Removes unneeded columns and cleans records.
- **Export**: output stage · Writes the cleaned CSV to the processed folder.

### Dashboard

Interactive Streamlit app that reads the cleaned dataset.

- [Dashboard entry](https://github.com/diegomonterocrc/movie_insights/blob/main/dashboard/main.py): streamlit entrypoint · Auxiliary entrypoint for launching the dashboard. · `dashboard/main.py`
- [Streamlit app](https://github.com/diegomonterocrc/movie_insights/blob/main/dashboard/app.py): visualization app · Interactive dashboard built on the cleaned dataset. · `dashboard/app.py`
- **Metrics**: dashboard view · High-level KPIs and summary cards.
- **Filters**: dashboard view · Year and language filtering controls.
- **Trends**: dashboard view · Temporal and distribution views.

### EDA

Notebook-based exploratory analysis and its exported report.

- [EDA notebook](https://github.com/diegomonterocrc/movie_insights/blob/main/Notebooks/01_EDA.ipynb): analysis notebook · Interactive exploratory analysis workspace. · `Notebooks/01_EDA.ipynb`
- **EDA charts**: analysis visuals · Descriptive statistics, outliers, correlations, and plots.
- [HTML report](https://github.com/diegomonterocrc/movie_insights/blob/main/Notebooks/01_EDA.ipynb/01_EDA.html): static report · Exported notebook report for offline viewing. · `Notebooks/01_EDA.ipynb/01_EDA.html`

## Connections

- Main entry → Loader class: runs · Console entrypoint invokes the loader/cleaner.
- Loader class → Load: starts · Begins by reading the raw dataset.
- Load → Raw CSV: reads · Loads the source CSV file.
- Load → Inspect: passes · Moves loaded data into inspection.
- Inspect → Clean: guides · Inspection informs the cleaning steps.
- Clean → Export: prepares · Cleaned rows are ready for export.
- Export → Clean CSV: writes · Creates the processed CSV artifact.
- Dashboard entry → Streamlit app: launches · Auxiliary entrypoint starts the Streamlit app.
- Streamlit app → Clean CSV: reads · Dashboard consumes the cleaned dataset.
- Streamlit app → Metrics: renders · Displays summary metrics.
- Streamlit app → Filters: offers · Provides interactive filtering controls.
- Streamlit app → Trends: shows · Visualizes distributions and trends.
- EDA notebook → Clean CSV: analyzes · Notebook works on the processed dataset.
- EDA notebook → EDA charts: produces · Creates exploratory plots and summaries.
- EDA notebook → HTML report: exports · Notebook is exported as a static HTML report.
