| |
| |
| |
|
|
| .PHONY: help setup setup-data start stop clean etl analytics test all |
|
|
| help: |
| @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' |
|
|
| |
| |
| |
|
|
| setup: |
| pip install -r requirements.txt |
|
|
| setup-data: |
| @echo "Downloading dataset from Kaggle..." |
| @mkdir -p data/raw |
| kaggle datasets download -d olistbr/brazilian-ecommerce -p data/ |
| @echo "Extracting CSV files to data/raw/..." |
| unzip -o data/brazilian-ecommerce.zip -d data/raw/ || python3 -c "import zipfile; z=zipfile.ZipFile('data/brazilian-ecommerce.zip'); z.extractall('data/raw/')" |
| @echo "Dataset ready in data/raw/" |
|
|
| |
| |
| |
|
|
| start: |
| docker-compose up -d |
| @echo "Waiting for services to initialize..." |
| @sleep 15 |
| @echo "Services started. Kafka UI: http://localhost:8080" |
|
|
| stop: |
| docker-compose down |
|
|
| restart: |
| docker-compose down && docker-compose up -d |
|
|
| logs: |
| docker-compose logs -f --tail=50 |
|
|
| status: |
| docker-compose ps |
|
|
| |
| |
| |
|
|
| etl: etl-bronze etl-gold |
|
|
| etl-bronze: |
| python transforms/bronze_to_silver.py --data-dir ./data/raw --output-dir ./data/silver |
|
|
| etl-gold: |
| python transforms/silver_to_gold.py --silver-dir ./data/silver --output-dir ./data/gold |
|
|
| etl-preprocess: |
| python analytics/data_preprocessing.py --data-dir ./data/raw --output-dir ./data/processed |
|
|
| |
| |
| |
|
|
| analytics: |
| python analytics/association_rules.py --data-dir ./data/raw --output-dir ./data/analytics |
| python analytics/customer_segmentation.py --data-dir ./data/raw --output-dir ./data/analytics |
| python analytics/satisfaction_model.py --data-dir ./data/raw --output-dir ./data/analytics |
|
|
| association: |
| python analytics/association_rules.py --data-dir ./data/raw --output-dir ./data/analytics |
|
|
| segmentation: |
| python analytics/customer_segmentation.py --data-dir ./data/raw --output-dir ./data/analytics |
|
|
| ml-model: |
| python analytics/satisfaction_model.py --data-dir ./data/raw --output-dir ./data/analytics |
|
|
| |
| |
| |
|
|
| stream: |
| python streaming_simulator/simulator.py --data-dir ./data/raw --speed 1000 |
|
|
| stream-fast: |
| python streaming_simulator/simulator.py --data-dir ./data/raw --speed 10000 --max-events 5000 |
|
|
| stream-test: |
| python -c "from streaming_simulator.simulator import OlistStreamSimulator; \ |
| sim = OlistStreamSimulator(data_dir='./data/raw', speed_factor=1000); \ |
| sim.load_data(); \ |
| print(f'Events loaded: {len(sim.events):,}'); \ |
| from collections import Counter; \ |
| c = Counter(e.event_type for e in sim.events); \ |
| [print(f' {k}: {v:,}') for k, v in sorted(c.items())]" |
|
|
| |
| |
| |
|
|
| agent: |
| python agentic_bi/orchestrator.py |
|
|
| app: |
| streamlit run frontend/streamlit_app.py --server.port 8501 |
|
|
| |
| |
| |
|
|
| test: |
| python -m pytest tests/ -v |
|
|
| quality: |
| python -c "from governance.data_governance import demo; demo()" |
|
|
| |
| |
| |
|
|
| clean: |
| rm -rf data/silver data/gold data/analytics data/processed |
| @echo "Cleaned processed data. Raw data preserved in data/raw/" |
|
|
| clean-all: clean |
| docker-compose down -v |
| @echo "All data and volumes removed." |
|
|
| |
| |
| |
|
|
| all: setup-data etl analytics |
| @echo "============================================" |
| @echo " PIPELINE COMPLETE!" |
| @echo " Gold tables: data/gold/" |
| @echo " Analytics: data/analytics/" |
| @echo "============================================" |
|
|