Youtube Script Generator banner

Youtube Script Generator

16 devlogs
91h 38m 30s

ScriptForge AI is a full-stack, AI-powered YouTube scriptwriting and research platform built with Next.js 16, TypeScript, Supabase, Google Gemini 2.5 Flash, and the YouTube Data API v3. It's designed for YouTube content creators who want to genera…

ScriptForge AI is a full-stack, AI-powered YouTube scriptwriting and research platform built with Next.js 16, TypeScript, Supabase, Google Gemini 2.5 Flash, and the YouTube Data API v3. It’s designed for YouTube content creators who want to generate high-retention, structured scripts backed by real competitor research data.

This project uses AI

I used AI during the initial stages to build the component, then continued development independently in the later phases.

Demo Repository

Loading README...

iidrisabdul775

Removed the 9-second abort timeout and replaced it with retry logic
Migrated from @google/genai to the OpenRouter SDK for consistency across all routes
Added proper AbortController management (cancel previous in-flight requests, not timeout-abort), auto-retry for transient failures, and graceful handling of intentional aborts
Added content-type validation and user-friendly error messages instead of raw technical errors

Attachment
0
iidrisabdul775

fix: migrate to Hack Club OpenRouter API and handle serverless timeouts

Swap @google/genai for @openrouter/sdk to bypass rate limits
Add 503 fallback response to prevent Netlify 10s timeout crashes
Add content-type validation on frontend to prevent HTML JSON parsing errors

Attachment
0
iidrisabdul775

Shipped this project!

Hours: 84.86
Cookies: 🍪 1991
Multiplier: 23.47 cookies/hr

I built an AI-powered YouTube Script Generator! It researches video niches, calculates average stats, and uses AI to write highly optimized video scripts with hooks and intros. The hardest part was definitely wiring up the Next.js API routes to handle the Gemini AI data and getting the Supabase Google OAuth to work perfectly in production. Really proud of how clean the dashboard UI turned out and that it actually generates useful content! :)

iidrisabdul775

feat: implement Auth, Script History, and finalize project polish

Implement Google OAuth PKCE flow with callback handling
Build auth-gated dashboard layout and connect usage meter to user profile
Build functional My Scripts tab fetching from Supabase with optimistic updates
Remove boilerplate AI comments, debug logs, and finalize code cleanup
Fix TypeScript strict-mode errors and standardize error boundaries
Run full end-to-end testing and build verification”

Attachment
0
iidrisabdul775

feat: add legacy dashboard sub-pages (generator, history, research)

  • Create standalone generator page with simple form and save-to-Supabase
  • Create script history page with list/detail split view and delete
  • Create research page with video card grid and "Use as Inspiration"
  • Style all sub-pages with individual CSS modules
  • Add dashboard-home and dashboard-layout CSS modules
Attachment
0
iidrisabdul775

feat: build YouTube Research tab with analytics dashboard

  • Create research search form with niche selector
  • Display analytics stat cards (avg views, likes, engagement, duration)
  • Show trending keywords as color-coded chips
  • Render top performing videos with thumbnails, stats, engagement rate
  • Display channel list with subscriber counts
  • Show common hook patterns from video descriptions
  • Add "Use This Research" button to link data to script generation
  • Add number and duration formatting helpers
Attachment
0
iidrisabdul775

feat: build Generate Script tab with form inputs and script output panel

  • Create script settings form (topic, tone grid, length selector)
  • Add tone selector with emoji 2x4 grid
  • Implement script generation with loading spinner and progress dots
  • Build script output renderer (hook, intro, sections, CTA, outro)
  • Add copy to clipboard, download as TXT, download as JSON actions
  • Display metadata (word count, duration, generation time, model)
  • Add linked research indicator
  • Implement toast notification system
Attachment
0
iidrisabdul775

