A comprehensive social media sentiment analysis platform built with React, FastAPI, and machine learning.
- CSV Upload & Data Preview: Drag-and-drop CSV upload with automatic sentiment analysis
- ML Model Training: Logistic Regression and Naive Bayes models with evaluation metrics
- Interactive Dashboard: Real-time charts and sentiment distribution analytics
- AI-Powered Insights: Claude API integration for intelligent analysis
- Real-Time Social Search: Dynamic social media content generation with sentiment analysis
- Trending Topics Discovery: Real-time trending topics from multiple platforms
- Advanced Search: Multi-platform search with filtering options
- Topic Insights: Comprehensive analysis with AI-powered summaries
- React 18 with Vite
- TailwindCSS for styling
- Lucide React for icons
- Axios for API calls
- Chart.js for data visualization
- FastAPI for REST API
- Python 3.12 with async support
- NLTK for NLP preprocessing
- scikit-learn for ML models
- TextBlob for sentiment analysis
- Pandas for data processing
- GitHub for version control
- Render for hosting
- Docker for containerization
- Python 3.12+
- Node.js 18+
- Git
- GitHub account
- Render account
- Clone the repository
git clone https://github.com/murtuja55/SentimentSync.git
cd SentimentSync- Backend Setup
cd backend
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
python -m uvicorn main:app --reload --port 8000- Frontend Setup
cd frontend
npm install
npm run dev- Access the application
- Frontend: http://localhost:5173
- Backend API: http://localhost:8000
- API Docs: http://localhost:8000/docs
- Push to GitHub
git add .
git commit -m "Initial commit"
git branch -M main
git remote add origin https://github.com/murtuja55/SentimentSync.git
git push -u origin main- Repository Structure
SentimentSync/
βββ backend/
β βββ main.py
β βββ requirements.txt
β βββ .env.example
β βββ ...
βββ frontend/
β βββ src/
β βββ package.json
β βββ vite.config.js
β βββ ...
βββ README.md
βββ .gitignore
βββ render.yaml
βββ docker-compose.yml
-
Create Render Web Service
- Go to Render Dashboard
- Click "New" β "Web Service"
- Connect your GitHub repository
- Select "Python" as the runtime
- Build command:
pip install -r requirements.txt - Start command:
uvicorn main:app --host 0.0.0.0 --port $PORT
-
Environment Variables
PYTHON_VERSION=3.12 FASTAPI_ENV=production CLAUDE_API_KEY=your_claude_api_key
-
Create Static Site
- Click "New" β "Static Site"
- Connect your GitHub repository
- Build command:
cd frontend && npm run build - Publish directory:
frontend/dist
-
Environment Variables
NODE_VERSION=18 VITE_API_URL=https://your-backend-url.onrender.com
Create .env file in backend directory:
# Claude API
CLAUDE_API_KEY=your_claude_api_key_here
# Social Media APIs (Optional)
TWITTER_API_KEY=your_twitter_api_key
REDDIT_CLIENT_ID=your_reddit_client_id
REDDIT_CLIENT_SECRET=your_reddit_client_secret
# Production
FASTAPI_ENV=production
DEBUG=falseCreate .env file in frontend directory:
VITE_API_URL=http://localhost:8000 # For development
# VITE_API_URL=https://your-backend-url.onrender.com # For productionfastapi==0.104.1
uvicorn[standard]==0.24.0
python-multipart==0.0.6
pandas==2.1.3
numpy==1.25.2
scikit-learn==1.3.2
nltk==3.8.1
textblob==0.17.1
requests==2.31.0
python-jose[cryptography]==3.3.0
passlib[bcrypt]==1.7.4{
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.8.0",
"axios": "^1.6.0",
"tailwindcss": "^3.3.0",
"lucide-react": "^0.292.0",
"chart.js": "^4.4.0",
"react-chartjs-2": "^5.2.0"
}
}version: '3.8'
services:
backend:
build: ./backend
ports:
- "8000:8000"
environment:
- FASTAPI_ENV=production
frontend:
build: ./frontend
ports:
- "5173:80"
depends_on:
- backendPOST /api/auth/register- User registrationPOST /api/auth/login- User login
POST /api/upload- Upload CSV dataGET /api/data-status- Check data statusGET /api/export- Export analysis results
POST /api/train- Train sentiment modelPOST /api/predict- Make predictionsGET /api/models- Get available models
GET /api/social/trending- Get trending topicsPOST /api/social/search- Search social mediaPOST /api/social/insights- Get topic insights
- Upload Data: Upload CSV files with text data for sentiment analysis
- Train Models: Choose between Logistic Regression or Naive Bayes
- View Dashboard: Interactive charts showing sentiment distribution
- Social Search: Search trending topics and analyze social media sentiment
- AI Insights: Get intelligent analysis powered by Claude API
- JWT-based authentication
- CORS protection
- Input validation
- Environment variable management
- Secure API endpoints
- Async/await for non-blocking operations
- Efficient data processing with Pandas
- Optimized ML model training
- Responsive UI with React
- FastAPI for high-performance API
- Port conflicts: Change ports in startup scripts
- Environment variables: Ensure all required variables are set
- CORS issues: Check frontend API URL configuration
- Build failures: Verify all dependencies are installed
Enable debug mode by setting:
DEBUG=true
FASTAPI_ENV=development- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For support, please:
- Open an issue on GitHub
- Check the troubleshooting section
- Review the API documentation at
/docs
Check out the live demo: SentimentSync on Render
Built with β€οΈ using React, FastAPI, and Machine Learning
- Authentication: JWT-based secure login system
- Session History: Track and revisit past analysis sessions
- React 18 with Vite
- TailwindCSS for styling
- Recharts for data visualization
- Axios for API communication
- FastAPI with Python
- scikit-learn for ML models
- NLTK for NLP preprocessing
- TextBlob for sentiment analysis
- JWT authentication
- Anthropic Claude API integration
cd backend
pip install -r requirements.txt
uvicorn main:app --reload --port 8000cd frontend
npm install
npm run dev- Open your browser and navigate to
http://localhost:5173 - You'll see the Landing Page with "Bird Sound Recognition System" branding
- Click "Start Detection" to enter the main SentimentSync application
- Login with credentials:
admin / password123 - Upload your CSV data and start analyzing sentiment!
sentimentsync/
|-- frontend/
| |-- src/
| | |-- pages/ # React pages
| | |-- components/ # Reusable components
| | |-- App.jsx # Main app component
| | `-- main.jsx # Entry point
| |-- package.json
| `-- vite.config.js
|-- backend/
| |-- main.py # FastAPI application
| |-- nlp_pipeline.py # NLP preprocessing
| |-- models.py # ML models
| |-- auth.py # Authentication
| |-- insights.py # Claude API integration
| `-- requirements.txt
`-- README.md
POST /api/auth/login- User authenticationPOST /api/upload- CSV file upload and processingPOST /api/train- Model training endpointGET /api/insights- AI-powered insightsGET /api/history- Analysis session historyGET /api/export/{session_id}- Export analyzed data
- Username:
admin - Password:
password123
The app expects CSV files with at minimum a text column. Optional columns:
dateortimestamp- for time-based analysislikesorlike_count- engagement metricsretweets,replies,shares- engagement metricssentiment- pre-labeled sentiment (optional)