Topic do, viral reel script lo. 60 seconds mein.
ScriptKaro is a high-speed, AI-powered reel & video scriptwriter built specifically for Indian creators publishing daily on Instagram Reels and YouTube Shorts.
Enter any topic, select your preferred language (Roman Hinglish, Hindi, or English), target duration (30s, 60s, or 90s), and tone (Hype, Funny, or Informative). ScriptKaro generates a complete viral video package with scroll-stopping 3-second hooks, scene-wise camera directions, teleprompter-ready lines, clean captions, and trending hashtags.
- π― 3 Scroll-Stopping Hooks (0β3s): High Curiosity/FOMO, Pain Point, and Mindblown hooks scientifically engineered to beat the scroll.
- π Grounded Key Facts: Optional facts box (features, pricing, links) so the AI never invents or hallucinates fake claims.
- β±οΈ Scene-Wise Timestamps & Camera Cues: Paced scene breakdowns with dialogue and exact editing/visual cues (B-roll, zooms, onscreen text popups).
- π£οΈ Natural Roman Hinglish & Creator Slang: Real conversational cadence ("Bhai yeh secret trick dekh ke dimaag hil jayega") rather than robotic translation.
- π Multi-Provider AI Fallback: Resilient cascading provider pipeline: Google Gemini Flash β Groq (Llama 3.3 70B) β OpenRouter Free Models.
- π 1-Click Copy & Confetti: Copy individual hooks, scenes, captions, hashtags, or the entire script package with one click.
- β‘ Upstash Redis & Distributed Cache: Global sub-100ms caching and rate limiting via Upstash Redis (with seamless in-memory fallback).
- π‘οΈ Rate-Limited & Protected: Built-in IP-based rate limiting (10 req/min) with polite retry notices.
- πΎ Local History: Last 10 scripts saved automatically in your browser's
localStorage(no account or database needed). - π± PWA & Mobile-First Design: Installable on iOS and Android devices, with touch targets sized at 44px+ and fluid responsive typography.
- π Dark Glassmorphism UI: High-contrast, premium aesthetic (
#0A0A0Dbackground with#FF7A1Avibrant orange accents).
| Layer | Technology |
|---|---|
| Framework | Next.js 15.5 (App Router, Server Actions, Dynamic Metadata) |
| Language | TypeScript 5 (Strict Mode) |
| Styling | Tailwind CSS 3.4 with Custom Glassmorphism |
| Motion | Framer Motion (Word-by-word hero reveals, spring cards, interactive micro-interactions) |
| Icons | Lucide React |
| AI Providers | Google Gemini (@google/genai), Groq API, OpenRouter API |
| Audio & Canvas | Canvas Confetti for joyful feedback |
git clone https://github.com/ManojDevHub1/ScriptKaro.git
cd ScriptKaronpm installCreate a .env.local file in the root directory:
# Google Gemini (Primary Provider - Free tier available)
# Get your free key at: https://aistudio.google.com/app/apikey
GEMINI_API_KEY=your_gemini_api_key_here
# Groq (Optional Fallback - Llama 3.3 70B Versatile)
# Get key at: https://console.groq.com/keys
GROQ_API_KEY=your_groq_api_key_here
# OpenRouter (Optional Tertiary Fallback - Free models)
# Get key at: https://openrouter.ai/keys
OPENROUTER_API_KEY=your_openrouter_api_key_herenpm run devOpen http://localhost:3000 in your browser.
ScriptKaro/
βββ app/
β βββ api/
β β βββ generate/
β β βββ route.ts # POST endpoint with Rate-Limiting, CORS & Fallback
β βββ globals.css # Tailwind layers, glassmorphism & safe-area styles
β βββ layout.tsx # SEO metadata, PWA viewport, font configuration
β βββ opengraph-image.tsx # Dynamic social sharing preview card
β βββ page.tsx # Main application page with Hero, Form & Results
β βββ robots.txt/route.ts # Search engine crawler permissions
β βββ sitemap.xml/route.ts # Auto-generated XML sitemap
βββ components/
β βββ ClapperLoader.tsx # Animated film reel loading state
β βββ ErrorBoundary.tsx # UI crash protection wrapper
β βββ HistoryList.tsx # Local storage saved scripts drawer
β βββ MagneticButton.tsx # Physics-based magnetic hover button
β βββ ResultCard.tsx # Copyable glass result containers
β βββ ScriptView.tsx # Scene breakdown with visual directions
β βββ SettingsModal.tsx # Custom user API key settings dialog
β βββ TopicForm.tsx # Topic input form with dynamic typing placeholder
βββ lib/
β βββ ai.ts # Multi-provider cascade (Gemini -> Groq -> OpenRouter)
β βββ cache.ts # In-memory TTL cache (10 min expiration)
β βββ prompt.ts # Master viral prompt with injection defense
β βββ rate-limit.ts # Per-IP rate limiting engine
β βββ types.ts # TypeScript interfaces and schema contracts
β βββ validator.ts # Strict request schema and character validation
βββ public/
β βββ logo.svg # Vector brand logo
β βββ manifest.json # Progressive Web App (PWA) manifest
βββ next.config.ts # Security headers (CSP, X-Frame-Options, HSTS)
βββ package.json
βββ tailwind.config.ts
- Safe Credential Handling: Server API keys are stored exclusively in
.env.localand.gitignoreensures they are never committed. - Client Key Isolation: Any custom API key entered by the user is stored solely in their browser's local storage and never logged on the server.
- Input Sanitization: Topics are strictly validated (3β200 characters), stripped of script tags, and prompt injection protected using isolated
<user_topic>XML enclosures. - Security Headers: Includes
Content-Security-Policy,X-Frame-Options: DENY,X-Content-Type-Options: nosniff, andReferrer-Policy: strict-origin-when-cross-origin. - Zero XSS: Scripts and hooks are outputted safely as standard React text nodes without using raw HTML injection.
- Push your repository to GitHub.
- Go to Vercel and click Add New Project.
- Import your
ScriptKarorepository. - In Environment Variables, add
GEMINI_API_KEY(and optional fallback keys). - Click Deploy.
This project is open-source and available under the MIT License.