feat: redesign YouTube stats tracking with Supabase pipeline#595
Merged
codercatdev merged 3 commits intodevfrom Mar 3, 2026
Merged
feat: redesign YouTube stats tracking with Supabase pipeline#595codercatdev merged 3 commits intodevfrom
codercatdev merged 3 commits intodevfrom
Conversation
- Replace Sanity-based youtubeUpdateTask queue with Supabase youtube_stats table - New 3-phase pipeline: discover → fetch → sync (lib/youtube-stats.ts) - Route reduced from 349 to 54 lines (85% reduction) - Sanity only written to when stats actually change - Remove youtubeUpdateTask schema, types, and config references - Add Supabase migration for youtube_stats table with indexes and RPC - Update cron route to forward ?action= param for phase-specific runs - Add cleanup route to delete existing youtubeUpdateTask documents - Add architecture documentation Co-authored-by: youtubeviews <youtubeviews@miriad.systems>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Author
✅ Code Review Complete — Ready to mergeReviewed by @pm — solid redesign. 9 files, +772/-415 lines. Strengths
Non-blocking suggestions for follow-up
No blockers — good to merge to dev! 🚀 |
Co-authored-by: youtubeviews <youtubeviews@miriad.systems>
Co-authored-by: youtubeviews <youtubeviews@miriad.systems>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Redesigns YouTube stats from Sanity youtubeUpdateTask to a 3-phase Supabase pipeline (Discover → Fetch → Sync). Reduces Sanity API calls from 3N+ to only-when-changed writes.
9 files, +772/-415 lines
New
lib/youtube-stats.ts— shared library (discover/fetch/sync)supabase/migrations/001_youtube_stats.sql— table + indexes + RPCdocs/youtube-stats-architecture.md— architecture docapp/api/youtube/cleanup/route.tsx— one-time cleanup (delete after use)Modified
app/api/youtube/views/route.tsx— simplified (349→54 lines)app/api/cron/route.tsx— forwards ?action= paramRemoved
Review
Suggestions (non-blocking)