Imported from PacoAcun/Bussiness_Inteligence (
dw_e-commerce/AGENTS.md). Install upstream withnpx skills add PacoAcun/Bussiness_Inteligence --skill dw_e-commerce. Copyright stays with the author.
dw_e-commerce — Agent Notes
What this repo is
- Academic BI / Data Warehouse project. Not an application service.
- Entry data:
ecommerce_sales_34500.csvplus two pre-aggregated gold CSVs. - Artifacts: SQL scripts for staging → DW → gold layer, a Tableau workbook (
Graficos.twb), and PDF reports.
Execution model
- No build system, no CI, no tests, no package manager.
- SQL scripts are run manually in a MySQL/MariaDB environment.
SQL script order
Run sequentially; each depends on the previous:
querys/01_staging_ecommerce.sql— recreatesecommerce_stg.ecommerce_sales_34500and expects the CSV already loaded (the comment says it was done via import wizard).querys/02_create_dw_ecommerce.sql— createsecommerce_dwwith star-schema dims + fact table.querys/03_load_dw_ecommerce.sql— idempotent inserts (INSERT IGNORE,WHERE NOT EXISTSbyorder_id). Safe to rerun.querys/04_create_gold_layer.sql— drops and recreatesecommerce_goldsummary tables (gold_sales_region_category,gold_sales_day).querys/05_data_validations.sql— row counts, sums, orphaned rows, null checks; run after load.
Database assumptions
- MySQL 8 or MariaDB. Uses
AUTO_INCREMENT,DECIMAL,TINYINT,INSERT IGNORE,NULLIF, andSIGNEDcasts. ecommerce_sales_34500.csvis treated as already imported into staging via the DB import wizard; the script only recreates the schema.
What not to guess
- Do not add Python scripts, Docker, or DBT unless explicitly asked. There is no evidence of such tooling.
- Do not invent
requirements.txt,Makefile, or virtual environments. - The folder
agente de dashboards/is empty; do not assume it contains code.
Artifacts to preserve
ecommerce_sales_34500.csv: downstream SQL depends on exact column names and semantics.gold_sales_day.csv,gold_sales_region_category.csv: generated exports; keep in sync if gold SQL changes.Graficos.twb,Informe.pdf,Presentación.pdf: avoid hand-editing PDFs. If model or data changes, prefer regenerating outputs via the actual tool (Tableau / export) rather than patching binary/XML files.
Streamlit Dashboard (server.py + webui.py)
- Two-file Streamlit dashboard app with an integrated LLM agent.
- server.py: Data loading (3 CSVs), 11 calculated fields, 5 quick table calcs, 25 chart generators, LLM agent via Ollama (default model:
kimi-k2.6:cloud). - webui.py: Streamlit UI with 4 tabs (Dashboard 1, Dashboard 2, Historia, Explorador). Sidebar has global filters + LLM chat.
- Run:
streamlit run webui.pyfrom the project root directory. - Dependencies:
streamlit,pandas,plotly,ollama(install via pip if missing). - Ollama: Must be running locally for LLM chat to work. Charts work without it.
Verification
- After running scripts, run
05_data_validations.sqlto confirmstg_count == fact_countand totals match. - For Streamlit: verify with
python -m py_compile server.pyandpython -m py_compile webui.py.