π FinSentiment Pro - AI-Powered Stock Market Sentiment Analysis# FinSentiment Pro - AI-Powered Financial Sentiment Analysis
- Multi-Model AI: FinBERT sentiment analysis + emotion detection
- Voice Input: Speak stock tickers using Web Speech API
- Real-Time Data: Live news from News API and stock prices from Yahoo Finance
- Interactive Dashboards:
Real-time AI-powered sentiment analysis platform for Indian stocks using FinBERT NLP and advanced visualization - Overall Sentiment Gauge
- Timeline Charts (Sentiment + Price correlation)
π Live Demo | π Documentation | π Report Bug | β¨ Request Feature - Multi-dimensional Radar Charts
- Source Comparison
- Correlation Scatter Plots
--- - AI-Generated Insights
- Dark/Light Theme: Smooth theme transitions with localStorage persistence
-
Accessibility: WCAG 2.1 AA compliant
-
Overview- Performance Optimized: Lazy loading, code splitting, memoization
-
Tech Stack## π Prerequisites
-
Configuration- Node.js (v18 or higher)
-
Usage- Python (v3.8 or higher)
-
API Endpoints- pip (Python package manager)
-
Contributing## π οΈ Installation
## π Overviewnpm install
Real-time sentiment tracking β’ FinBERT NLP β’ Beautiful visualizations β’ Production-ready
π Quick Deploy β’ π Full Guide β’ π Report Bug β’ β¨ Request Feature
FinSentiment Pro is an enterprise-grade sentiment analysis platform that combines cutting-edge AI with real-time market data to deliver actionable insights for Indian stocks (NSE). Built with modern web technologies and powered by FinBERT NLP, it transforms raw financial news into clear sentiment signals.
- π― Accurate: FinBERT model fine-tuned specifically for financial sentiment
- β‘ Fast: Real-time trending stocks with sub-second analysis
- π¨ Beautiful: Modern glassmorphism UI with dark mode support
- π‘οΈ Resilient: Smart API rotation and automatic fallback mechanisms
- π± Responsive: Perfect experience across desktop, tablet, and mobile
- π§ Production-Ready: Comprehensive error handling and caching
|
|
|
|
graph TB
subgraph Frontend["π¨ Frontend (React + Vite)"]
UI[User Interface]
Store[Zustand State]
Charts[Recharts Visualizations]
end
subgraph Backend["βοΈ Backend (Flask API)"]
API[REST Endpoints]
NLP[FinBERT Engine]
Cache[In-Memory Cache]
Rotation[API Key Rotation]
end
subgraph External["π External Services"]
IndianAPI[Indian Stock API]
YFinance[Yahoo Finance]
NewsAPI[News API]
end
UI -->|HTTP Requests| API
API --> NLP
API --> Cache
API --> Rotation
Rotation -->|Primary| IndianAPI
Rotation -->|Fallback| YFinance
API -->|News Data| NewsAPI
style Frontend fill:#61DAFB,stroke:#333,stroke-width:2px,color:#000
style Backend fill:#6366F1,stroke:#333,stroke-width:2px,color:#fff
style External fill:#10b981,stroke:#333,stroke-width:2px,color:#fff
- Primary: Indian Stock API (3-key rotation pool)
- Fallback 1: Yahoo Finance (yfinance) for live prices
- Fallback 2: Curated sample data (always available)
- Caching: 5-minute cache for analyzed stocks
- Error Handling: Graceful degradation at every layer
| Category | Technologies |
|---|---|
| Frontend |
|
| Backend |
|
| DevOps |
|
FinSentiment-Pro/
β
βββ π¨ Frontend
β βββ src/
β β βββ components/
β β β βββ Header.tsx # Navigation with scroll effects
β β β βββ Hero.tsx # Landing section with quick search
β β β βββ Dashboard.tsx # Main analysis dashboard
β β β βββ TrendingStocks.tsx # Real-time trending with filters
β β β βββ Features.tsx # Feature showcase cards
β β β βββ About.tsx, Contact.tsx, Footer.tsx
β β β βββ dashboard/
β β β βββ SearchSection.tsx # Smart ticker search
β β β βββ OverallSentimentGauge.tsx
β β β βββ TimelineChart.tsx # Sentiment over time
β β β βββ RadarChart.tsx # Multi-dimensional view
β β β βββ SourceComparison.tsx
β β β βββ CalendarHeatmap.tsx
β β β βββ CorrelationScatter.tsx
β β β βββ AIInsights.tsx
β β β βββ ExportPanel.tsx
β β βββ store/
β β β βββ useStore.ts # Zustand state management
β β βββ types/
β β β βββ index.ts # TypeScript definitions
β β βββ App.tsx # Root component
β β βββ main.tsx # Entry point
β β βββ index.css # Global styles + Tailwind
β βββ public/ # Static assets
β βββ index.html
β βββ package.json
β βββ tsconfig.json
β βββ tailwind.config.js
β βββ vite.config.ts
β
βββ βοΈ Backend
β βββ app.py # Flask API server
β βββ requirements.txt # Python dependencies
β βββ stock_database.json # Local ticker database
β βββ .env # Environment variables
β
βββ π Documentation
β βββ README.md # This file
β βββ LICENSE # MIT License
β
βββ π§ Configuration
βββ .gitignore
βββ .vscode/
Ensure you have the following installed:
git clone https://github.com/HackWGaveesh/FinSentiment-Pro.git
cd FinSentiment-Pronpm installcd backend
pip install -r requirements.txtπ‘ Tip: Use a virtual environment for Python dependencies:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -r requirements.txt
Create a .env file in the backend/ directory:
cd backend
cp .env.example .envEdit .env with your API keys:
# π Indian Stock API (get 3 keys from https://indianapi.in)
INDIAN_STOCK_API_KEY=sk_live_your_key_1_here
INDIAN_STOCK_API_KEY_2=sk_live_your_key_2_here
INDIAN_STOCK_API_KEY_3=sk_live_your_key_3_here
# π° News API (optional - https://newsapi.org)
NEWS_API_KEY=your_newsapi_key_here
# π Alpha Vantage (optional - https://www.alphavantage.co)
ALPHA_VANTAGE_KEY=your_alphavantage_key_here
# π Demo Mode (true/false)
DEMO_MODE=false
β οΈ Important: The.envfile is gitignored. Never commit API keys to version control.
Terminal 1 - Backend:
cd backend
python app.pyβ
Backend starts on http://localhost:5000
Terminal 2 - Frontend:
npm run devβ
Frontend starts on http://localhost:3000
npm start- Navigate to Dashboard: Click "Dashboard" in the header or scroll down
- Enter Stock Ticker:
- Type:
RELIANCE.NS,TCS.NS,INFY.NS, etc. - Or click a popular ticker
- Or use voice input ποΈ (Chrome/Edge/Safari)
- Type:
- Select Time Range: Choose 24h, 7d, 30d, or 365d
- Click "Analyze Sentiment": Wait 2-5 seconds for AI processing
- Explore Results:
- Overall sentiment score & gauge
- Timeline chart (sentiment + price)
- Source breakdown & radar chart
- Calendar heatmap & AI insights
- Scroll to "Market Pulse" section
- Filter by sentiment: All / Bullish / Bearish / Neutral
- Sort by: Sentiment / Change % / Confidence
- Click any stock card to instantly analyze it
- Manual refresh only (respects API limits)
| Key | Action |
|---|---|
/ |
Focus search input |
Esc |
Clear search / close modals |
V |
Activate voice input |
D |
Toggle dark/light theme |
http://localhost:5000
GET /api/healthResponse:
{
"status": "healthy",
"model": "FinBERT loaded"
}GET /api/trendingResponse:
{
"trending": [
{
"ticker": "BAJE.NS",
"name": "Bharat Electronics",
"price": 422.95,
"change": 6.1,
"changePercent": 1.46,
"sentiment": 14.6,
"sentimentLabel": "Neutral",
"confidence": 54.4,
"articleCount": 0
}
],
"count": 15,
"timestamp": "2025-11-13T10:30:45.123456"
}Features:
- Real-time NSE data via Indian Stock API
- Automatic API key rotation (3-key pool)
- Fallback to Yahoo Finance if API unavailable
- Quick sentiment calculation (no heavy NLP)
- Capped at top 15 stocks for performance
POST /api/analyze
Content-Type: application/json
{
"ticker": "RELIANCE.NS",
"days": 7
}Response:
{
"ticker": "RELIANCE.NS",
"companyName": "Reliance Industries Ltd",
"overallSentiment": 67.5,
"sentimentLabel": "Bullish",
"confidence": 89.2,
"totalArticles": 247,
"timeline": [
{
"date": "2025-11-13",
"sentiment": 72.3,
"price": 2845.60,
"articles": 42
}
],
"dimensions": {
"positivity": 78.5,
"negativity": 15.2,
"neutrality": 6.3,
"volatility": 23.1,
"momentum": 65.8,
"reliability": 88.4
},
"sourceBreakdown": [
{
"source": "Economic Times",
"logo": "π°",
"sentiment": 75.2,
"articles": 89
}
],
"headlines": [
{
"title": "Reliance announces new green energy...",
"sentiment": 82.3,
"source": "Economic Times",
"publishedAt": "2025-11-13T08:30:00Z",
"url": "https://..."
}
],
"insights": {
"trend": "upward",
"volatility": "moderate",
"correlation": 0.72,
"summary": "Strong bullish sentiment detected..."
}
}Parameters:
ticker(required): Stock ticker (e.g.,RELIANCE.NS)days(optional): Time range (default: 7, max: 365)
The backend implements intelligent API key rotation:
- Loads 3 keys from environment (
INDIAN_STOCK_API_KEY,INDIAN_STOCK_API_KEY_2,INDIAN_STOCK_API_KEY_3) - Rotates through keys on each request (round-robin)
- Extends effective limit from 500 to 1,500 requests
- Falls back to Yahoo Finance if all keys exhausted
cd backend
pip install -r requirements.txt --upgrade- First run downloads ~450MB model from Hugging Face
- Subsequent runs use cached model from
~/.cache/huggingface - Ensure stable internet connection
# Find and kill the process
lsof -ti:5000 | xargs kill -9rm -rf node_modules package-lock.json
npm installEdit vite.config.ts:
export default defineConfig({
server: {
port: 3001 // Change to any available port
}
})npm run build
npm run preview # Test production build- Verify Indian Stock API keys in
backend/.env - Check network connectivity
- Review backend logs for errors
- Ensure at least 1 valid API key
- Check if News API key is valid
- Verify ticker format (should end with
.NSfor NSE) - Ensure backend server is running
- User authentication (JWT)
- Personal watchlists
- Email/SMS alerts for sentiment changes
- Export to PDF with charts
- Comparative analysis (multi-ticker)
- Portfolio tracking with sentiment overlay
- Social media sentiment (Twitter/Reddit)
- Machine learning predictions
- WebSocket for real-time updates
- Redis caching layer
- Database integration (PostgreSQL)
- API rate limiting & usage analytics
- React Native mobile app
- Telegram/Discord bot
- Chrome extension
- Trading platform integrations
We welcome contributions! Here's how you can help:
Open an issue with:
- Clear title and description
- Steps to reproduce
- Expected vs actual behavior
- Screenshots (if applicable)
Open an issue with:
- Feature description
- Use case / motivation
- Proposed implementation (optional)
- Fork the repository
- Create a feature branch:
git checkout -b feature/AmazingFeature - Make your changes
- Commit with conventional commits:
git commit -m 'feat: add amazing feature' - Push to your fork:
git push origin feature/AmazingFeature - Open a Pull Request
- Follow existing code style (Prettier + ESLint configured)
- Add comments for complex logic
- Write meaningful commit messages
- Test thoroughly before submitting
- Update documentation if needed
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License
Copyright (c) 2025 Gaveesh
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction...
Gaveesh
- π GitHub: @HackWGaveesh
- π§ Email: Create an issue
- π Project: FinSentiment-Pro
Special thanks to:
- ProsusAI - FinBERT model for financial sentiment
- Hugging Face - Transformers library
- Yahoo Finance - Stock price data
- Indian Stock API - NSE trending stocks
- News API - News aggregation
- Recharts - Beautiful chart components
- Tailwind CSS - Utility-first styling
- Framer Motion - Smooth animations
Made with β€οΈ by Gaveesh using React, TypeScript, Python, and AI