A stunning, production-ready full-stack web application that analyzes social media sentiment in real-time using advanced NLP.
- Real-time Sentiment Analysis — VADER-based + optional HuggingFace transformer analysis
- Emotion Detection — Joy, Anger, Fear, Surprise, Sadness breakdown
- Live Dashboard — Bento grid with animated charts, word cloud, stats
- Live Feed — Server-Sent Events streaming new posts every 3 seconds
- Realtime Model Training — Continuously trains on fresh incoming posts
- Realtime Dataset Capture — Writes labeled stream samples to
data/realtime-dataset.jsonl - Keyword Extraction — Auto-detect trending keywords with sentiment coloring
- Multi-platform Support — Twitter/X, Reddit, Instagram, Facebook, TikTok, YouTube
- Stunning Design — Deep space theme, glassmorphism, particles, animations
| Layer | Technologies |
|---|---|
| Frontend | HTML5, CSS3, Vanilla JavaScript |
| Backend | Node.js, Express.js |
| NLP | sentiment (VADER), HuggingFace Inference API |
| Charts | Chart.js |
| Particles | tsParticles |
| Icons | Lucide Icons |
| Fonts | Inter, Space Grotesk (Google Fonts) |
mini2/
├── public/ # Static frontend files
│ ├── index.html # Single-page application
│ ├── css/
│ │ └── styles.css # Complete design system
│ └── js/
│ └── app.js # Client-side application logic
├── server/
│ ├── server.js # Express server entry point
│ ├── .env # Environment variables
│ ├── routes/
│ │ ├── analyze.js # POST /api/analyze
│ │ ├── dashboard.js # GET /api/dashboard
│ │ └── feed.js # GET /api/feed (SSE)
│ └── services/
│ ├── sentimentService.js # VADER sentiment analysis
│ ├── huggingfaceService.js # HuggingFace API integration
│ └── mockDataService.js # Simulated social media data
├── package.json
└── README.md
- Node.js 18+ installed
# 1. Navigate to the project directory
cd mini2
# 2. Install dependencies
npm install
# 3. Start the server
npm startVisit http://localhost:3000
For deeper analysis using transformer models, add your free HuggingFace API key:
- Get a free API key at huggingface.co/settings/tokens
- Edit
server/.env:HUGGINGFACE_API_KEY=your_key_here - Restart the server
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/analyze |
Analyze text sentiment |
| GET | /api/dashboard |
Get dashboard statistics |
| GET | /api/feed |
SSE live feed of posts |
| GET | /api/training/status |
Realtime model + dataset stats |
| GET | `/api/training/dataset?format=jsonl | csv` |
| POST | /api/training/reset |
Reset model ({"resetDataset": true} also clears dataset file) |
- Incoming Reddit + manual analyzer text is auto-labeled and appended to
data/realtime-dataset.jsonl - A lightweight online model is updated continuously from this stream and blended with base sentiment scoring
// Request
{ "text": "I love this product! Amazing quality!" }
// Response
{
"sentiment": "positive",
"score": 0.65,
"confidence": 82,
"emotions": { "joy": 85, "anger": 12, "fear": 8, "surprise": 45, "sadness": 5 },
"keywords": ["love", "product", "amazing", "quality"],
"highlightedText": [{ "word": "love", "sentiment": "positive" }, ...]
}- Deep Space color palette (midnight blacks, neon accents)
- Glassmorphism cards with backdrop blur
- Neumorphic inputs and buttons
- tsParticles interactive hero background
- Typewriter headline animation
- Cursor glow that follows mouse movement
- Scroll-triggered section reveals
- Animated charts with Chart.js
- Live SSE feed with slide-in animations
- Floating CTA button on scroll
- Full responsive design (desktop → mobile)
MIT License — Use freely for personal and commercial projects.