Convert YouTube videos into multi-platform content in 30 seconds.
Refract AI takes any YouTube video and instantly generates:
- π SEO-optimized blog posts (1500-2000 words)
- π¦ Viral Twitter threads (8-12 engaging tweets)
- πΌ LinkedIn articles (800-1200 words with hashtags)
- πΌοΈ Custom thumbnails (1280x720 YouTube-optimized)
- Python 3.10+
- Node.js 18+
- Google Gemini API key (Get one free)
cd backend
# Create virtual environment
python -m venv .venv
# Activate (Windows)
.\.venv\Scripts\activate
# Activate (macOS/Linux)
source .venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Configure environment
cp .env.example .env
# Edit .env and add your GEMINI_API_KEY
# Start server
uvicorn main:app --reload --port 8000cd frontend
# Install dependencies
npm install
# Configure environment (optional)
cp .env.example .env
# Start development server
npm run devOpen http://localhost:5173 in your browser.
| Variable | Description | Required | Default |
|---|---|---|---|
GEMINI_API_KEY |
Google Gemini API key | β Yes | - |
ENVIRONMENT |
development or production |
No | development |
CORS_ORIGINS |
Allowed CORS origins (comma-separated) | No | http://localhost:5173 |
LOG_LEVEL |
Logging level | No | INFO |
| Variable | Description | Required | Default |
|---|---|---|---|
VITE_API_URL |
Backend API URL | No | http://localhost:8000 |
- Smart transcript extraction from any YouTube video
- Trend-aware content using real-time DuckDuckGo search
- Multiple output formats optimized for each platform
- AI-powered thumbnails with gradient backgrounds
- π¨ Beautiful dark mode UI with prism gradient accents
- β‘ Real-time progress tracking with stage indicators
- π One-click copy for all content types
- π₯ Download blog posts as Markdown files
- πΌοΈ Download thumbnails as PNG files
- π Secure API with rate limiting
- π± Fully responsive (mobile, tablet, desktop)
- βΏ WCAG 2.1 accessible
- π Performance optimized with React.lazy and memoization
- FastAPI - Modern Python web framework
- Google Gemini AI - Content generation (1.5 Pro model)
- youtube-transcript-api - Transcript extraction
- DuckDuckGo Search - Trend research
- Pillow - Thumbnail generation
- Pydantic - Data validation
- React 18 - UI library
- TypeScript - Type safety
- Vite - Build tool
- Tailwind CSS - Styling
- Framer Motion - Animations
- Zustand - State management
- React Router - Navigation
- React Markdown - Blog rendering
refract-ai/
βββ backend/
β βββ app/
β β βββ api/
β β β βββ routes.py # API endpoints
β β βββ core/
β β β βββ config.py # Settings
β β βββ models/
β β β βββ schemas.py # Pydantic models
β β βββ services/
β β βββ ai_service.py # Gemini integration
β β βββ youtube_service.py # Transcript extraction
β β βββ search_service.py # Trend research
β β βββ thumbnail_service.py # Image generation
β βββ main.py
β βββ requirements.txt
β βββ .env.example
βββ frontend/
β βββ src/
β β βββ components/ # Reusable UI components
β β βββ pages/ # Route pages
β β βββ services/ # API client
β β βββ store/ # Zustand state
β β βββ hooks/ # Custom hooks
β β βββ types/ # TypeScript types
β βββ package.json
β βββ .env.example
βββ README.md
Generate multi-platform content from a YouTube video.
Request:
{
"youtube_url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
}Response:
{
"video_info": {
"video_id": "dQw4w9WgXcQ",
"title": "Video Title",
"channel_name": "Channel Name",
"transcript": "...",
"thumbnail_url": "..."
},
"blog_post": "# Blog Title\n\n...",
"twitter_thread": ["Tweet 1...", "Tweet 2...", ...],
"linkedin_article": "Professional intro...\n\n#hashtags",
"thumbnail_url": "data:image/png;base64,...",
"generation_time": 12.5,
"trends_used": ["trend1", "trend2"],
"created_at": "2024-01-15T10:30:00Z"
}Health check endpoint.
Test Gemini API connectivity.
- Start both backend and frontend servers
- Navigate to http://localhost:5173
- Paste a YouTube URL (e.g.,
https://www.youtube.com/watch?v=dQw4w9WgXcQ) - Click "Refract" and wait for processing
- Switch between tabs to view Blog, Twitter, LinkedIn, and Thumbnail
- Test copy buttons and download functionality
- Try an invalid URL β Should show validation error
- Try a video without subtitles β Should show API error
- Try while offline β Should show network error
MIT License - see LICENSE for details.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Google Gemini for AI capabilities
- Lucide for beautiful icons
- Built with β€οΈ for the hackathon
Transform one video into a content empire π