Skip to content

supremkc05/PulseScope

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PulseScope Analytics Dashboard

Full-stack financial news sentiment analysis platform with interactive dashboard powered by ML

Python 3.13 FastAPI React TypeScript

What is PulseScope?

PulseScope is a complete end-to-end financial news analytics platform that automatically scrapes financial news, analyzes sentiment using VADER + FinBERT, discovers topics with BERTopic, detects high-impact market events, and visualizes insights through an interactive React dashboard.

Key Features

Backend (FastAPI)

  • Multi-source news scraping (CoinTelegraph, CoinDesk, CryptoNews)
  • Dual sentiment analysis (VADER + FinBERT transformer models)
  • Automatic topic discovery (BERTopic with UMAP + HDBSCAN)
  • Event impact detection (Custom scoring algorithm)
  • RESTful API (17+ endpoints with full CORS support)
  • PostgreSQL database (98 articles, 25 daily metrics, 12 topics)

Frontend (React + TypeScript)

  • Interactive Dashboard with 5 comprehensive pages
  • Real-time sentiment trends visualization
  • Topic distribution analysis with meaningful labels
  • High-impact events timeline with filtering
  • Article explorer with search and sentiment filters
  • Responsive design with smooth animations

Quick Start

Prerequisites

  • Python 3.13+
  • PostgreSQL 16+
  • Node.js 18+ and npm
  • pip

Backend Setup

# 1. Clone repository
git clone https://github.com/supremkc05/PulseScope.git
cd PulseScope

# 2. Setup Python environment
python -m venv .venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate

# 3. Install ML dependencies
pip install -r requirements.txt

# 4. Run Jupyter notebooks (in order to generate data)
jupyter notebook
# → model/scraping_data.ipynb       (Phase 1: Scrape news)
# → model/cleaning_data.ipynb       (Phase 2: Clean data)
# → model/sentiment_analysis.ipynb  (Phase 3: Analyze sentiment)
# → model/modelling_topic.ipynb     (Phase 4: Topic modeling)

# 5. Setup PostgreSQL database
createdb pulsescope

# 6. Configure backend environment
cd backend
cp .env.example .env
# Edit .env: Add DATABASE_URL, SECRET_KEY, CORS_ORIGINS

# 7. Install backend dependencies
pip install -r requirements.txt

# 8. Migrate data to database
python migrate_data.py

# 9. Start FastAPI server
uvicorn app.main:app --reload
# API runs at http://localhost:8000
# API docs at http://localhost:8000/api/v1/docs

Frontend Setup

# 1. Navigate to frontend directory
cd ui

# 2. Install dependencies
npm install

# 3. Configure environment
cp .env.example .env
# Edit .env: Set VITE_API_BASE_URL=http://localhost:8000/api/v1

# 4. Start development server
npm run dev
# Dashboard runs at http://localhost:5173

Project Structure

PulseScope/
├── data/
│   ├── scrap_data/              # Raw scraped data
│   ├── topic_analyzed_data.csv  # Final analyzed data
│   └── daily_impact_metrics.csv # Daily aggregations
│
├── model/                       # Jupyter notebooks (ML pipeline)
│   ├── scraping_data.ipynb      # BeautifulSoup web scraping
│   ├── cleaning_data.ipynb      # NLTK text preprocessing
│   ├── sentiment_analysis.ipynb # VADER + FinBERT
│   └── modelling_topic.ipynb    # BERTopic clustering
│
├── backend/                     # FastAPI backend
│   ├── app/
│   │   ├── main.py              # FastAPI application
│   │   ├── api/v1/              # REST endpoints
│   │   │   ├── sentiments.py    # Sentiment endpoints
│   │   │   ├── topicss.py       # Topic analysis endpoints
│   │   │   ├── enventss.py      # High-impact events
│   │   │   └── articlee.py      # Article CRUD
│   │   ├── models/              # SQLAlchemy models
│   │   └── schemas/             # Pydantic validators
│   ├── migrate_data.py          # CSV to PostgreSQL
│   └── requirements.txt
│
├── ui/                          # React frontend
│   ├── src/
│   │   ├── pages/               # Dashboard pages
│   │   │   ├── Overview.tsx     # Main dashboard
│   │   │   ├── SentimentAnalysis.tsx
│   │   │   ├── TopicAnalysis.tsx
│   │   │   ├── HighImpactEvents.tsx
│   │   │   └── ArticleExplorer.tsx
│   │   ├── components/          # Reusable components
│   │   ├── services/            # API client (axios)
│   │   └── types/               # TypeScript interfaces
│   ├── public/
│   │   └── favicon.svg          # Custom branding
│   └── package.json
│
└── requirements.txt             # ML dependencies

