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.
- ๐ 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
Modern dark theme with real-time market news and AI analysis
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)
- Node.js 18+
- npm or yarn
- API Keys (see below)
| Service | Purpose | Get Key |
|---|---|---|
| MarketAux | Stock news data | marketaux.com |
| DeepSeek | AI sentiment analysis | deepseek.com |
-
Clone the repository
git clone https://github.com/Codeguruu03/StockPulse.git cd StockPulse -
Setup Backend
cd backend npm installCreate
.envfile inbackend/:DEEPSEEK_API_KEY=your_deepseek_api_key MARKETAUX_API_TOKEN=your_marketaux_api_token
-
Setup Frontend
cd ../frontend npm install -
Run the Application
Terminal 1 (Backend):
cd backend node server.jsTerminal 2 (Frontend):
cd frontend npm run dev -
Open in Browser
Visit http://localhost:3000
- Enter Stock Symbols - Type comma-separated stock symbols (e.g.,
RELIANCE, TCS, INFY) - Click Analyze - The app filters news matching your portfolio
- View AI Analysis - Each headline gets a sentiment rating with reasoning and confidence bar
{
"title": "Reliance Industries reports record quarterly profit",
"rating": "Positive",
"reason": "Record profits indicate strong business performance and growth",
"confidence": 92
}| 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 |
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
| 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 |
| 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 |
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
}
]
}- 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
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is open source and available under the MIT License.
Naman - GitHub
Made with โค๏ธ and โ
