Skip to content

Getting Started - Developer Setup

Prerequisites

  • macOS (currently Mac Mini hosted, will need Docker/cloud for multi-dev)
  • Python 3.9+
  • PostgreSQL 17
  • Access to Vaultwarden (for API secrets)

1. Clone the Repo

git clone git@github.com:acehemani/stickymetrics.git
cd stickymetrics

2. Install Dependencies

pip install -r forecasts/requirements.txt
# Also needs: psycopg, cryptography (for vault decrypt)
pip install psycopg cryptography

3. Database Setup

# Create the database
createdb stickymetrics

# Run migrations in order
for f in db/migrations/*.sql; do
  psql stickymetrics -f "$f"
done

4. Secrets

Scripts read secrets from Vaultwarden via lib_sticky.py. You need: - ~/.bw-session - Vaultwarden session token (JSON) - ~/.bw-master-pw - Master password for vault decrypt

Ask Ace for vault access or your own Vaultwarden account.

5. Verify

# Test vault connectivity
python3 -c "from scripts.lib_sticky import get_db_url; print(get_db_url())"

# Test SP-API auth
python3 scripts/pull_orders.py --seller ecomhd_us --days 1

# Test forecast
python3 forecasts/forecast_all_lifecycle.py --seller ecomhd_us --horizon-days 30 --use-pretrained mini

6. Run the Full Pipeline

bash scripts/nightly_refresh.sh
# Logs: ~/.stickymetrics/logs/nightly_YYYY-MM-DD.log

Project Structure

stickymetrics/
├── scripts/          # Data pull/push scripts
│   ├── lib_sticky.py # Shared: vault, SP-API, Ads API helpers
│   ├── pull_*.py     # Amazon → Postgres
│   ├── push_*.py     # Postgres → Google Sheets
│   └── nightly_refresh.sh
├── forecasts/        # ML forecasting
│   ├── forecast_all_lifecycle.py
│   ├── calibrate.py
│   ├── score_run.py
│   └── validate_dashboard.py
├── db/
│   └── migrations/   # SQL migrations (run in order)
├── data/
│   └── raw/          # Temp data files (gitignored)
└── prompts/          # Agent handoff docs