Skip to content

Metabase UI

SMACKZ Analytics is the self-service analytics UI for the lakehouse, powered by Metabase OSS with a DuckDB driver reading Parquet data from Cloudflare R2.

Architecture

R2 (Parquet files)
       |
  DuckDB httpfs
       |
  +----+----+
  |         |
Query API   Metabase DuckDB Driver
  |              |
Admin UI    SMACKZ Analytics UI
                 |
      +----------+----------+
      |          |          |
  Dashboards  Reports   ML Export

Dashboards

Dashboard Description Filters
Restaurant Overview Revenue, top items, order status, AOV trends restaurant_id, date range
Customer Activity New vs returning, churn cohorts, spending tiers restaurant_id, date range
Operations Phase timing (p50/p95), fulfillment rate, peak hours restaurant_id, date range
Platform Health Active restaurants, cross-restaurant revenue, onboarding date range
ML Data Export Row counts, date ranges, data freshness none
Data Catalog Entity registry, column glossary, relationships, freshness entity
Metrics Registry Canonical metric definitions with trend charts metric name
Data Quality Pass rates, failure counts by severity, drilldown table, severity

ML Export Questions

Saved questions in the "ML Export" collection for data science workflows:

Question Use Case
Orders Full Feature Set Order-level ML features
User LTV Features Customer lifetime value prediction
Menu Demand Features Item demand forecasting
Churn Labels Binary churn classification (90-day window)
Order Timing Features Prep time prediction

Permission Groups

Group Who Access
smackz-admin Founders, platform leads Full access (dashboards, DB connections, users)
smackz-analyst Product owners, data analysts Create/edit questions, view all collections
smackz-developer Engineers View/run all, SQL editor access
smackz-readonly Occasional stakeholders View published dashboards only

Branding

The seed script applies SMACKZ branding: navy primary (#001F3F), purple accent (#6930f8), green (#2ECC71), Inter font, custom logo and favicon.

Setup and Seeding

# Build and run Metabase
docker build -t smackz-lakehouse-metabase -f Dockerfile.metabase .
docker run -d --name smackz-lakehouse-metabase -p 3011:3000 ...

# After first-time setup wizard, create an API key and run:
METABASE_URL=http://localhost:3011 \
METABASE_API_KEY="<key>" \
.venv/bin/python scripts/seed_metabase.py

The seed script is idempotent (upsert semantics). Re-running updates existing resources.

Seed Steps

python scripts/seed_metabase.py --step database    # DuckDB data source
python scripts/seed_metabase.py --step dashboards   # 8 dashboards
python scripts/seed_metabase.py --step catalog      # Data catalog
python scripts/seed_metabase.py --step metrics      # Metrics layer
python scripts/seed_metabase.py --step quality      # Data quality
python scripts/seed_metabase.py --step appearance   # SMACKZ branding

Deployment

Environment URL
QA analytics.qa.smackz.co
Staging analytics.staging.smackz.co
Production analytics.smackz.co

Key Files

  • smackz-lakehouse/metabase/README.md -- Full Metabase documentation
  • smackz-lakehouse/metabase/seed/ -- Dashboard and question definitions
  • smackz-lakehouse/metabase/client.py -- Metabase REST API client
  • smackz-lakehouse/metabase/duckdb-init.sql -- DuckDB initialization SQL
  • smackz-lakehouse/infra/metabase-secrets-runbook.md -- Secret provisioning