Skip to content

feat(client-one): Clienteling Intelligence Platform#6

Open
upare0051 wants to merge 1 commit into
mainfrom
claude/optimistic-dewdney-ad5e6e
Open

feat(client-one): Clienteling Intelligence Platform#6
upare0051 wants to merge 1 commit into
mainfrom
claude/optimistic-dewdney-ad5e6e

Conversation

@upare0051

Copy link
Copy Markdown
Owner

Summary

  • Adds apps/client-one/ — a Flask web app (port 5050) for store associates to look up customers in real-time
  • Search by name, email, or phone via Cube customer_360 semantic layer
  • Profile → Overview: loyalty tier, RFM stats, location, contact preferences + reachability counts
  • Profile → Purchases: full order line history pulled directly from Redshift gold.gold_omni_order_line_item_detail
  • Profile → SA Intel: AI-generated conversation starters, behavioral signals, and dos/don'ts derived from customer data

Prerequisites (documented in apps/client-one/README.md)

  • ActivationOS backend running on localhost:8000
  • Redshift dev tunnel open on localhost:10005
  • REDSHIFT_USER / REDSHIFT_PASSWORD env vars set (or defaults matching ~/.dbt/profiles.yml warehouse.local)

Running

cd apps/client-one
./run.sh   # creates .venv, installs deps, starts on :5050

Technical notes

  • Profile uses two separate Cube queries (dimensions + measures) to avoid JOIN fan-out that caused 503s when mixing dimension/measure types in one query
  • Purchases tab uses redshift_connector with ssl=False to talk to the port-forwarded dev cluster
  • Graceful degradation: measures query failure doesn't break the profile load

Test plan

  • ./run.sh starts without errors
  • Search "Debra Silverman" returns her as top result with $2,148 LTV
  • Search by phone +16178779794 finds Debra
  • Search by email debisilverman@gmail.com finds Debra
  • Profile Overview shows loyalty tier, RFM fields, contact prefs
  • Profile Purchases tab loads order history (requires Redshift tunnel on :10005)
  • Profile SA Intel tab shows conversation starters
  • Customer with no history (e.g. Pam Harris) shows "No purchase history" banner, not "0 orders"

🤖 Generated with Claude Code

Flask app on port 5050 serving a full customer 360° profile UI for
store associates. Connects to Cube via ActivationOS backend for
customer identity/loyalty/preferences and directly to Redshift dev
for purchase history.

Features:
- Customer search by name, email, or phone (via Cube customer_360)
- Profile page: Overview (loyalty, RFM, geo, contact prefs + reachability),
  Purchases tab (order line history from gold.gold_omni_order_line_item_detail),
  SA Intel tab (AI-generated conversation starters, signals, dos/don'ts)
- Two-query profile load (dimensions + measures separate) to avoid
  JOIN fan-out that caused 503s when mixing Cube dimension/measure queries
- Direct Redshift connection (redshift_connector, localhost:10005) for
  purchase history not available through the Cube semantic layer
- Graceful degradation: measures query failure doesn't break the profile

Prerequisites documented in apps/client-one/README.md:
- ActivationOS backend on localhost:8000
- Redshift dev tunnel on localhost:10005
- REDSHIFT_USER / REDSHIFT_PASSWORD env vars (or defaults from dbt profile)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant