A full-stack, machine learning–powered web application that forecasts stock price movements by combining historical data, financial sentiment analysis, and news headlines. Built with a Python/FastAPI backend and a Next.js frontend, the app delivers real-time predictions and sentiment insights to help users make data-driven investment decisions.
https://stock-prediction-app-two.vercel.app/
- Getting Started
- Project Overview
- Backend Features
- Frontend Features
- Tech Stack
- Future Improvements
- Credits
git clone https://github.com/your-org/stockPredictionApp.git
cd stockPredictionApp# 2.1 Create & activate virtual environment
python3 -m venv .venv
source .venv/bin/activate # macOS/Linux
.\.venv\Scripts\activate # Windows
# 2.2 Install Python dependencies
pip install -r requirements.txt
# 2.3 Launch FastAPI server
uvicorn main:app --reload --host 0.0.0.0 --port 8000cd frontend
# 3.1 Install Node.js dependencies
npm install
# 3.2 Start development server
npm run devOur Stock Prediction App combines financial data, news sentiment, and cutting-edge machine learning models to forecast future stock prices. It features:
- A FastAPI backend for data ingestion, feature engineering, model inference, and sentiment analysis.
- A Next.js/Tailwind-CSS frontend with intelligent search, interactive charts, and real-time prediction display.
-
Stock Price Prediction:
- Models: Linear Regression, Decision Tree, Random Forest, Gradient Boosting, XGBoost, CatBoost, AdaBoost, SVR, Stacking Ensemble
- Trained on historical price & technical indicators to predict next-day direction (and price).
-
News & Headline Sentiment:
- Fetches recent headlines via NewsAPI.
- Trains a headline sentiment model (~76% accuracy).
-
Reddit Sentiment:
- Uses PRAW to pull Reddit posts by ticker/keyword.
- Classifies sentiment with TF-IDF + XGBoost (~76% accuracy).
-
Financial Statement Analysis:
- Retrieves annual reports via yfinance.
- Correlates YOY metrics for feature selection.
- Current model accuracy ~52% (work in progress).
-
Search Bar with Auto-Suggestion:
- Powered by Finnhub API for real-time ticker/company lookup.
-
Dynamic Prediction Dashboard:
- Recharts visualizations of predicted vs. actual price.
- Sentiment tag cloud & summary panels.
- Sectioned view for each model’s output + price forecast.
-
Languages & Frameworks:
- Python 3.9+ · FastAPI · Uvicorn
- JavaScript/TypeScript · Next.js · React
-
Data & ML:
- scikit-learn · XGBoost · CatBoost · SVR · pandas · NumPy
- yfinance · NewsAPI · PRAW
-
UI & Styling:
- Tailwind CSS · Recharts
-
Deployment:
- Render.com (backend) · Vercel (frontend)
- Custom Timeframes: User-selectable 1D, 1W, 1M, 1Y ranges.
- Real-Time Streaming: WebSocket updates for live data & sentiment.
- Community Trending: Show what stocks are trending in community by using NLP on reddit posts or other posts.