An AI-powered real-time sentiment analysis application that visualizes emotions through beautiful Perlin noise animations. Speak into your microphone and watch as your words transform into flowing, emotion-driven visual art.
- Frontend: https://sentiment-aura-eight.vercel.app
- Backend API: https://sentiment-aura-7z75.onrender.com
- ๐๏ธ Real-time Speech Transcription - Instant audio-to-text using Deepgram API
- ๐ค AI Sentiment Analysis - Powered by Claude Sonnet 4 for emotion detection
- ๐ Perlin Noise Visualization - Beautiful, organic animations that react to emotions
- ๐จ Emotion-Specific Behaviors - Each emotion has unique colors, speeds, and particle movements
- ๐ Live Sentiment Tracking - Real-time sentiment score (0-100%) and keyword extraction
- ๐ฌ Live Transcript Display - See your words appear in real-time
- React - UI framework
- react-p5 - Creative coding for Perlin noise visualization
- Web Audio API - Microphone capture and audio processing
- WebSockets - Real-time communication with Deepgram
- Vercel - Deployment platform
- FastAPI (Python) - High-performance API framework
- Anthropic Claude API - AI-powered sentiment analysis
- Pydantic - Data validation
- Render - Backend hosting
- Deepgram - Real-time speech-to-text transcription
- Claude Sonnet 4 - Natural language understanding and sentiment analysis
โโโโโโโโโโโโโโโ WebSocket โโโโโโโโโโโโโโโโ
โ Browser โ โโโโโโโโโโโโโโโโโโโโโโโโ> โ Deepgram โ
โ (React) โ <โโโโโโโโโโโโโโโโโโโโโโโโ โ API โ
โโโโโโโโโโโโโโโ Transcription โโโโโโโโโโโโโโโโ
โ
โ HTTP POST /process_text
โ (final transcript)
โผ
โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ
โ FastAPI โ โโโโโโโโโโโโโโโโโโโโโโโโ> โ Claude โ
โ Backend โ <โโโโโโโโโโโโโโโโโโโโโโโโ โ API โ
โโโโโโโโโโโโโโโ Sentiment Analysis โโโโโโโโโโโโโโโโ
โ
โ JSON Response
โ {sentiment, emotion, keywords}
โผ
โโโโโโโโโโโโโโโ
โ Perlin Noiseโ
โ Visualizationโ
โโโโโโโโโโโโโโโ
- Node.js (v16+)
- Python (v3.8+)
- API Keys:
# Navigate to backend folder
cd backend
# Create virtual environment
python3 -m venv venv
# Activate virtual environment
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Create .env file
cat > .env << EOF
ANTHROPIC_API_KEY=your_anthropic_key_here
DEEPGRAM_API_KEY=your_deepgram_key_here
EOF
# Start the server
uvicorn main:app --reload --port 8000Backend will run at: http://localhost:8000
# Navigate to frontend folder
cd frontend
# Install dependencies
npm install
# Create .env.local file
cat > .env.local << EOF
REACT_APP_BACKEND_URL=http://localhost:8000
REACT_APP_DEEPGRAM_API_KEY=your_deepgram_key_here
EOF
# Start development server
npm startFrontend will run at: http://localhost:3000
- Push code to GitHub
- Go to Render Dashboard
- Create new Web Service
- Connect your repository
- Configure:
- Root Directory:
backend - Build Command:
pip install -r requirements.txt - Start Command:
uvicorn main:app --host 0.0.0.0 --port $PORT
- Root Directory:
- Add environment variables:
ANTHROPIC_API_KEYDEEPGRAM_API_KEY
- Go to Vercel Dashboard
- Import your GitHub repository
- Configure:
- Framework Preset: Create React App
- Root Directory:
frontend - Build Command:
npm run build
- Add environment variables:
REACT_APP_BACKEND_URL: Your Render backend URLREACT_APP_DEEPGRAM_API_KEY: Your Deepgram key
- Deploy!
- Open the app in your browser
- Click "Start Recording" button
- Allow microphone access when prompted
- Speak clearly into your microphone
- Watch the magic happen:
- Your words appear as live transcript
- Background changes color based on emotion
- Particle speed reflects sentiment intensity
- Keywords are extracted and displayed
-
๐ Happy: "I'm so happy and grateful today!"
- Bright yellow/gold particles, medium-fast movement
-
๐คฉ Excited: "This is amazing! I'm so excited!"
- Hot pink/magenta, fast chaotic sparkles
-
๐ข Sad: "I feel sad and lonely"
- Deep blue, slow drifting particles
-
๐ Angry: "I'm really frustrated and angry!"
- Pulsing red background, aggressive movement
-
๐ Calm: "I feel peaceful and calm"
- Smooth cyan/aqua, gentle floating
sentiment-aura/
โโโ backend/
โ โโโ main.py # FastAPI application
โ โโโ requirements.txt # Python dependencies
โ โโโ .env # Environment variables (not in repo)
โ
โโโ frontend/
โ โโโ public/
โ โโโ src/
โ โ โโโ App.js # Main component
โ โ โโโ AudioCapture.js # Microphone & Deepgram integration
โ โ โโโ AuraVisualization.js # p5.js Perlin noise visualization
โ โโโ package.json
โ โโโ .env.production # Production environment variables
โ
โโโ .gitignore
โโโ README.md
Health check endpoint
Response:
{
"message": "Sentiment Aura Backend Running!"
}Analyze sentiment and extract keywords from text
Request:
{
"text": "I am so happy and excited!"
}Response:
{
"sentiment": 0.9,
"emotion": "excited",
"keywords": ["happy", "excited"]
}The Perlin noise visualization uses organic, flowing particle systems that respond to emotional data:
- Color Hue: Determined by emotion type
- Saturation & Brightness: Mapped to sentiment score (0-1)
- Particle Speed: Higher sentiment = faster movement
- Noise Scale: Controls smoothness (calm = very smooth, angry = chaotic)
- Connections: Lines between nearby particles create flowing patterns
| Emotion | Color | Speed | Behavior |
|---|---|---|---|
| Happy | Yellow/Gold | Medium-Fast | Sparkles |
| Excited | Pink/Magenta | Very Fast | Chaotic sparkles |
| Sad | Deep Blue | Slow | Heavy drift |
| Angry | Red | Fast | Pulsing, aggressive |
| Calm | Cyan/Aqua | Very Slow | Smooth floating |
| Neutral | Muted Green | Medium | Balanced flow |
- Ensure you're using HTTPS or localhost
- Check browser permissions for microphone access
- Try a different browser (Chrome recommended)
- Verify backend CORS settings include your frontend URL
- Check that backend is running and accessible
- Check browser console for errors
- Verify backend environment variables are set
- Test backend endpoint directly with curl
- First request after inactivity takes 30-60 seconds
- Subsequent requests are fast
MIT License - feel free to use this project for learning or personal projects!
- Deepgram - Real-time speech transcription
- Anthropic - Claude AI for sentiment analysis
- p5.js - Creative coding framework
- Memory Machines - Project inspiration
Archit Gupta
- GitHub: @archit2901
- Project: sentiment-aura
โญ Star this repo if you found it helpful!