Gemini
AI summaries & articles
Sanity
Headless CMS + Studio
YouTube
Trending data engine
Algolia
Full-text search
The Challenge
The Solution
Features
Trending ingestion
Pulls the daily top-10 YouTube videos per category (views, likes, rank changes) from Supabase by region and date.
AI category summaries
Gemini writes prompt-engineered, one-paragraph blurbs per category, converted to Portable Text in Sanity.
AI article drafting
Generates full pop-culture articles from an editor prompt, scoped to an allow-listed set of HTML tags.
Algolia search
Full-text search across editorial posts via a manual reindex in Studio and an InstantSearch modal on the site.
Live trending widget
A YouTube Data API v3 widget backed by an Upstash Redis-cached route keeps the homepage fresh.
Embeds & comments
Rich X, Instagram, TikTok, and Reddit embeds plus Disqus comments on every post.
System Architecture
Source
YouTube API
Data
Supabase
AI
Gemini
CMS
Sanity
Search
Algolia
Frontend
Next.js
Technology Stack
Frontend
CMS & Content
AI & Search
Media & Analytics
Key Learnings
- •Generating editorial as Portable Text (not raw HTML) kept AI output clean, structured, and safe to render in Sanity.
- •Heavy prompt engineering, banned-phrase lists and a target reading level, was what made Gemini's copy feel human.
- •Caching the live YouTube widget in Upstash Redis avoided hammering the Data API while keeping the homepage current.
- •Indexing posts into Algolia made the growing archive searchable without a custom backend.
