Skip to content

ArpitHacks/trendscan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔍 TrendScan — AI-Powered Social Media Anomaly Detection

Built at Hackaholic · Open Source · Privacy-First · Zero Backend Required

TrendScan is a real-time analytics dashboard that detects anomalies and surfaces actionable insights from social media engagement data — entirely in the browser, with no API keys or backend needed.

TrendScan Dashboard Vite Chart.js License


✨ Features

  • 📈 Real-time trend visualization — interactive time-series charts with Chart.js
  • 🚨 Multi-algorithm anomaly detection — Z-Score, IQR, MAD with configurable sigma thresholds
  • 📉 Bollinger Bands — dynamic volatility envelope overlaid on engagement data
  • 🔮 7-day forecasting — linear regression extrapolation beyond the current dataset
  • 💡 Insights Panel — auto-generated human-readable summaries of trend health
  • #️⃣ Live hashtag feed — real hashtag data pulled from Reddit + Google Trends RSS
  • 🌐 Multi-platform support — Twitter/X, Instagram, TikTok, LinkedIn
  • 📊 Trend Health Score (0–100) — composite score combining direction, momentum, and volatility

🧠 Analytics Engine

All math runs client-side in src/services/analyticsEngine.js:

Algorithm Description
Z-Score (rolling) Flags deviations beyond a configurable sigma threshold
IQR Interquartile-range outlier detection, robust to extreme values
MAD Median Absolute Deviation for outlier-resistant analysis
Linear Regression Trend direction scoring with R² fitness measure
Bollinger Bands Rolling mean ± k·std envelope (20-period default)
Momentum Recent vs. prior window avg — labels: Accelerating → Collapsing
Velocity / Acceleration 1st and 2nd derivative of the time series (central differences)
7-day Forecast Regression-extrapolated projection
Trend Health Score Composite 0–100 score: direction + momentum − volatility penalty + R² bonus

📡 Data Sources

Live data is fetched from free, public APIs via src/services/trendService.js:

  • Reddit JSON API — hot posts from platform-specific subreddits (no auth required)
  • Google Trends RSS — daily trending searches by geo region (via CORS proxy)
  • Keyword extraction + frequency scoring — NLP pipeline to surface trending terms as hashtags
  • Graceful fallback — curated static datasets if live fetches fail

🏗️ Project Structure

hackaholic/
├── src/
│   ├── components/
│   │   ├── Navbar.jsx          # Top navigation bar
│   │   ├── Hero.jsx            # Landing hero section
│   │   ├── AIStack.jsx         # Tech stack showcase
│   │   ├── Dashboard.jsx       # Main analytics dashboard & chart controls
│   │   ├── InsightsPanel.jsx   # Auto-generated trend insight summaries
│   │   ├── UseCases.jsx        # Target audience cards
│   │   ├── HowItWorks.jsx      # Methodology explainer
│   │   ├── FAQ.jsx             # Frequently asked questions
│   │   └── Footer.jsx          # Site footer
│   ├── services/
│   │   ├── analyticsEngine.js  # Pure-math: anomaly detection + trend analysis
│   │   └── trendService.js     # Live data fetching from Reddit + Google Trends
│   ├── utils/
│   │   └── hashtags.js         # Hashtag utility helpers
│   ├── App.jsx                 # Root component + layout
│   └── index.css               # Global design system (CSS variables, dark mode)
├── index.html
├── vite.config.js
└── package.json

🚀 Getting Started

Prerequisites

  • Node.js v18 or higher
  • npm v9 or higher

Installation

# Clone the repository
git clone https://github.com/your-username/hackaholic.git
cd hackaholic

# Install dependencies
npm install

Development

npm run dev

Open http://localhost:5173 in your browser.

Production Build

npm run build
npm run preview

🛠️ Tech Stack

Layer Technology
Framework React 19
Bundler Vite 8
Charts Chart.js 4 + react-chartjs-2
Icons Lucide React
Styling Vanilla CSS with CSS custom properties (dark-mode first)
Data Reddit JSON API + Google Trends RSS (no auth)
Analytics Custom pure-JS math engine (no external ML libraries)

👥 Who It's For

Role How TrendScan Helps
🎯 Social Media Manager Spot viral spikes instantly — 3× faster content decisions
📊 Growth Analyst Catch engagement dips 48h before they become crises
🚀 Startup Founder Free alternative to $500/mo enterprise analytics tools
🤖 Data Scientist Drop-in anomaly detectors with configurable sigma thresholds
📣 PR & Comms Team Real-time sentiment spike detection across all platforms
💼 Investor / VC Quantify social momentum of portfolio companies

📐 Anomaly Detection – How It Works

  1. Data ingestion — engagement metrics are fetched/simulated as a time series
  2. Statistical baseline — rolling mean and standard deviation are computed
  3. Anomaly scoring — each data point receives a Z-score: z = (value − mean) / std
  4. Classification — points beyond the sigma threshold are labeled spike or dip
  5. Severity gradinghigh (>1.5σ above threshold), medium (>σ), or normal
  6. Hashtag correlation — anomaly events are paired with trending hashtags at that time window

⚙️ Configuration

Dashboard controls let you tune analysis in real time:

  • Platform — Twitter/X · Instagram · TikTok · LinkedIn
  • Metric — Engagement · Likes · Shares · Comments · Impressions
  • Sigma Threshold — 1.0 → 3.0 (controls anomaly sensitivity)
  • Time Range — 7 · 14 · 30 · 60 · 90 days

📄 License

MIT License — free to use, modify, and distribute.


🙌 Built at Hackaholic

TrendScan was created at the Hackaholic hackathon as an open-source, privacy-first alternative to expensive enterprise social analytics platforms.

© 2026 TrendScan — Built at Hackaholic with the AI dev stack
Z-Score · IQR · MAD · Regression · Forecast

About

TrendScan is a real-time analytics dashboard that detects anomalies and surfaces actionable insights from social media engagement data — entirely in the browser, with no API keys or backend needed.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors