A powerful web application that analyzes YouTube video comments using AI to determine sentiment and provide insights. The application uses OpenAI's GPT model to analyze comments and categorize them into different sentiment categories.
Try the application here: https://youtube-comment-analyzer-r8yw.onrender.com/
- 🎥 Fetch comments from YouTube videos
- 🤖 AI-powered sentiment analysis using GPT-4
- 📊 Categorizes comments into: positive, negative, neutral, or curious
- 💾 Caches results in MongoDB for future reference
- ⚡ Real-time analysis of comments
- 🎨 Modern React-based UI with Tailwind CSS
Before you begin, ensure you have the following installed:
- Node.js (v16 or higher)
- MongoDB
- npm or yarn
You'll also need:
- YouTube Data API key
- OpenAI API key
- MongoDB URI
- Clone the repository:
git clone https://github.com/prasath1196/youtube-comment-analyzer.git
cd youtube-comment-analyzer
- Install dependencies for both server and client:
# Install server dependencies
npm install
# Install client dependencies
cd client
npm install
cd ..
- Create a
.env
file in the root directory with the following variables:
YOUTUBE_API_KEY=your_youtube_api_key
OPENAI_API_KEY=your_openai_api_key
MONGO_URI=your_mongodb_uri
MONGO_DB=your_database_name
- Start the server:
npm start
- In a separate terminal, start the client:
cd client
npm start
The application will be available at http://localhost:3000
youtube-comment-analyzer/
├── client/ # Frontend React application
│ ├── src/ # React source files
│ ├── dist/ # Built files
│ └── package.json # Client dependencies
├── server.js # Express server setup
├── db.js # MongoDB connection and operations
├── openAIService.js # OpenAI integration
├── ytService.js # YouTube API integration
└── package.json # Server dependencies
GET /
: Serves the frontend applicationGET /api/analyze
: Analyzes comments for a given video
-
Backend:
- Node.js
- Express
- MongoDB (with Mongoose)
- OpenAI API
- YouTube Data API
-
Frontend:
- React
- Tailwind CSS
- Parcel (bundler)
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the ISC License - see the LICENSE file for details.
- OpenAI for providing the GPT API
- YouTube Data API for comment access
- MongoDB for database services
For support, please open an issue in the GitHub repository or contact the maintainers.