Inspiration

We were inspired by the question: "What is the world feeling right now?" In an increasingly connected world, emotions spread faster than ever. A viral song can lift spirits across continents. Breaking news can shift the mood of entire nations in hours. Yet, there was no unified way to visualize this global emotional landscape. We wanted to create a tool that could answer questions like:

  • How does music reflect a country's mood?
  • Can we detect emotional shifts before they make headlines?
  • What patterns emerge when we map feelings across the globe?

What it does

WorldMood-AI is a real-time global mood visualization platform that displays the emotional state of countries on an interactive 3D globe with a stunning starfield background. Key Features:

  • Interactive 3D Globe - Mapbox GL powered rotating globe with 1000+ stars parallax effect
  • Multi-Source Sentiment Analysis - Combines Last.fm music trends (valence, energy, danceability) with news sentiment via Gemini AI
  • 5 Mood Categories - Happy 🟢, Calm 🔵, Anxious 🟠, Sad 🟣, Angry 🔴
  • 7-Day Trend Charts - Visualize mood history for each country
  • Spike Detection - Real-time alerts when a country's mood changes significantly
  • Global Statistics - Track worldwide mood distribution across 60+ countries
  • AI Insights - Gemini generates natural language mood explanations
  • Responsive Design - Works seamlessly on desktop, tablet, and mobile Click any country to see detailed mood breakdowns, audio features, trending music, and AI-powered insights.

How we built it

Backend Architecture:

  • FastAPI for high-performance async REST API
  • PostgreSQL 16 for reliable data persistence with SQLAlchemy 2.0 ORM
  • Redis 7 for caching to ensure sub-100ms response times
  • Alembic for database migrations

Frontend Stack:

  • Next.js 14 with App Router for React-based UI
  • TypeScript for type-safe development
  • Mapbox GL JS for 3D globe visualization with starfield background
  • Tailwind CSS for modern, responsive styling
  • Framer Motion for smooth animations
  • Recharts for 7-day trend visualizations

AI & Data Pipeline:

  • Last.fm API - Top 50 tracks per country with audio feature extraction
  • Google News RSS - Country-specific headlines (no API key needed)
  • Gemini AI - Advanced sentiment analysis and mood summary generation

Mood Algorithm:

  • Music Analysis (60%): Valence, Energy, Danceability, Acousticness
  • News Sentiment (40%): Analyzed via Gemini AI

Infrastructure:

  • Docker Compose for containerized deployment
  • Automated cron jobs for daily data updates

Challenges we ran into

  1. Data Synchronization - Combining data from Last.fm and Google News with different formats required careful orchestration and caching strategies.
  2. Mood Algorithm Calibration - Balancing music features (valence, energy, danceability, acousticness) with news sentiment took multiple iterations.
  3. Globe Performance - Rendering 60+ countries with 1000 parallax stars while maintaining 60fps on mobile required heavy optimization.
  4. Spike Detection - Implementing Z-score analysis with 7-day rolling windows for anomaly detection was mathematically challenging.
  5. Responsive 3D Map - Making the globe interface work on both 27" monitors and 5" phones required creative UX solutions.

Accomplishments that we're proud of

Stunning 3D Globe - Rotating globe with starfield parallax and smooth country highlighting AI-Powered Insights - Gemini generates context-aware mood explanations for every country Real-time Updates - Countries dynamically update colors as new data arrives 60+ Countries Tracked - Comprehensive global coverage with daily data refresh Full Mobile Support - Responsive design with collapsible panels Clean Architecture - Separation of concerns between data ingestion, API, and visualization

What we learned

  • Multi-modal AI - Combining audio features with text sentiment provides richer insights than either alone
  • Globe Visualization - Learned deep Mapbox GL techniques for projections, layers, and interactions
  • Async Python - FastAPI + asyncpg showed us the power of async-first backend development
  • Real-time UX - Users expect instant feedback; caching and optimistic updates are essential
  • Data Quality - Garbage in, garbage out - data validation at ingestion is critical

What's next for WorldMood-AI

Planned Features:

  • Historical Playback - Scrub through time to see how moods changed during major events
  • Mood Predictions - ML models to forecast emotional trends
  • Social Media Integration - Add Twitter/X and Reddit sentiment for richer analysis
  • Custom Alerts - Users can subscribe to mood changes in specific countries
  • API Access - Public API for researchers and developers
  • Mobile Apps - Native iOS and Android applications
  • Multi-language Support - Localization for global users

Built With

Share this project:

Updates