Intelligent stock market analysis combining Deep Learning (LSTM) with Large Language Models (LLM) for data-driven investment decisions.
StockPulse AI is a full-stack AI application that leverages cutting-edge machine learning and natural language processing to provide comprehensive stock analysis. By combining:
- LSTM Neural Networks for temporal trend forecasting and pattern recognition
- Large Language Models (Google Gemini) for sentiment analysis and contextual interpretation
- Financial Data APIs for real-time market data and historical trends
- Modern Web UI built with React for interactive data visualization
The system generates actionable investment insights with reduced human bias and faster decision-making capabilities.
- Dual-Model Approach: LSTM for quantitative analysis + LLM for qualitative insights
- Real-Time Processing: Analyzes 60+ days of historical data instantly
- Multi-Metric Evaluation: Price trends, momentum, peer comparison, valuation metrics
- Alpha Score: Proprietary investment potential gauge (-100 to +100)
- Recommendation: Buy/Hold/Sell signals with confidence levels
- Peer Analysis: Relative valuation against industry competitors
- Risk Assessment: Volatility metrics and trend reliability
- Light Minimalistic Design: Clean, accessible interface
- Real-Time Feedback: Elegant loading states and instant results
- Responsive Layout: Works seamlessly on desktop and mobile
- Data Visualization: Interactive charts and intuitive displays
- RESTful API: Query any stock ticker by company name or symbol
- Error Handling: Graceful fallbacks and helpful error messages
- Environment Configuration: Easy setup with environment variables
StockPulse AI
├── Backend (Python)
│ ├── LSTM Model Training & Inference
│ ├── LLM Integration (Google Gemini API)
│ ├── Financial Data Processing
│ ├── REST API Endpoints
│ └── Database Management
│
└── Frontend (React + Vite)
├── Modern UI Components
├── Real-time Search
├── Interactive Dashboard
├── Data Visualization
└── Responsive Design
- Python 3.8+ - Core language
- TensorFlow/Keras - LSTM model implementation
- Google Gemini API - LLM sentiment analysis
- Flask/FastAPI - REST API framework
- Pandas/NumPy - Data processing
- yfinance - Stock market data
- React 18 - UI framework
- Vite - Build tool (optimized performance)
- Framer Motion - Smooth animations
- Recharts - Data visualization
- Lucide React - Professional icons
- Axios - API communication
- Vercel - Frontend hosting
- Cloud Platform - Backend deployment
- Python 3.8 or higher
- Node.js 16 or higher
- npm or yarn package manager
# Navigate to backend directory
cd backend
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Set environment variables
cp .env.example .env
# Edit .env with your configuration:
# - GEMINI_API_KEY=your_gemini_api_key
# - STOCK_DATA_API_KEY=your_api_key
# Run the server
python app.py# Navigate to frontend directory
cd frontend
# Install dependencies
npm install
# Create environment file
cp .env.example .env
# Edit .env with your API URLs:
# VITE_API_URL=http://localhost:5000/api
# Start development server
npm run dev
# Build for production
npm run build-
Open the Application
- Navigate to https://stockpulse.vercel.app (or your deployment URL)
-
Search for a Stock
- Enter company name (e.g., "Apple", "Microsoft", "Tesla")
- Or use stock ticker symbol (e.g., "AAPL", "MSFT", "TSLA")
-
View Analysis
- Alpha Score: Investment potential metric
- Recommendation: Buy/Hold/Sell signal
- Key Metrics: Price trends, momentum, valuation
- Peer Comparison: Relative performance vs competitors
- Insights: AI-generated analysis and context
# Analyze a stock
curl -X POST http://localhost:5000/api/analyze \
-H "Content-Type: application/json" \
-d '{"company_name": "Apple"}'
# Response includes:
# {
# "ticker": "AAPL",
# "alpha_score": 45,
# "recommendation": "BUY",
# "confidence": 0.87,
# "metrics": {...},
# "insights": "..."
# }-
Stock Ticker Lookup
- User enters company name → System retrieves stock ticker
- NSE/Stock exchange name resolution
-
Historical Data Retrieval
- Fetch 60+ days of OHLCV (Open, High, Low, Close, Volume) data
- Calculate technical indicators (SMA, EMA, RSI, MACD)
-
LSTM Analysis
- Trained model predicts price trends
- Identifies momentum and reversal patterns
- Generates quantitative scores
-
LLM Analysis
- Recent news and financial headlines
- Sentiment analysis (positive/negative/neutral)
- Contextual interpretation of market events
- Peer company comparison
-
Synthesis & Recommendation
- Combines LSTM predictions with LLM insights
- Generates Alpha Score (-100 to +100)
- Produces Buy/Hold/Sell recommendation
- Provides detailed analysis report
- ✅ Light Minimalistic Theme: Professional white background with blue accents (#2563eb)
- ✅ Enhanced Loading States: Elegant spinner with smooth cubic-bezier animation
- ✅ Improved Components: Polished cards with subtle shadows and hover effects
- ✅ Better Typography: Optimized hierarchy using clamp() for responsive sizing
- ✅ Mobile Responsive: Perfected all breakpoints for mobile, tablet, and desktop
- ✅ Smooth Animations: Professional transitions with consistent timing
- ✅ Accessibility: Better color contrast and semantic structure
- ✅ Design System: Comprehensive CSS variables for consistency
- ✅ Environment variables for sensitive credentials
- ✅ Input validation and sanitization
- ✅ Error handling without exposing system details
- ✅ CORS configuration for API requests
- ✅ Rate limiting on API endpoints
- ✅ Secure API key management
- Frontend Build: 384KB (gzipped: 124KB)
- API Response Time: <2 seconds for analysis
- LSTM Inference: <1 second per prediction
- LLM Processing: <3 seconds for content generation
- Total Analysis Time: <5 seconds end-to-end
# Run backend tests
cd backend
pytest tests/
# Run frontend tests
cd frontend
npm run test
# Build frontend
npm run build
# Check production build
npm run previewstockpulse/
├── backend/
│ ├── models/ # LSTM and preprocessing modules
│ ├── api/ # REST API endpoints
│ ├── data/ # Historical data and cache
│ ├── config/ # Configuration files
│ ├── requirements.txt # Python dependencies
│ └── app.py # Main Flask/FastAPI application
│
├── frontend/
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── assets/ # Images and icons
│ │ ├── index.css # Global styles (light theme)
│ │ ├── App.jsx # Main application
│ │ └── main.jsx # Entry point
│ ├── package.json # npm dependencies
│ └── vite.config.js # Vite configuration
│
└── README.md # This file
# Install Vercel CLI
npm install -g vercel
# Deploy from frontend directory
cd frontend
vercel
# Set environment variables in Vercel dashboard
# - VITE_API_URL=your_backend_url# Build and deploy
gcloud run deploy stockpulse \
--source . \
--platform managed \
--region us-central1# Deploy to Heroku
heroku login
heroku create stockpulse-api
git push heroku mainContributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
This project is licensed under the MIT License.
Hemang Singh Sengar
- GitHub: @hemangsengar
- LinkedIn: Hemang Singh Sengar
- Email: hemang.sengar@gmail.com
- Google Gemini API for LLM capabilities
- TensorFlow/Keras for deep learning framework
- React & Vite for modern web development
- Financial Data APIs for market data access
For questions, issues, or suggestions:
- Issues: Open an issue on GitHub
- Discussions: Start a discussion for feature ideas
- Email: hemang.sengar@gmail.com
- Documentation: Check the docs folder
- Real-time portfolio tracking
- Custom watchlists
- Advanced charting with TradingView
- Backtesting engine
- Mobile app (React Native)
- Enterprise API tier
- Machine learning model improvements
- Extended market coverage (Crypto, Forex)
Last Updated: April 30, 2026
Made with ❤️ by Hemang Singh Sengar