feat: build dashboard layout with collapsible sidebar and tab navigation

  • Create dashboard layout with sidebar (260px → 72px collapse)
  • Add sticky top bar with current tab title
  • Implement tab navigation (Generate | Research | My Scripts)
  • Add usage meter with progress bar in sidebar footer
  • Create responsive sidebar with mobile overlay
  • Wire up layout state (collapse, mobile menu, active tab)
  • Style with CSS Modules: glassmorphism sidebar, smooth transitions
Attachment
0
iidrisabdul775

feat: create API routes for script generation, research, and refinement

  • POST /api/generate-script: full script generation with Supabase persistence
  • POST /api/youtube-research: full pipeline with analytics and DB caching
  • POST /api/refine-script: section-level refinement with DB sync
  • POST /api/generate-hooks: hook A/B testing generation
  • GET endpoints for health checks with usage documentation
  • Add input validation, rate-limit handling, error responses
  • Legacy /api/generate and /api/research for backward compatibility
Attachment
0
iidrisabdul775
  • Implement searchVideos() with filters (order, date, region, duration)
  • Implement searchTrendingVideos() with parallel relevance + viewCount search
  • Implement getVideoDetails() with batched requests (50 per batch)
  • Implement getChannelDetails() with deduplication
  • Build analyzeVideos() comprehensive analytics engine
  • Chain everything in runResearchPipeline()
  • Add ISO 8601 duration parser and formatter”
Attachment
0
iidrisabdul775

feat: build Gemini AI scriptwriting engine with expert system prompt

  • Integrate @google/genai SDK with gemini-2.5-flash model
  • Write expert system prompt for YouTube script generation
  • Implement generateScript() with structured JSON output
  • Implement refineSection() for targeted section editing
  • Implement generateHooks() for A/B hook testing
  • Add robust JSON extraction from markdown code fences
  • Add rate-limit detection and error handling
  • Support research data injection into generation prompts
Attachment
0
iidrisabdul775

feat: build typed database helper library with CRUD for all tables

  • Add getProfile, updateProfile functions
  • Add full CRUD for projects (get, create, update, delete)
  • Add full CRUD for scripts with project-level filtering
  • Add research save, fetch, and link-to-script functions
  • Add template fetching with premium filter and usage tracking
  • Add getDashboardStats for aggregated statistics
  • Add searchScripts (partial text match) and getScriptsByStatus
Attachment
0
iidrisabdul775

feat: design and implement Supabase database schema

  • Create 5 tables: profiles, projects, scripts, youtube_research, script_templates
  • Add script_status enum (draft/generating/completed/failed)
  • Implement RLS policies for all user-owned tables
  • Add trigger: auto-create profile row on auth.users insert
  • Add trigger: auto-increment scripts_generated_count on script completion
  • Add trigger: auto-update timestamps on row modification
  • Seed 5 script templates (Tutorial, Review, Listicle, Story, Explainer)
  • Set up browser and server Supabase clients
Attachment
0
iidrisabdul775
  • Add animated feature cards grid with hover effects
  • Build pricing section with three tiers (Free/Pro/Enterprise)
  • Create testimonials section with avatar placeholders
  • Add gradient CTA banner and footer
  • Finish all responsive styles and micro-animations
Attachment
Attachment
0
iidrisabdul775

feat: build landing page hero with typewriter animation and counters

  • Create animated hero section with gradient text and glowing CTA buttons
  • Implement custom useTypewriter hook cycling through YouTube niches
  • Add useCountUp hook with IntersectionObserver for animated statistics
  • Style hero with glassmorphism cards and floating background orbs
  • Set up page.module.css with responsive breakpoints
Attachment
0
iidrisabdul775

feat: initialize project with Next.js 16, TypeScript, and design system

  • Scaffold Next.js 16 app with TypeScript strict mode
  • Set up global CSS design tokens (colors, radii, shadows, transitions)
  • Add Inter font from Google Fonts via next/font
  • Create root layout with SEO metadata
  • Add global keyframe animations and scrollbar styling
  • Create placeholder component files for Header and ScriptForm
Attachment
0
iidrisabdul775

I’m working on my first project! This is so exciting. I can’t wait to share more updates as I build.

Attachment
Attachment
0