ML Pipeline

Web Scraping → Text Cleaning → Sentiment Analysis → Topic Modeling → Event Detection
(BeautifulSoup)  (NLTK)        (VADER + FinBERT)    (BERTopic)       (Impact Score)
     ↓              ↓                  ↓                 ↓                  ↓
 Raw HTML       Clean Text       Sentiment Scores    Topic Labels     Impact Metrics
                                                                            ↓
                                                                    PostgreSQL Database
                                                                            ↓
                                                                       FastAPI REST API
                                                                            ↓
                                                                    React Dashboard

Technologies Used

Backend

Component Technology
API Framework FastAPI 0.109.0
Database PostgreSQL 16 + SQLAlchemy
Caching Redis
Sentiment VADER + FinBERT (transformer)
Topics BERTopic (SentenceTransformers + UMAP + HDBSCAN)
Data Processing pandas, NumPy, scikit-learn

Frontend

Component Technology
Framework React 18.3.1 + TypeScript 5.6.2
Build Tool Vite 6.0.5
HTTP Client Axios 1.7.9
Charts Recharts 2.15.0
Styling Tailwind CSS 3.4.17
Icons Lucide React 0.469.0
Animations Framer Motion 12.0.1

API Endpoints

Base URL: http://localhost:8000/api/v1

Sentiment Endpoints

  • GET /sentiments/summary - Overall sentiment statistics
  • GET /sentiments/trends - Daily sentiment trends
  • GET /sentiments/distribution - Sentiment breakdown by category

Topic Endpoints

  • GET /topics/distribution - Topic distribution with article counts
  • GET /topics/{topic_id} - Detailed topic information with articles

Event Endpoints

  • GET /events/high-impact - High-impact days with filters
  • GET /events/impact-distribution - Event impact statistics

Article Endpoints

  • GET /articles/ - Paginated article list with filters
  • GET /articles/by-source - Article count by news source
  • GET /articles/{article_id} - Individual article details

API Documentation: Available at http://localhost:8000/api/v1/docs (Swagger UI)


Database Schema

Articles Table (98 records)

  • article_id, title, content, source, url
  • published_at, scraped_at
  • vader_compound, vader_pos, vader_neg, vader_neu
  • finbert_pos, finbert_neg, finbert_neu
  • sentiment_label, topic_id

Daily Metrics Table (25 records)

  • date, total_articles
  • avg_vader, avg_finbert
  • sentiment_distribution (JSON)
  • impact_score

Configuration

Backend Environment Variables (.env)

DATABASE_URL=postgresql://username:password@localhost:5432/pulsescope
SECRET_KEY=your-secret-key
CORS_ORIGINS=http://localhost:5173,http://localhost:3000

Frontend Environment Variables (.env)

VITE_API_BASE_URL=http://localhost:8000/api/v1

Author

supremkc05


About

PulseScope is a complete end-to-end financial news analytics platform that automatically scrapes financial news, analyzes sentiment using VADER + FinBERT, discovers topics with BERTopic, detects high-impact market events, and visualizes insights through an interactive React dashboard.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors