Decode the style DNA of top creators. Turn "feeling" into "formula".
Media Analysis Lab is a tool that analyzes YouTube channels to extract actionable insights about their positioning, visual style, and engagement strategies. It uses Google Gemini AI to generate "Style DNA" reports.
- Channel Analysis: Fetches channel stats, recent videos, and top comments via YouTube Data API.
- Positioning Diagnosis: Evaluates how well a user's self-positioning matches a target channel's persona.
- Style DNA Decoding: Extracts visual keywords, title formulas, and engagement hooks.
- Mock Mode: Built-in demo mode to experience the features without using real API quotas.
- Backend: FastAPI (Python), Google Gemini API (
google-generativeai), YouTube Data API v3. - Frontend: Next.js 14, React, Tailwind CSS, Lucide Icons.
- Python 3.9+
- Node.js 18+
- Google Cloud Project with:
- YouTube Data API v3 enabled.
- Generative Language API (Gemini) enabled.
git clone <repository-url>
cd Media_Analysis_Labcd backend
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtCreate a .env file in backend/ (see .env.example if available, or use the format below):
# backend/.env
PROJECT_NAME="Media Analysis Lab"
BACKEND_CORS_ORIGINS=["http://localhost:3000"]
GEMINI_API_KEY=your_gemini_key_here
YOUTUBE_API_KEY=your_youtube_key_here
ENABLE_MOCK_AI=falsecd ../frontend
npm installWe provide a convenient start script to launch both servers:
# In the root directory
./start.sh- Frontend: http://localhost:3000
- Backend: http://localhost:8000
- Open http://localhost:3000.
- Enter a YouTube Handle (e.g.,
@LiZiqi). - (Optional) Enter your own positioning to see a match score.
- Enter your API Keys (or configure them in
.env). - Click Analyze.
If you strictly want to test the UI or don't have active API quotas, you can enable Mock Mode:
- Method 1: Set
ENABLE_MOCK_AI=trueinbackend/.envand restart the server. - Method 2: If the API returns a
429 Quota Exceedederror multiple times, the system will automatically fallback to Mock Mode for that request.
- 404 Channel Not Found: Ensure you are using the precise Handle (e.g.,
@Handle). - 429 Quota Exceeded: The system will retry automatically. If it persists, try Mock Mode or check your Google Cloud billing status.