Emotube is a cutting-edge sentiment analysis platform that transforms social media engagement data into actionable insights. Currently featuring YouTube comment analysis, the platform is designed with extensibility in mind to support multiple social media platforms including Facebook, Reddit, Twitter, Instagram, and TikTok.
- 🎯 Real-time Sentiment Analysis - Advanced ML-powered sentiment classification
- 📊 Interactive Dashboards - Beautiful, responsive data visualizations
- 🐳 Dockerized Architecture - Full containerization for easy deployment
- ⚡ Async Processing - Background comment analysis with live progress updates
- 🔍 Advanced Filtering - Filter by sentiment, author, engagement metrics, and keywords
- 📈 Comprehensive Analytics - Detailed metrics and trend analysis
- 🌐 Multi-platform Ready - Extensible architecture for additional social media platforms
Comprehensive Video Information Display

Interactive Sentiment Analysis Charts

- 🎨 Modern Design - Clean, responsive interface built with Tailwind CSS and ShadCN/UI
- 📊 Interactive Charts - Real-time sentiment visualization with Recharts
- 🔍 Advanced Filtering - Multi-criteria comment filtering and sorting
- ⚡ Real-time Updates - Live progress tracking during analysis
- 📱 Responsive Layout - Optimized for desktop and mobile devices
- 🌙 Dark Mode Ready - Consistent theming across all components
The project follows a modern microservices architecture with complete Docker containerization:
Emotube/
├── 🐳 docker-compose.yml # Multi-service orchestration
├── 🔧 .env.example # Environment configuration template
├── 🌐 frontend/ # React TypeScript Frontend
│ ├── 🐳 Dockerfile # Frontend container config
│ ├── 📦 package.json # Dependencies (Bun runtime)
│ ├── ⚙️ vite.config.js # Build configuration
│ └── 📁 src/
│ ├── 🎨 components/ # React components
│ │ ├── ui/ # ShadCN UI components
│ │ ├── VideoDetails.tsx # Video metadata display
│ │ ├── CommentSection.tsx # Comment analysis interface
│ │ ├── CommentCharts.tsx # Data visualization charts
│ │ └── AnalyzedVideoList.tsx # Video history
│ ├── 🚦 routes/ # TanStack Router pages
│ ├── 🔗 services/ # API service layer
│ ├── 🎯 hooks/ # Custom React hooks
│ └── 📝 types/ # TypeScript definitions
├── ⚡ backend/ # FastAPI Python Backend
│ ├── 🐳 Dockerfile # Backend container config
│ ├── 📋 requirements.txt # Python dependencies
│ ├── 📚 overview.md # Detailed backend documentation
│ └── 📁 app/
│ ├── 🚀 main.py # FastAPI application entry
│ ├── 🌐 api/
│ │ ├── routes/ # API endpoints
│ │ │ ├── videos.py # Video analysis endpoints
│ │ │ ├── comments.py # Comment retrieval & filtering
│ │ │ └── chart_data.py # Analytics data endpoints
│ │ └── logic/ # Business logic layer
│ ├── ⚙️ core/
│ │ ├── config.py # Application configuration
│ │ ├── sentiment/ # Sentiment analysis engine
│ │ └── integrations/ # Social media platform integrations
│ │ └── youtube/ # YouTube API integration
│ ├── 🗄️ db/
│ │ ├── session.py # Database session management
│ │ └── init_db.py # Database initialization
│ ├── 📊 models/ # SQLModel database models
│ ├── 📝 schemas/ # Pydantic API schemas
│ ├── 🔧 crud/ # Database operations
│ └── 🛠️ utils/ # Utility functions
└── 🗄️ PostgreSQL Database # Persistent data storage
- 🐍 Python 3.11 with FastAPI - High-performance async API framework
- 🤖 Transformers & PyTorch - Advanced sentiment analysis models
- 🗄️ PostgreSQL + SQLModel - Robust database with async ORM
- 📡 Google API Client - YouTube Data API integration
- ⚡ Uvicorn - ASGI server with auto-reload
- ⚛️ React 19 with TypeScript - Modern UI framework
- 🦄 Bun - Ultra-fast JavaScript runtime and package manager
- 🧭 TanStack Router - Type-safe routing with devtools
- 🔄 TanStack Query - Powerful async state management
- 🎨 Tailwind CSS - Utility-first styling framework
- 🧩 ShadCN/UI - Beautiful, accessible component library
- 📊 Recharts - Responsive data visualization
- ⚡ Vite - Lightning-fast build tool
- 🐳 Docker & Docker Compose - Complete containerization
- 🔒 Environment-based Configuration - Secure secrets management
- 🌐 CORS-enabled API - Cross-origin resource sharing
- 📝 Auto-generated API Docs - Interactive Swagger/OpenAPI
- 🐳 Docker and Docker Compose
- 🔑 YouTube Data API v3 Key (Get one here)
git clone https://github.com/00200200/youtube-comment-sentiment-analyzer
cd emotube# Copy environment template
cp .env.example .env
# Edit .env file with your configuration
nano .env # or use your preferred editorRequired environment variables:
# YouTube API Configuration
YOUTUBE_API_KEY=your_youtube_api_key_here
# Service Configuration
HOST=0.0.0.0
BACKEND_PORT=8000
FRONTEND_PORT=3000
# Database Configuration
POSTGRES_USER=emotube_user
POSTGRES_PASSWORD=secure_password_here
POSTGRES_DB=emotube_db
POSTGRES_HOST=db
POSTGRES_PORT=5432
# Frontend Configuration
VITE_BACKEND_URL=http://localhost:8000# Start all services
docker-compose up -d
# View logs (optional)
docker-compose logs -f- 🌐 Frontend: http://localhost:3000
- ⚡ Backend API: http://localhost:8000
- 📚 API Docs: http://localhost:8000/docs
- 🗄️ Database:
localhost:5432
- 📱 Navigate to the frontend application
- 🔗 Enter a YouTube video URL
- ⚡ Watch real-time sentiment analysis progress
- 📊 Explore interactive charts and comment insights
- 🔍 Filter comments by sentiment, author, or keywords
- 📈 View comprehensive analytics and trends
GET /videos- List analyzed videos (paginated)GET /videos?url={youtube_url}- Analyze new video or get existing analysis
GET /comments?url={youtube_url}- Get comments with advanced filtering:sentiment- Filter by sentiment (positive/negative/neutral)author- Filter by author namemin_likes- Minimum like countphrase- Text search within commentssort_by- Sort field (published_at, like_count, sentiment)sort_order- asc/desc
GET /chart-data?url={youtube_url}- Get visualization data
Emotube is architected for easy expansion to additional social media platforms:
- 📺 YouTube - Complete comment sentiment analysis
The modular architecture supports adding:
- 📘 Facebook - Posts and comment analysis
- 🔴 Reddit - Subreddit and thread sentiment
- 🐦 Twitter/X - Tweet and reply analysis
- 📷 Instagram - Comment sentiment on posts and reels
- 🎵 TikTok - Video comment analysis
- 💼 LinkedIn - Professional content engagement
- 📱 Discord - Server message sentiment
-
Create Integration Module:
# backend/app/core/integrations/platform_name/ ├── client.py # Platform API client ├── models.py # Platform-specific data models └── sentiment.py # Platform-specific processing
-
Extend API Routes:
# Add new endpoints in backend/app/api/routes/ @router.get("/platform_name/analyze") async def analyze_platform_content(url: str): # Implementation
-
Update Frontend:
// Add platform-specific components and services // Extend URL parsing and validation
# Backend development
cd backend
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
uvicorn app.main:app --reload
# Frontend development
cd frontend
bun install
bun run start# Rebuild and restart services
docker-compose down
docker-compose up --build
# View service logs
docker-compose logs backend
docker-compose logs frontend
docker-compose logs db# Access PostgreSQL
docker-compose exec db psql -U emotube_user -d emotube_db
# Backup database
docker-compose exec db pg_dump -U emotube_user emotube_db > backup.sql
# View database logs
docker-compose logs db- 🤖 Multi-model Support - Hugging Face Transformers integration
- ⚡ Async Processing - Background analysis with progress tracking
- 🎯 Confidence Scoring - Sentiment confidence metrics
- 🔄 Batch Processing - Efficient comment processing in chunks
- 📈 Sentiment Distribution - Pie charts and bar graphs
- 📊 Timeline Analysis - Sentiment trends over time
- 🔥 Engagement Metrics - Like/dislike correlation analysis
- ☁️ Word Clouds - Popular terms and phrases
- ⚡ Lazy Loading - Progressive data loading
- 🔄 Real-time Updates - Live analysis progress
- 💾 Persistent Storage - PostgreSQL with proper indexing
- 🚀 Caching Strategy - Optimized data retrieval



