Prototype Demo
Run the working prototype locally and test personalization with sample data
GitHub Repository
Clone the repo to get started with the prototype implementation
Quick Start
Clone the repository and run the prototype server locally. The demo uses in-memory mock data to demonstrate personalization logic without requiring database setup.
Installation
# Navigate to prototype directory
cd prototype
# Install dependencies
npm install
# Start the server
npm startServer will start on http://localhost:3001
Prerequisites
- • Node.js 16 or higher
- • npm or yarn package manager
- • Terminal access
Mock Data Reference
Demo Users
All user IDs are SHA-256 hashed for privacy compliance.
| User ID (Hashed) | Profile | Watch History |
|---|---|---|
| 06d6cbdc... | Gaming Enthusiast | 8 gaming videos |
| 3e0e7f64... | Cooking Enthusiast | 5 cooking videos |
| b1ee9a41... | Fitness Enthusiast | 5 fitness videos |
| 4911e04c... | Tech Enthusiast | 5 tech videos |
| 6f015e46... | New User (Cold Start) | No history |
Tenants
| Tenant ID | Personalization | Weights |
|---|---|---|
| tenant1 | Enabled | 50% watch, 30% engage, 20% editorial |
| tenant2 | Enabled | 70% watch, 20% engage, 10% editorial |
| tenant3 | Disabled (Flag Off) | Editorial only |
Video Categories
40+ mock videos across 8 categories:
Try It Now
Copy and paste these curl commands to see different personalization scenarios in action.
Scenario 1: Gaming Enthusiast
User with 8 gaming video watches. Expects gaming content ranked highest.
curl "http://localhost:3001/v1/feed?user_id=06d6cbdcfc221d2f4460c17193442b9db221f30950f1c17af4e73e6e1788002b&tenant_id=tenant1&limit=10"Scenario 2: Cooking Enthusiast
User with 5 cooking video watches. Expects cooking content ranked highest.
curl "http://localhost:3001/v1/feed?user_id=3e0e7f64a2495659941e0b704069bcb310d8dfcab850ba1aa992669ef6f55bcb&tenant_id=tenant1&limit=10"Scenario 3: Cold Start (New User)
User with no watch history. Expects popular content with high editorial boost.
curl "http://localhost:3001/v1/feed?user_id=6f015e465db03f8a847292bf8624f567167f87f0ea0aa223d1e31779cad855c7&tenant_id=tenant1&limit=10"Scenario 4: Feature Flag Disabled
Same gaming user, but tenant has personalization disabled. Expects editorial-only ranking.
curl "http://localhost:3001/v1/feed?user_id=06d6cbdcfc221d2f4460c17193442b9db221f30950f1c17af4e73e6e1788002b&tenant_id=tenant3&limit=10"Scenario 5: Different Tenant Weights
Same gaming user with tenant2 (70% watch history weight vs 50% default). Notice different rankings.
curl "http://localhost:3001/v1/feed?user_id=06d6cbdcfc221d2f4460c17193442b9db221f30950f1c17af4e73e6e1788002b&tenant_id=tenant2&limit=10"Run the Demo Script
For an automated walkthrough of all scenarios with formatted output, run the included demo script.
# Make sure server is running in another terminal, then:
cd prototype
./tests/demo.shThe demo script will show all five scenarios with timing information and highlight the differences between personalized and non-personalized feeds.
Test Gradual Rollout
Test the percentage-based rollout feature to see how users are consistently bucketed into personalized vs. non-personalized experiences during gradual deployment.
# Make sure server is running in another terminal, then:
cd prototype
./tests/test-rollout.shWhat This Tests
- • 50% rollout on tenant4: Half of users get personalized feeds
- • Consistent bucketing: Same user always gets same experience
- • Hash-based assignment: Uses user_id hash for deterministic splitting
- • Gradual rollout strategy: Simulates 0% → 10% → 50% → 100% deployment
This demonstrates the safe rollout approach described in the Rollout & Observability documentation.