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



