Skip to content

Codeguruu03/StockPulse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

6 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ“ˆ StockPulse

AI-Powered Stock Sentiment Analyzer

StockPulse is a full-stack web application that fetches real-time stock market news and leverages AI (DeepSeek/GPT) to analyze sentiment, providing actionable insights for your portfolio.

Next.js Express React DeepSeek


โœจ Features

  • ๐Ÿ” Real-time News Fetching - Pulls latest Indian stock market news via MarketAux API
  • ๐Ÿค– AI Sentiment Analysis - Uses DeepSeek LLM to rate news as Positive/Neutral/Negative
  • ๐Ÿ“Š Portfolio Filtering - Filter news relevant to your specific stock holdings
  • ๐Ÿ“ˆ Confidence Scoring - Each analysis includes a 0-100% confidence rating with visual bars
  • ๐ŸŽจ Modern Dark UI - Sleek dark theme with glassmorphism and gradient effects
  • โšก Loading States - Visual feedback during API calls
  • ๐Ÿ“ฑ Responsive Design - Works on desktop and mobile devices

๐Ÿ–ผ๏ธ Screenshots

Dashboard

StockPulse Dashboard

Modern dark theme with real-time market news and AI analysis


๐Ÿ—๏ธ Architecture

StockPulse/
โ”œโ”€โ”€ backend/                 # Express.js API Server (Port 4000)
โ”‚   โ”œโ”€โ”€ server.js           # Main entry point
โ”‚   โ”œโ”€โ”€ routes/
โ”‚   โ”‚   โ”œโ”€โ”€ news.js         # GET /api/news, POST /api/news/analyze
โ”‚   โ”‚   โ””โ”€โ”€ portfolio.js    # GET/POST /api/portfolio
โ”‚   โ””โ”€โ”€ services/
โ”‚       โ”œโ”€โ”€ newsScraper.js  # MarketAux API integration
โ”‚       โ””โ”€โ”€ gptAnalyzer.js  # DeepSeek AI integration
โ”‚
โ””โ”€โ”€ frontend/               # Next.js React App (Port 3000)
    โ”œโ”€โ”€ pages/
    โ”‚   โ”œโ”€โ”€ index.jsx       # Main dashboard
    โ”‚   โ””โ”€โ”€ api/            # Next.js API routes (proxy)
    โ”œโ”€โ”€ components/
    โ”‚   โ”œโ”€โ”€ PortfolioForm   # Stock symbol input
    โ”‚   โ”œโ”€โ”€ NewsList        # All news headlines
    โ”‚   โ”œโ”€โ”€ FilteredNews    # Portfolio-relevant news
    โ”‚   โ””โ”€โ”€ AnalysisCard    # AI sentiment cards
    โ””โ”€โ”€ styles/             # CSS Modules (Dark Theme)

๐Ÿš€ Getting Started

Prerequisites

  • Node.js 18+
  • npm or yarn
  • API Keys (see below)

API Keys Required

Service Purpose Get Key
MarketAux Stock news data marketaux.com
DeepSeek AI sentiment analysis deepseek.com

Installation

  1. Clone the repository

    git clone https://github.com/Codeguruu03/StockPulse.git
    cd StockPulse
  2. Setup Backend

    cd backend
    npm install

    Create .env file in backend/:

    DEEPSEEK_API_KEY=your_deepseek_api_key
    MARKETAUX_API_TOKEN=your_marketaux_api_token
  3. Setup Frontend

    cd ../frontend
    npm install
  4. Run the Application

    Terminal 1 (Backend):

    cd backend
    node server.js

    Terminal 2 (Frontend):

    cd frontend
    npm run dev
  5. Open in Browser

    Visit http://localhost:3000


๐Ÿ“– Usage

  1. Enter Stock Symbols - Type comma-separated stock symbols (e.g., RELIANCE, TCS, INFY)
  2. Click Analyze - The app filters news matching your portfolio
  3. View AI Analysis - Each headline gets a sentiment rating with reasoning and confidence bar

Example Output

{
  "title": "Reliance Industries reports record quarterly profit",
  "rating": "Positive",
  "reason": "Record profits indicate strong business performance and growth",
  "confidence": 92
}

๐ŸŽจ UI Features

Feature Description
Dark Theme Sleek dark gradient background with purple accents
Glassmorphism Frosted glass effect on cards
Visual Confidence Bars Progress bars showing AI confidence levels
Sentiment Icons ๐Ÿ“ˆ Positive, ๐Ÿ“‰ Negative, โž– Neutral
Hover Animations Smooth card lift effects
Loading Spinners Visual feedback during API calls
Error Handling User-friendly error messages

๐Ÿ”„ Data Flow

sequenceDiagram
    participant User
    participant Frontend
    participant Backend
    participant MarketAux
    participant DeepSeek

    User->>Frontend: Enter stock symbols
    Frontend->>Backend: GET /api/news
    Backend->>MarketAux: Fetch news
    MarketAux-->>Backend: Return headlines
    Backend-->>Frontend: Return news
    Frontend->>Frontend: Filter by portfolio
    Frontend->>Backend: POST /api/news/analyze
    Backend->>DeepSeek: Analyze sentiment
    DeepSeek-->>Backend: Return ratings
    Backend-->>Frontend: Return analysis
    Frontend->>User: Display results
Loading

๐Ÿ› ๏ธ Tech Stack

Layer Technology
Frontend Next.js 15, React 19, Axios
Backend Express.js 5, Node.js
AI/ML DeepSeek API (OpenAI-compatible)
News API MarketAux (Indian stocks)
Styling CSS Modules with Dark Theme

๐Ÿ“ API Endpoints

Backend API

Method Endpoint Description
GET /api/news Fetch all stock news headlines
POST /api/news/analyze Analyze headlines with AI
GET /api/portfolio Get current portfolio
POST /api/portfolio Update portfolio symbols

Request/Response Examples

POST /api/news/analyze

// Request
{
  "filtered": [
    { "title": "TCS wins $500M deal", "url": "..." }
  ]
}

// Response
{
  "analysis": [
    {
      "title": "TCS wins $500M deal",
      "rating": "Positive",
      "reason": "Large contract wins indicate strong business growth",
      "confidence": 88
    }
  ]
}

๐Ÿ”ฎ Future Enhancements

  • User authentication & saved portfolios
  • Historical sentiment tracking
  • Real-time stock price integration
  • Multiple market support (US, EU, Asia)
  • Email/SMS alerts for significant news
  • Push notifications

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  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

๐Ÿ“„ License

This project is open source and available under the MIT License.


๐Ÿ‘จโ€๐Ÿ’ป Author

Naman - GitHub


Made with โค๏ธ and โ˜•

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors