A full-stack application for scraping product reviews, performing sentiment analysis using NLP and ML models, and visualizing the results in an interactive dashboard.
- Product Scraping: Extract product information from multiple categories
- Review Extraction: Scrape customer reviews using advanced techniques
- Sentiment Analysis: Analyze review sentiment with enhanced accuracy using multiple models
- Web Interface: User-friendly React-based web application
- Batch Processing: Process multiple categories automatically
- Comprehensive Reports: Detailed sentiment analysis reports with visualizations
- User Authentication: Secure login and registration system
- Real-time Processing: Live progress tracking during analysis
| Name | Hex | Usage |
|---|---|---|
| Primary Red | #e40046 |
Primary buttons, accents |
| Soft Red | #ef4444 |
Secondary elements |
| Black | #000000 |
Text, borders |
| Light Black (10%) | #0000001a |
Subtle backgrounds |
| Navy Black | #06081fe0 |
Dark backgrounds |
| Dark Gray | #333333 |
Secondary text |
| Medium Gray | #5a5a59 |
Disabled elements |
| White | #ffffff |
Backgrounds, text on dark |
| Rating Yellow | #ffc315 |
Star ratings, highlights |
| Positive Green | #6ee7b7 |
Positive sentiment |
| Negative Red | #fca5a5 |
Negative sentiment |
| Neutral Gray | #d1d5db |
Neutral sentiment |
sentiment-analysis-app/
├── backend/ # Flask API with scraping & analysis
└── frontend/ # React Vite application
- Python 3.8+
- Node.js 16+
- npm or yarn
- Chrome/Firefox browser (for web scraping)
cd backendWindows:
python -m venv venv
venv\Scripts\activatemacOS/Linux:
python3 -m venv venv
source venv/bin/activateAlternative (Snapdeal environment):
.\env_snapdeal\Scripts\Activate.ps1
where python
python --versionpip install -r requirements.txtAdditional ML/NLP libraries (if needed):
pip install transformers datasets torch scikit-learn pandaspython -c "import nltk; nltk.download('punkt'); nltk.download('vader_lexicon'); nltk.download('brown')"Create a .env file in the backend directory:
SUPABASE_URL=your_supabase_url_here
SUPABASE_KEY=your_supabase_key_here
FLASK_ENV=development
FLASK_DEBUG=1python app.pyThe backend API will be available at http://localhost:5000
cd frontendnpm installCreate a .env file in the frontend directory:
VITE_API_BASE_URL=http://localhost:5000
VITE_SUPABASE_URL=your_supabase_url_here
VITE_SUPABASE_ANON_KEY=your_supabase_key_herenpm run devThe frontend will be available at http://localhost:5173
- Python - Core programming language
- Flask - Web framework
- Selenium, BeautifulSoup4 - Web scraping
- Pandas, NLTK, TextBlob, Transformers, Scikit-learn - NLP & ML processing
- Matplotlib - Data visualization
- Supabase - Authentication and database
- React + Vite - UI framework and build tool
- Tailwind CSS + shadcn/ui - Styling and components
- Recharts - Data visualization
- Axios - API communication
- React Router - Navigation
The application uses Supabase for authentication and data storage.
- Create a Supabase account at supabase.com
- Create a new project
- Get your project URL and API key from Settings > API
- Update the environment variables in both backend and frontend
- Run the SQL schema from
supabase_schema.sqlin the Supabase SQL editor
Update settings in backend/config.py:
- Scraping timeouts and retries
- Sentiment analysis model preferences
- File storage paths
- API rate limiting
Update API endpoints in frontend/src/services/api.js if different from default:
const API_BASE_URL = 'http://localhost:5000';Terminal 1 - Backend:
cd backend
venv\Scripts\activate # Windows
# or
source venv/bin/activate # macOS/Linux
# or (Snapdeal environment)
.\env_snapdeal\Scripts\Activate.ps1 # Windows PowerShell
python app.pyTerminal 2 - Frontend:
cd frontend
npm run devOpen your browser and navigate to http://localhost:5173
Register a new account through the authentication page
- Navigate to the product search page
- Select a category (e.g., "Electronics - Laptops")
- Click "Scrape Products" to gather product data
- Select products from the results
- Click "Analyze Sentiment" to process reviews
- Monitor progress in the processing queue
- View results in the visualization dashboard
Web scraping failures
- Ensure you have the latest Chrome/Firefox browser
- Check your internet connection
- Some sites may have anti-scraping measures
Module not found errors
- Ensure virtual environment is activated
- Run
pip install -r requirements.txtagain
Authentication issues
- Verify Supabase URL and key in environment variables
- Check that the Supabase project is properly configured
CORS errors
- Ensure backend is running on port 5000
- Check Flask-CORS is properly installed
Frontend build issues
- Clear node_modules:
rm -rf node_modules && npm install - Clear Vite cache:
npm run dev -- --force
- Check the browser console for error messages
- Check the Flask server logs for backend errors
- Verify all environment variables are set correctly
- Ensure all prerequisite software is installed
- Multi-category product scraping
- Real-time scraping progress
- Product filtering and search
- Batch selection for analysis
- Queue-based processing system
- Real-time progress tracking
- Multi-model sentiment analysis
- Confidence scoring
- Interactive dashboard with charts
- Sentiment distribution visualization
- Trend analysis over time
- Key insights and recommendations
- Export functionality (CSV, JSON, PDF)
- Secure authentication via Supabase
- Profile management
- Analysis history
- Saved reports
The application supports multiple export formats:
- CSV: Spreadsheet-compatible data
- JSON: Structured data for programmatic use
- PDF: Formatted reports (exported as .txt)
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
- Built with Flask and React
- Uses Hugging Face Transformers for NLP
- Powered by Supabase for authentication
- UI components from shadcn/ui