A full-stack sentiment analysis application that analyzes the emotional tone and sentiment of text content from multiple sources. Built with React, Express, and Google Cloud APIs for production-ready performance.
Status: In active development β local setup instructions below | GitHub: StreetCoder02/Sentiment-Analysis-App
-
π Multi-Input Support - Analyze sentiment from:
- Direct text input
- File uploads (PDF, TXT, DOCX, Images with OCR)
- URL/web page content
- Batch processing (up to 50 texts)
-
π Multi-Language Support
- Automatic language detection
- Auto-translation to English for analysis
- Supports 15+ languages
-
π€ AI-Powered Insights
- Google Cloud Natural Language API for sentiment analysis
- Google Gemini AI for intelligent summary generation
- Confidence scores and detailed breakdowns
-
π Batch Analysis
- Process multiple texts simultaneously
- Export results as CSV for further analysis
- Real-time progress tracking
-
π€ Authentication
- Firebase authentication
- User analytics and history tracking
- Demo mode for testing without login
-
π± Responsive UI
- Beautiful, modern interface with Framer Motion animations
- TailwindCSS styling
- Radix UI components
- Mobile-friendly design
- React 18 - UI framework
- React Router 6 - SPA routing
- TypeScript - Type safety
- Vite - Fast build tool
- TailwindCSS 3 - Styling
- Framer Motion - Animations
- Radix UI - Component library
- Lucide React - Icons
- Express.js - REST API server
- Node.js - Runtime
- Google Cloud Natural Language API - Sentiment analysis
- Google Gemini AI - AI summaries
- Multer - File uploads
- Tesseract OCR - Image text extraction
- Firebase - Auth, Firestore, Storage
- Google Cloud - NLP services
- Netlify Functions - Serverless deployment
- Node.js v18 or higher
- npm or pnpm
- Firebase account (for backend services)
- Google Cloud API keys (optional, for full features)
git clone https://github.com/StreetCoder02/Sentiment-Analysis-App.git
cd Sentiment-Analysis-Appnpm install
# or
pnpm install# Copy the example environment file
cp .env.example .env
# Edit .env and add your API keys:
# - VITE_FIREBASE_API_KEY
# - VITE_FIREBASE_PROJECT_ID
# - GOOGLE_CLOUD_API_KEY (optional)
# - GEMINI_API_KEY (optional)npm run devThe app will be available at:
- Frontend: http://localhost:5173
- API: http://localhost:8080
Sentiment-Analysis-App/
βββ client/ # React frontend
β βββ pages/ # Route pages (Index, BatchAnalysis, Login)
β βββ components/ # React components
β β βββ ui/ # Radix UI components
β βββ hooks/ # Custom React hooks
β βββ lib/ # Utilities (Firebase, Auth)
β βββ global.css # TailwindCSS styles
βββ server/ # Express API backend
β βββ routes/ # API endpoints
β βββ utils/ # Sentiment analysis utilities
βββ shared/ # Shared TypeScript interfaces
βββ netlify/functions/ # Serverless functions
βββ public/ # Static assets
βββ package.json # Dependencies
POST /api/sentiment/analyze- Analyze single textPOST /api/sentiment/batch- Analyze multiple textsPOST /api/sentiment/file- Analyze uploaded filePOST /api/sentiment/url- Analyze URL contentPOST /api/sentiment/translate- Translate text
GET /api/demo- Test endpointGET /api/ping- Health check
Enter any text and get:
- Sentiment classification (Positive/Negative/Neutral)
- Confidence scores
- Detailed breakdown of sentiment components
- AI-generated insights
Supports:
- PDF - Text extraction
- TXT - Plain text
- DOCX - Word documents
- Images - OCR text extraction
- Fetch and analyze web page content
- Automatic language detection
- Full sentiment analysis pipeline
- Upload CSV or text file with multiple texts
- Process up to 50 texts at once
- Export results as CSV with all details
- Real-time progress tracking
Create a .env file in the root directory (use .env.example as template):
# Firebase Configuration
VITE_FIREBASE_API_KEY=your_key_here
VITE_FIREBASE_AUTH_DOMAIN=your_domain_here
VITE_FIREBASE_PROJECT_ID=your_project_id_here
VITE_FIREBASE_STORAGE_BUCKET=your_bucket_here
VITE_FIREBASE_MESSAGING_SENDER_ID=your_id_here
VITE_FIREBASE_APP_ID=your_app_id_here
VITE_FIREBASE_MEASUREMENT_ID=your_measurement_id_here
# Google Cloud APIs
GOOGLE_CLOUD_API_KEY=your_api_key_here
# Gemini AI (Optional)
GEMINI_API_KEY=your_gemini_key_here
# Server Config
NODE_ENV=development
PORT=3001How to get API keys:
# Development
npm run dev # Start dev server (client + API)
npm run dev:api # Start API only
npm run dev:full # Start with API and client separately
# Production
npm run build # Build for production
npm run build:client # Build frontend only
npm run build:server # Build backend only
npm start # Start production server
# Testing & Quality
npm run test # Run tests with Vitest
npm run typecheck # TypeScript validation
npm run format.fix # Auto-format code
# Firebase
npm run emulators # Start Firebase emulators
npm run setup-firebase # Setup Firebase project
# Utilities
npm run status # Check project status
npm run test-api # Test API endpoints# Build
npm run build
# Deploy
# Use Netlify CLI or connect GitHub for auto-deploy# Deploy directly via Vercel dashboard
# Connect your GitHub repositorydocker build -t sentiment-app .
docker run -p 8080:8080 sentiment-app- β Environment variables for sensitive data
- β No API keys in source code
- β Firebase security rules for data access
- β CORS protection
- β Input validation and sanitization
Important: Never commit .env files to version control. Use .env.example as a template.
Contributions are welcome! Here's how:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit changes (
git commit -m 'Add AmazingFeature') - Push to branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- π§ Email: apsinghjp0516@gmail.com
- π Issues: GitHub Issues
- π¬ Discussions: GitHub Discussions
This project demonstrates:
- Full-stack development with React and Express
- Integration with Google Cloud APIs
- Firebase authentication and database
- TypeScript best practices
- Responsive UI design with TailwindCSS
- Vite build optimization
- Sentiment analysis implementation
Perfect for:
- Portfolio projects
- Learning full-stack development
- Understanding NLP integration
- Building production-ready apps
- Google Cloud Natural Language API
- Google Gemini AI
- Firebase
- React and Vite communities
- Radix UI and TailwindCSS
Made with β€οΈ by Aniruddha
β If you find this project useful, please give it a star!