# valeriaromo/chequi_proyecto architecture

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

- Interactive diagram: https://gitdiagram.com/valeriaromo/chequi_proyecto
- Repository: https://github.com/valeriaromo/chequi_proyecto

## Overview

ChequiProyecto is a municipal, one-day rainfall-occurrence and minimum-temperature forecasting product for Aguascalientes, with a web dashboard that presents forecasts and checks recent accuracy and rainfall reliability. Its documented data workflow runs from source ingestion through validation and a daily master table; the application serves predictions and monitoring. The repository also contains model evaluation, explainability, segmentation, and climate-analysis capabilities. Some pipeline files were not sampled, so those branches are represented at their supported directory or module paths, and uncertain implementation links are omitted.

Main entry points: [`src/pipeline/build_master_table.py`](https://github.com/valeriaromo/chequi_proyecto/blob/main/src/pipeline/build_master_table.py) (Daily master table), [`src/ingestion`](https://github.com/valeriaromo/chequi_proyecto/tree/main/src/ingestion) (Source ingestion), [`src/app/routes/api.py`](https://github.com/valeriaromo/chequi_proyecto/blob/main/src/app/routes/api.py) (Web API routes), [`src/pipeline/clean.py`](https://github.com/valeriaromo/chequi_proyecto/blob/main/src/pipeline/clean.py) (Source cleaning)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data preparation"]
  node_ingest["Source ingestion"]
  node_clean["Source cleaning<br/>[clean.py]"]
  node_master[("Daily master table")]
end

subgraph group_models["Forecast and analysis"]
  node_models_core["Forecast models"]
  node_deep_learning["Deep learning"]
  node_validation["Validation and leakage audits"]
  node_exp_ai["Model explanations"]
  node_segmentation["Municipal segmentation"]
  node_pca["PCA analysis<br/>[pca_analysis.py]"]
  node_variable_analysis["Variable analysis"]
end

subgraph group_web["Web application"]
  node_predictor["Forecast predictor<br/>[predictor.py]"]
  node_api["Web API routes<br/>[api.py]"]
  node_prediction_service["Prediction service<br/>[predictions.py]"]
  node_alert_service["Reliability alerts<br/>[alerts.py]"]
  node_metrics_service["Forecast metrics<br/>[metrics.py]"]
  node_functionality_service["Feature status<br/>[functionality.py]"]
  node_dashboard["Dashboard routes<br/>[dashboard.py]"]
  node_ui["Browser dashboard<br/>[app.js]"]
end

subgraph group_support["Shared runtime"]
  node_settings["Geographic and date settings<br/>[settings.py]"]
  node_io["Parquet I/O<br/>[io_utils.py]"]
end

node_user(("Dashboard user"))
node_weather_sources(("Weather sources"))
node_geo_sources(("Geospatial sources"))
node_air_sources(("Air-quality sources"))

node_weather_sources -->|"provides weather data"| node_ingest
node_geo_sources -->|"provides geography"| node_ingest
node_air_sources -->|"provides air data"| node_ingest
node_ingest -->|"writes processed data"| node_clean
node_clean -->|"validates sources"| node_master
node_master -.->|"supplies forecast data"| node_predictor
node_master -.->|"supports evaluation"| node_models_core
node_master -.->|"analyzed as data"| node_pca
node_master -->|"analyzed as data"| node_variable_analysis
node_master -.->|"supports training"| node_deep_learning
node_models_core -.->|"audited by"| node_validation
node_models_core -.->|"explained by"| node_exp_ai
node_master -.->|"supports clustering"| node_segmentation
node_api -->|"calls"| node_prediction_service
node_api -->|"calls"| node_alert_service
node_api -->|"calls"| node_metrics_service
node_api -->|"calls"| node_functionality_service
node_prediction_service -->|"uses forecasts"| node_predictor
node_alert_service -->|"uses model data"| node_predictor
node_dashboard -->|"calls"| node_prediction_service
node_user -.->|"views forecasts"| node_ui
node_ui -.->|"requests data"| node_api
node_settings -->|"configures sources"| node_ingest
node_settings -->|"provides catalog"| node_clean
node_ingest -->|"persists parquet"| node_io
node_clean -->|"writes parquet"| node_io

click node_ingest "https://github.com/valeriaromo/chequi_proyecto/tree/main/src/ingestion"
click node_clean "https://github.com/valeriaromo/chequi_proyecto/blob/main/src/pipeline/clean.py"
click node_master "https://github.com/valeriaromo/chequi_proyecto/blob/main/src/pipeline/build_master_table.py"
click node_settings "https://github.com/valeriaromo/chequi_proyecto/blob/main/config/settings.py"
click node_models_core "https://github.com/valeriaromo/chequi_proyecto/tree/main/src/pipeline/models"
click node_deep_learning "https://github.com/valeriaromo/chequi_proyecto/tree/main/src/pipeline/deep_learning"
click node_validation "https://github.com/valeriaromo/chequi_proyecto/tree/main/src/pipeline/dl_validation"
click node_exp_ai "https://github.com/valeriaromo/chequi_proyecto/tree/main/src/pipeline/exp_ai"
click node_segmentation "https://github.com/valeriaromo/chequi_proyecto/tree/main/src/pipeline/segmentation"
click node_pca "https://github.com/valeriaromo/chequi_proyecto/blob/main/src/data_analysis/pca_analysis.py"
click node_variable_analysis "https://github.com/valeriaromo/chequi_proyecto/blob/main/src/data_analysis/variable_analysis.py"
click node_predictor "https://github.com/valeriaromo/chequi_proyecto/blob/main/src/app/predictor.py"
click node_api "https://github.com/valeriaromo/chequi_proyecto/blob/main/src/app/routes/api.py"
click node_prediction_service "https://github.com/valeriaromo/chequi_proyecto/blob/main/src/app/services/predictions.py"
click node_alert_service "https://github.com/valeriaromo/chequi_proyecto/blob/main/src/app/services/alerts.py"
click node_metrics_service "https://github.com/valeriaromo/chequi_proyecto/blob/main/src/app/services/metrics.py"
click node_functionality_service "https://github.com/valeriaromo/chequi_proyecto/blob/main/src/app/services/functionality.py"
click node_dashboard "https://github.com/valeriaromo/chequi_proyecto/blob/main/src/app/routes/dashboard.py"
click node_ui "https://github.com/valeriaromo/chequi_proyecto/blob/main/src/app/static/js/app.js"
click node_io "https://github.com/valeriaromo/chequi_proyecto/blob/main/src/utils/io_utils.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_ingest,node_clean,node_master,node_user toneBlue
class node_models_core,node_deep_learning,node_validation,node_exp_ai,node_segmentation,node_pca,node_variable_analysis toneAmber
class node_predictor,node_api,node_prediction_service,node_alert_service,node_metrics_service,node_functionality_service,node_dashboard,node_ui toneMint
class node_settings,node_io toneRose
class node_weather_sources,node_geo_sources,node_air_sources toneIndigo
```

## Components

### Data preparation

- [Source ingestion](https://github.com/valeriaromo/chequi_proyecto/tree/main/src/ingestion): `src/ingestion`
- [Source cleaning](https://github.com/valeriaromo/chequi_proyecto/blob/main/src/pipeline/clean.py): `src/pipeline/clean.py`
- [Daily master table](https://github.com/valeriaromo/chequi_proyecto/blob/main/src/pipeline/build_master_table.py): `src/pipeline/build_master_table.py`

### Forecast and analysis

- [Forecast models](https://github.com/valeriaromo/chequi_proyecto/tree/main/src/pipeline/models): `src/pipeline/models`
- [Deep learning](https://github.com/valeriaromo/chequi_proyecto/tree/main/src/pipeline/deep_learning): `src/pipeline/deep_learning`
- [Validation and leakage audits](https://github.com/valeriaromo/chequi_proyecto/tree/main/src/pipeline/dl_validation): `src/pipeline/dl_validation`
- [Model explanations](https://github.com/valeriaromo/chequi_proyecto/tree/main/src/pipeline/exp_ai): `src/pipeline/exp_ai`
- [Municipal segmentation](https://github.com/valeriaromo/chequi_proyecto/tree/main/src/pipeline/segmentation): `src/pipeline/segmentation`
- [PCA analysis](https://github.com/valeriaromo/chequi_proyecto/blob/main/src/data_analysis/pca_analysis.py): `src/data_analysis/pca_analysis.py`
- [Variable analysis](https://github.com/valeriaromo/chequi_proyecto/blob/main/src/data_analysis/variable_analysis.py): `src/data_analysis/variable_analysis.py`

### Web application

- [Forecast predictor](https://github.com/valeriaromo/chequi_proyecto/blob/main/src/app/predictor.py): `src/app/predictor.py`
- [Web API routes](https://github.com/valeriaromo/chequi_proyecto/blob/main/src/app/routes/api.py): `src/app/routes/api.py`
- [Prediction service](https://github.com/valeriaromo/chequi_proyecto/blob/main/src/app/services/predictions.py): `src/app/services/predictions.py`
- [Reliability alerts](https://github.com/valeriaromo/chequi_proyecto/blob/main/src/app/services/alerts.py): `src/app/services/alerts.py`
- [Forecast metrics](https://github.com/valeriaromo/chequi_proyecto/blob/main/src/app/services/metrics.py): `src/app/services/metrics.py`
- [Feature status](https://github.com/valeriaromo/chequi_proyecto/blob/main/src/app/services/functionality.py): `src/app/services/functionality.py`
- [Dashboard routes](https://github.com/valeriaromo/chequi_proyecto/blob/main/src/app/routes/dashboard.py): `src/app/routes/dashboard.py`
- [Browser dashboard](https://github.com/valeriaromo/chequi_proyecto/blob/main/src/app/static/js/app.js): `src/app/static/js/app.js`

### Shared runtime

- [Geographic and date settings](https://github.com/valeriaromo/chequi_proyecto/blob/main/config/settings.py): `config/settings.py`
- [Parquet I/O](https://github.com/valeriaromo/chequi_proyecto/blob/main/src/utils/io_utils.py): `src/utils/io_utils.py`

### Other components

- **Dashboard user**
- **Weather sources**
- **Geospatial sources**
- **Air-quality sources**

## Connections

- Weather sources → Source ingestion: provides weather data
- Geospatial sources → Source ingestion: provides geography
- Air-quality sources → Source ingestion: provides air data
- Source ingestion → Source cleaning: writes processed data
- Source cleaning → Daily master table: validates sources
- Daily master table → Forecast predictor: supplies forecast data
- Daily master table → Forecast models: supports evaluation
- Daily master table → PCA analysis: analyzed as data
- Daily master table → Variable analysis: analyzed as data (evidence: `src/data_analysis/variable_analysis.py`)
- Daily master table → Deep learning: supports training
- Forecast models → Validation and leakage audits: audited by
- Forecast models → Model explanations: explained by
- Daily master table → Municipal segmentation: supports clustering
- Web API routes → Prediction service: calls (evidence: `src/app/routes/api.py`)
- Web API routes → Reliability alerts: calls (evidence: `src/app/routes/api.py`)
- Web API routes → Forecast metrics: calls (evidence: `src/app/routes/api.py`)
- Web API routes → Feature status: calls (evidence: `src/app/routes/api.py`)
- Prediction service → Forecast predictor: uses forecasts (evidence: `src/app/services/predictions.py`)
- Reliability alerts → Forecast predictor: uses model data (evidence: `src/app/services/alerts.py`)
- Dashboard routes → Prediction service: calls (evidence: `src/app/routes/dashboard.py`)
- Dashboard user → Browser dashboard: views forecasts
- Browser dashboard → Web API routes: requests data
- Geographic and date settings → Source ingestion: configures sources (evidence: `src/ingestion/chirps.py`)
- Geographic and date settings → Source cleaning: provides catalog (evidence: `src/pipeline/clean.py`)
- Source ingestion → Parquet I/O: persists parquet (evidence: `src/ingestion/chirps.py`)
- Source cleaning → Parquet I/O: writes parquet (evidence: `src/pipeline/clean.py`)
