Project 14 of ~34
πΏ Streaming Stack β Architecture
Personalized cross-platform streaming recommendation service. SvelteKit dashboard + Deno backend + Supabase + Ollama (Mac Mini) for recommendation engine.
SvelteKit
Deno
Supabase
Content API
Streaming Stack has three core systems: (1) a content metadata database with cross-platform availability, (2) a recommendation engine matching mood/context to titles, and (3) a watchlist + expiration alert system. The Mac Mini handles nightly data refreshes and the recommendation AI pipeline.
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β USER INTERFACE β
β ββββββββββββββββ βββββββββββββββ ββββββββββββββββ β
β β Web App β β Telegram β β Email β β
β β (SvelteKit) β β Bot β β (Resend) β β
β β Dashboard β β Chat UI β β Digests β β
β ββββββββ¬ββββββββ ββββββββ¬βββββββ ββββββββ¬βββββββ β
βββββββββββΌβββββββββββββββββββΌβββββββββββββββββββΌββββββββββ
β β β
βΌ βΌ βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β APPLICATION LAYER (Deno) β
β ββββββββββββββ ββββββββββββββ ββββββββββββββββββ β
β β Rec Engine β β Watchlist β β Expiration β β
β β Service β β Service β β Alert Service β β
β ββββββββββββββ ββββββββββββββ ββββββββββββββββββ β
β ββββββββββββββ ββββββββββββββ ββββββββββββββββββ β
β β Content β β User Prefs β β Analytics β β
β β Sync β β Service β β Service β β
β ββββββββββββββ ββββββββββββββ ββββββββββββββββββ β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β
βΌ βΌ
βββββββββββββββββββββββ ββββββββββββββββββββββββββββ
β DATA SOURCES β β DATA STORES β
β βββββββββββββββββ β β ββββββββββββββββββββββ β
β β JustWatch API β βββββββ β Supabase (Postgres)β β
β β (availability β β β β Titles, watchlists, β β
β β + metadata) β β β β users, alerts β β
β βββββββββββββββββ β β ββββββββββββββββββββββ β
β βββββββββββββββββ β β ββββββββββββββββββββββ β
β β TMDB API β β β β Upstash Redis β β
β β (metadata) β β β β Session cache, β β
β βββββββββββββββββ β β β recommendation β β
β βββββββββββββββββ β β β pre-compute cache β β
β β JustWatch β β β ββββββββββββββββββββββ β
β β Expired API β β ββββββββββββββββββββββββββββ β
β βββββββββββββββββ β
βββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββ
β AI RUNTIME β
β ββββββββββββββββββ β
β β Ollama (Mac Mini)β β
β β Mistral 7B β β
β β "Why you'll β β
β β love this" β β
β ββββββββββββββββββ β
Recommendations
POST /api/recommendGet recommendations. Body: {mood, time_min, group_size, subscribed_platforms[], exclude_titles[]?, watch_history[]?}. Returns top 5 ranked titles with "why" explanations. Rate limited: 10/min for free, unlimited for Pro.
GET /api/recommend/leaving-soonGet top 20 titles on user's platforms expiring in next 7 days.
Watchlist
GET /api/watchlistGet user's watchlist with platform availability and expiration warnings.
POST /api/watchlistAdd title to watchlist. Body: {title_id, platform_preference?}.
DELETE /api/watchlist/:titleIdRemove from watchlist.
PATCH /api/watchlist/:titleId/watchedMark as watched.
Search
GET /api/search?q=&platform=&genre=&page=Search titles with filters. Returns: title, year, platform(s), runtime, mood tags.
User Profile
GET /api/me/platformsGet/set subscribed platforms (for filtering recommendations).
PATCH /api/me/preferencesUpdate mood preferences, avoid genres, notification settings.
GET /api/me/reportGet monthly viewing analytics report (Pro).
Webhooks (Internal)
POST /webhooks/justwatchReceives JustWatch availability/expiration updates. Updates platform_availability table.
Step 1: Filter by Constraints
User's mood + time + group size + subscribed platforms β hard filter on titles table. Remove: titles not on their platforms, too long/short, wrong genre mood. Returns candidate set of ~20-50 titles.
Step 2: Rank by Relevance
Score remaining candidates by: watchlist affinity (similar to what user already added), viewing history patterns, critics score, recency, "leaving soon" bonus (if applicable). Ranks top 10.
Step 3: "Why You'll Love This" (Ollama)
For each of top 5 recommendations, Ollama Mistral 7B generates a personalized one-line "why" based on user's watch history and stated mood. Example: "Since you loved Breaking Bad's tension and Darryl's character arc, you'll appreciate this thriller's moral complexity." Cached in Redis for 24hrs.
Step 4: Binge Schedule (Pro)
For series recommendations, Ollama calculates: total runtime, episodes per day to finish in user's target timeframe, flags filler episodes to skip (from community data via Trakt).
Nightly: Content Sync (QStash)
2am nightly: sync with JustWatch API for availability changes. Update expiration dates. Flag newly expired content. This keeps watchlist availability signals fresh.
Weekly: "Leaving Soon" Digest (Resend)
Sunday 10am: for each user, find watchlist titles expiring in next 7 days. Send email/Telegram alert. Include "3 things we think you'd love that are leaving too."