# gloriafalves/retail-data-analysis architecture

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

- Interactive diagram: https://gitdiagram.com/gloriafalves/retail-data-analysis
- Repository: https://github.com/gloriafalves/retail-data-analysis

## Overview

This repository is a retail analytics and data-science project. Its documented workflow spans sales-data exploration, schema inference and PostgreSQL loading, SQL business analysis, demand forecasting and item recommendations; a Power BI dashboard is documented but is not present in the supplied tree. The ingestion excerpts support the schema-generation and CSV-loading responsibilities, but do not establish that their differing schema paths are wired together. SQL and notebooks are represented by their documented roles; their internal calls and data transfers were not sampled.

Main entry points: [`02_pipeline_ingestao/q2_inferencia_schema.py`](https://github.com/gloriafalves/retail-data-analysis/blob/main/02_pipeline_ingestao/q2_inferencia_schema.py) (Schema inference), [`02_pipeline_ingestao/q3_carga_dados.py`](https://github.com/gloriafalves/retail-data-analysis/blob/main/02_pipeline_ingestao/q3_carga_dados.py) (CSV loader), [`01_eda_sql/q1_eda.sql`](https://github.com/gloriafalves/retail-data-analysis/blob/main/01_eda_sql/q1_eda.sql) (Sales EDA), [`02_pipeline_ingestao/schema.sql`](https://github.com/gloriafalves/retail-data-analysis/blob/main/02_pipeline_ingestao/schema.sql) (Generated DDL)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_eda["Data exploration"]
  node_eda_sql["Sales EDA<br/>[q1_eda.sql]"]
end

subgraph group_ingest["Data ingestion"]
  node_infer["Schema inference"]
  node_ddl["Generated DDL<br/>[schema.sql]"]
  node_loader["CSV loader<br/>[q3_carga_dados.py]"]
  node_pg[("PostgreSQL")]
end

subgraph group_analysis["SQL analysis"]
  node_customer_sql["Customer analysis"]
  node_calendar_sql["Calendar dimension"]
end

subgraph group_science["Data science"]
  node_forecast["Demand forecast"]
  node_recommend["Item recommender"]
end

subgraph group_bi["Business intelligence"]
  node_dashboard["Executive dashboard"]
end

node_analyst(("Analyst"))
node_raw["ERP CSVs"]

node_analyst -->|"explores sales"| node_eda_sql
node_raw -->|"examines orders"| node_eda_sql
node_analyst -->|"initiates inference"| node_infer
node_raw -->|"samples CSVs"| node_infer
node_infer -->|"generates schema"| node_ddl
node_analyst -->|"initiates loading"| node_loader
node_raw -->|"reads CSVs"| node_loader
node_loader -->|"creates and loads"| node_pg
node_analyst -->|"segments customers"| node_customer_sql
node_analyst -->|"builds date dimension"| node_calendar_sql
node_analyst -->|"forecasts demand"| node_forecast
node_analyst -->|"requests recommendations"| node_recommend
node_analyst -.->|"reviews performance"| node_dashboard

click node_eda_sql "https://github.com/gloriafalves/retail-data-analysis/blob/main/01_eda_sql/q1_eda.sql"
click node_infer "https://github.com/gloriafalves/retail-data-analysis/blob/main/02_pipeline_ingestao/q2_inferencia_schema.py"
click node_ddl "https://github.com/gloriafalves/retail-data-analysis/blob/main/02_pipeline_ingestao/schema.sql"
click node_loader "https://github.com/gloriafalves/retail-data-analysis/blob/main/02_pipeline_ingestao/q3_carga_dados.py"
click node_customer_sql "https://github.com/gloriafalves/retail-data-analysis/blob/main/03_analises_sql/q4_analise_clientes.sql"
click node_calendar_sql "https://github.com/gloriafalves/retail-data-analysis/blob/main/03_analises_sql/q5_dimensao_calendario.sql"
click node_forecast "https://github.com/gloriafalves/retail-data-analysis/blob/main/04_data_science/q6_previsao_demanda.ipynb"
click node_recommend "https://github.com/gloriafalves/retail-data-analysis/blob/main/04_data_science/q7_sistema_recomendacao.ipynb"

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_eda_sql toneBlue
class node_infer,node_ddl,node_loader,node_pg toneAmber
class node_customer_sql,node_calendar_sql toneMint
class node_forecast,node_recommend toneRose
class node_dashboard,node_analyst,node_raw toneIndigo
```

## Components

### Data exploration

- [Sales EDA](https://github.com/gloriafalves/retail-data-analysis/blob/main/01_eda_sql/q1_eda.sql): `01_eda_sql/q1_eda.sql`

### Data ingestion

- [Schema inference](https://github.com/gloriafalves/retail-data-analysis/blob/main/02_pipeline_ingestao/q2_inferencia_schema.py): `02_pipeline_ingestao/q2_inferencia_schema.py`
- [Generated DDL](https://github.com/gloriafalves/retail-data-analysis/blob/main/02_pipeline_ingestao/schema.sql): `02_pipeline_ingestao/schema.sql`
- [CSV loader](https://github.com/gloriafalves/retail-data-analysis/blob/main/02_pipeline_ingestao/q3_carga_dados.py): `02_pipeline_ingestao/q3_carga_dados.py`
- **PostgreSQL**

### SQL analysis

- [Customer analysis](https://github.com/gloriafalves/retail-data-analysis/blob/main/03_analises_sql/q4_analise_clientes.sql): `03_analises_sql/q4_analise_clientes.sql`
- [Calendar dimension](https://github.com/gloriafalves/retail-data-analysis/blob/main/03_analises_sql/q5_dimensao_calendario.sql): `03_analises_sql/q5_dimensao_calendario.sql`

### Data science

- [Demand forecast](https://github.com/gloriafalves/retail-data-analysis/blob/main/04_data_science/q6_previsao_demanda.ipynb): `04_data_science/q6_previsao_demanda.ipynb`
- [Item recommender](https://github.com/gloriafalves/retail-data-analysis/blob/main/04_data_science/q7_sistema_recomendacao.ipynb): `04_data_science/q7_sistema_recomendacao.ipynb`

### Business intelligence

- **Executive dashboard**

### Other components

- **Analyst**
- **ERP CSVs**

## Connections

- Analyst → Sales EDA: explores sales (evidence: `README.md`)
- ERP CSVs → Sales EDA: examines orders (evidence: `README.md`)
- Analyst → Schema inference: initiates inference (evidence: `02_pipeline_ingestao/q2_inferencia_schema.py`)
- ERP CSVs → Schema inference: samples CSVs (evidence: `02_pipeline_ingestao/q2_inferencia_schema.py`)
- Schema inference → Generated DDL: generates schema (evidence: `02_pipeline_ingestao/q2_inferencia_schema.py`)
- Analyst → CSV loader: initiates loading (evidence: `02_pipeline_ingestao/q3_carga_dados.py`)
- ERP CSVs → CSV loader: reads CSVs (evidence: `02_pipeline_ingestao/q3_carga_dados.py`)
- CSV loader → PostgreSQL: creates and loads (evidence: `02_pipeline_ingestao/q3_carga_dados.py`)
- Analyst → Customer analysis: segments customers (evidence: `README.md`)
- Analyst → Calendar dimension: builds date dimension (evidence: `README.md`)
- Analyst → Demand forecast: forecasts demand (evidence: `README.md`)
- Analyst → Item recommender: requests recommendations (evidence: `README.md`)
- Analyst → Executive dashboard: reviews performance (evidence: `README.md`)
