How I Built Viral Hunter: An AI Content Intelligence Platform
As short-form video dominates the internet, creators face a common problem: spending hours doom-scrolling to find content ideas that actually perform.
To solve this, I designed and built Viral Hunter — a web app that tracks Instagram Reels breakout velocity, calculates a quantitative Viral Score, and generates production-ready scripts using AI.
Here is a technical walkthrough of how the architecture was built for speed, resilience, and scale.
🏗️ Architecture Overview
- Frontend & SSR: Next.js 16 (App Router, Server Components, Streaming SSR)
- Design System: Tailwind CSS v4 with custom OLED dark-mode palette
- Database & Authentication: Supabase (PostgreSQL with Row Level Security)
- Resilient Data Pipeline: Apify Multi-Actor Fallback Chain
- AI Analysis: Google Gemini Flash with automatic provider fallback
- Payment Infrastructure: Razorpay Subscriptions (INR & USD support)
⚡ Key Engineering Challenges & Solutions
1. Resilient Instagram Data Ingestion
Instagram frequently rotates its DOM structure and rate-limits scrapers. A single scraping provider will inevitably fail.
We implemented a Resilient Fallback Chain:
- Primary actor: Fast dedicated reel extractor
- Secondary fallback: High-resilience proxy scraper
- Third fallback: Cached snapshot layer
This ensures our cron jobs (/api/cron/scrape) maintain 99.9% uptime without breaking the feed.
2. The Viral Score Algorithm
Instead of raw view counts, we calculate virality based on growth acceleration:
$$\text{Viral Score} = w_1 \cdot \text{Views} + w_2 \cdot \text{Engagement Rate} + w_3 \cdot \text{Save Ratio} + w_4 \cdot \text{Growth Velocity}$$
This highlights small creators whose reels are experiencing exponential organic growth.
3. Sub-Second Mobile Performance
Short-form creators live on mobile devices. To ensure instant navigation:
- Added route-level
loading.tsxskeletons to eliminate screen freezes - Configured
prefetch={true}on primary bottom navigation tabs - Added
touch-manipulationand tactile active states to eliminate the 300ms mobile touch delay
Feedback
Feel free to check it out, run a query in your niche, and let me know your thoughts in the comments!
Top comments (1)
Viral Hunter is live at viralhunter.in