Skip to content

About

🎬 AI reel script generator for Indian creators. Enter a topic and get a viral Hinglish script, hooks, caption & hashtags in seconds. Built with Next.js + Gemini.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

Β 

History

6 Commits

Folders and files

Repository files navigation

ScriptKaro 🎬πŸ”₯

Topic do, viral reel script lo. 60 seconds mein.

Next.js 15 React 19 Tailwind CSS TypeScript Google Gemini License: MIT

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.


✨ Features

  • 🎯 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 (#0A0A0D background with #FF7A1A vibrant orange accents).

πŸ› οΈ Tech Stack

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

⚑ Quick Start

1. Clone the Repository

git clone https://github.com/ManojDevHub1/ScriptKaro.git
cd ScriptKaro

2. Install Dependencies

npm install

3. Configure API Keys

Create 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_here

4. Run the Development Server

npm run dev

Open http://localhost:3000 in your browser.


πŸ“‚ Project Structure

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

πŸ”’ Security & Privacy

  • Safe Credential Handling: Server API keys are stored exclusively in .env.local and .gitignore ensures 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, and Referrer-Policy: strict-origin-when-cross-origin.
  • Zero XSS: Scripts and hooks are outputted safely as standard React text nodes without using raw HTML injection.

πŸš€ Deployment to Vercel

  1. Push your repository to GitHub.
  2. Go to Vercel and click Add New Project.
  3. Import your ScriptKaro repository.
  4. In Environment Variables, add GEMINI_API_KEY (and optional fallback keys).
  5. Click Deploy.

πŸ“„ License

This project is open-source and available under the MIT License.

About

🎬 AI reel script generator for Indian creators. Enter a topic and get a viral Hinglish script, hooks, caption & hashtags in seconds. Built with Next.js + Gemini.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages