Skip to content

smundhra-git/Stock_PulseAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

30 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“ˆ Stock Pulse AI

AI-Powered Financial Market Analysis Platform

Stock Pulse AI is a comprehensive financial analysis platform that combines technical analysis, sentiment analysis, and real-time market data to provide intelligent insights for stock market investments. The platform uses advanced AI models to analyze news sentiment, social media trends, SEC filings, and technical indicators to generate actionable investment intelligence.

πŸ“‹ Table of Contents

✨ Features

🎯 Core Analytics

  • Technical Analysis: 9-factor scoring system rating stocks from -9 to +9
  • Sentiment Analysis: Multi-source sentiment scoring using AI/NLP models
  • Real-time Market Data: Live stock prices, charts, and market indicators
  • Interactive Visualizations: Candlestick charts, line graphs, and technical indicators

🧠 AI-Powered Insights

  • News Sentiment: Analysis of financial news using FinBERT and VADER models
  • Social Media Sentiment: Reddit and social platform sentiment tracking
  • SEC Filings Analysis: Automated analysis of company filings and reports
  • Multi-timeframe Analysis: 1-day, 1-month, 1-year predictions and trends

🌐 Platform Features

  • RESTful API: FastAPI backend with automatic OpenAPI documentation
  • Modern Frontend: React-based dashboard with responsive design
  • Real-time Updates: Live market data and sentiment updates
  • Authentication: Secure user management and API access
  • Market Coverage: S&P 500, NASDAQ, and individual stock analysis

πŸ›  Technologies Used

Backend

  • FastAPI - Modern, fast web framework for building APIs
  • Python 3.9+ - Core programming language
  • PostgreSQL - Primary database for data storage
  • SQLAlchemy - Database ORM and query builder

AI/ML Stack

  • PyTorch - Deep learning framework for AI models
  • Transformers (Hugging Face) - Pre-trained NLP models (FinBERT)
  • VADER Sentiment - Rule-based sentiment analysis
  • scikit-learn - Machine learning algorithms and tools
  • pandas - Data manipulation and analysis

Data Sources & APIs

  • yfinance - Yahoo Finance API for stock data
  • NewsAPI - Financial news and sentiment data
  • Reddit API (PRAW) - Social sentiment analysis
  • SEC EDGAR - Official company filings and reports

Frontend

  • React 18 - Frontend framework
  • Plotly.js - Interactive data visualizations
  • React Router - Client-side routing
  • Recharts - Additional charting library

DevOps & Deployment

  • Docker - Containerization
  • Git - Version control
  • GitHub Actions - CI/CD pipelines

πŸ’» System Requirements

Minimum Requirements

  • Python: 3.9 or higher
  • Node.js: 16.0 or higher
  • npm: 8.0 or higher
  • Memory: 4GB RAM (8GB recommended)
  • Storage: 2GB free space

Recommended Setup

  • Operating System: macOS, Linux, or Windows 10/11
  • Python: 3.10+
  • Memory: 8GB+ RAM for optimal AI model performance
  • GPU: Optional, for faster AI model inference

External Dependencies

  • NewsAPI Key: For financial news data (free tier available)
  • Internet Connection: For real-time market data and API access

πŸš€ Installation

1. Clone the Repository

git clone https://github.com/smundhra-git/Stock_PulseAI.git
cd Stock_PulseAI

2. Backend Setup

Create Virtual Environment

# Create and activate conda environment
conda create -n stockpulse python=3.9 -y
conda activate stockpulse

# OR using venv
python -m venv stockpulse_env
source stockpulse_env/bin/activate  # On Windows: stockpulse_env\Scripts\activate

Install Python Dependencies

pip install -r requirements.txt

Environment Configuration

Create a .env file in the root directory:

# Required API Keys
NEWSAPI=your_newsapi_key_here

# Optional: Database Configuration
DATABASE_URL=postgresql://username:password@localhost/stockpulse

# Optional: Reddit API (for enhanced social sentiment)
REDDIT_CLIENT_ID=your_reddit_client_id
REDDIT_CLIENT_SECRET=your_reddit_client_secret

Get your NewsAPI key:

  1. Visit NewsAPI.org
  2. Sign up for a free account
  3. Copy your API key to the .env file

3. Frontend Setup

cd frontend
npm install

4. Start the Application

Start Backend (Terminal 1)

# From project root directory
conda activate stockpulse  # if using conda
uvicorn fastapi_service.main:app --reload --port 8080

Start Frontend (Terminal 2)

# From frontend directory
cd frontend
npm start

5. Access the Application

πŸ“– Usage

API Endpoints

  • Technical Analysis: GET /api/stock/{ticker}/technical
  • Sentiment Analysis: GET /api/stock/{ticker}/sentiment
  • Stock Charts: GET /api/stock/{ticker}/graph
  • Market Data: GET /api/sp500-realtime

Example API Call

curl -X 'GET' \
  'http://localhost:8080/api/stock/AAPL/sentiment' \
  -H 'accept: application/json'

πŸ“š API Documentation

The FastAPI backend automatically generates interactive API documentation:

These interfaces allow you to:

  • Explore all available endpoints
  • Test API calls directly in the browser
  • View request/response schemas
  • Download OpenAPI specifications

πŸ“ Project Structure

Stock_PulseAI/
β”œβ”€β”€ src/                          # Core application logic
β”‚   β”œβ”€β”€ api_handler.py           # API route handlers
β”‚   β”œβ”€β”€ sentiment/               # Sentiment analysis modules
β”‚   β”œβ”€β”€ technical/               # Technical analysis tools
β”‚   └── database/                # Database operations
β”œβ”€β”€ fastapi_service/             # FastAPI application
β”‚   β”œβ”€β”€ main.py                  # FastAPI app configuration
β”‚   └── routes.py                # API route definitions
β”œβ”€β”€ frontend/                    # React frontend application
β”‚   β”œβ”€β”€ src/                     # React source code
β”‚   β”œβ”€β”€ public/                  # Static assets
β”‚   └── package.json             # Frontend dependencies
β”œβ”€β”€ requirements.txt             # Python dependencies
β”œβ”€β”€ .env                         # Environment variables
└── README.md                    # Project documentation

πŸ—Ί Development Roadmap

βœ… Completed

  • FastAPI backend with sentiment analysis
  • React frontend foundation
  • Technical analysis (9-factor scoring)
  • News and Reddit sentiment analysis
  • Real-time market data integration
  • Interactive API documentation

🚧 In Progress

  • Enhanced FinBERT model integration (PyTorch 2.6+ compatibility)
  • Advanced technical indicators
  • User authentication and portfolios

πŸ“‹ Planned Features

  • Macroeconomic data integration (FRED API)
  • AI-powered price predictions
  • Portfolio optimization tools
  • Mobile-responsive enhancements
  • Real-time notifications and alerts
  • Advanced charting and analytics

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“ž Support

If you have any questions or run into issues, please open an issue on GitHub.


Made with ❀️ for smarter financial analysis

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published