Live Demo: weatherbeatz.netlify.app
An intelligent music discovery application that creates personalized playlists based on real-time weather conditions. WeatherBeats bridges the gap between environmental atmosphere and musical mood, using sophisticated algorithms to curate the perfect soundtrack for any weather.
- Advanced Search-Based Algorithm: Custom recommendation engine using multi-strategy Spotify API searches
- Weather-to-Music Mapping: Sophisticated algorithm mapping 12+ weather conditions to appropriate musical moods and genres
- Regional Content Optimization: Automatically detects user's market and optimizes song availability across global regions
- Quality Filtering: Implements duration, popularity, and content filtering for curated results
- Artist Variety Control: Ensures diverse playlists by limiting tracks per artist while maintaining randomness
- Real-Time Weather Data: OpenWeatherMap API integration with comprehensive condition support
- Location-Based Experience: Automatic geolocation detection for accurate local weather
- Day/Night Awareness: Different music recommendations based on time of day for contextual relevance
- Weather-Responsive UI: 14+ unique visual themes that change based on weather conditions
- Immersive Animations: CSS-based particle systems simulating rain, snow, storms, and other weather effects
- Glassmorphism Design: Modern UI with backdrop blur effects and dynamic color schemes
- Mood-Based Interactions: Subtle animations that reflect the emotional quality of weather conditions
- OAuth 2.0 with PKCE: Secure authentication using industry-standard security practices
- Playlist Creation: Save generated playlists directly to user's Spotify account
- Direct Playback Links: One-click access to full tracks in Spotify
- Rich Metadata Display: Album artwork, artist information, duration, and popularity scores
- Mobile-First Design: Responsive layout optimized for all device sizes
- Accessibility Features: Screen reader support, keyboard navigation, reduced motion options
- Intelligent Pagination: Smooth navigation through large playlists
- Real-Time Feedback: Comprehensive loading states and error handling
- Customizable Settings: Playlist length and explicit content filtering
- React 18: Modern functional components with hooks for state management
- CSS3: Advanced features including custom properties, backdrop filters, and CSS Grid
- Lucide React: Consistent, scalable icon system
- Responsive Design: Mobile-first approach with CSS Grid and Flexbox
- Spotify Web API: Music search, user authentication, and playlist management
- OpenWeatherMap API: Real-time weather data and forecasting
- OAuth 2.0: Secure user authentication with PKCE flow
Instead of relying on basic recommendation APIs, WeatherBeats implements a sophisticated search strategy:
// Multi-angle search approach
const queries = [
// Genre-based with temporal filtering
`genre:${genre} year:2023-2024`,
// Artist-specific targeting
`artist:"${artist}"`,
// Mood and keyword searches
`${mood} music`,
`${weatherCondition} vibes`,
// Trending and popularity
'trending 2024',
'viral songs'
];
Weather conditions trigger real-time CSS custom property updates:
// Dynamic theme application
const root = document.documentElement;
root.style.setProperty('--theme-background', theme.background);
root.style.setProperty('--theme-accent', theme.accent);
root.style.setProperty('--theme-text-primary', theme.textPrimary);
CSS-only particle effects for immersive experience:
/* Rain effect example */
.theme-rainy::before {
background: linear-gradient(transparent 50%, var(--theme-particle-color) 52%);
animation: rain-drops 0.8s linear infinite;
}
- PKCE Flow: Code challenge/verifier for secure OAuth without client secrets
- Token Management: Automatic refresh with session persistence
- Error Handling: Comprehensive API error management with user-friendly messages
- Hardware Acceleration: GPU-accelerated animations for smooth performance
- Lazy Loading: Efficient resource loading and image optimization
- Rate Limiting: Intelligent API call management to prevent service limits
- Caching Strategy: Session-based token and data caching
- WCAG Compliance: High contrast mode, reduced motion support, screen reader compatibility
- Progressive Enhancement: Core functionality works without JavaScript
- Error Recovery: Helpful error messages with actionable recovery options
- Loading States: Clear feedback during asynchronous operations
weatherbeats/
βββ src/
β βββ Components/ # React components
β β βββ Header.jsx # Spotify authentication
β β βββ WeatherCard.jsx # Weather display & music mood
β β βββ Playlists.jsx # Music generation & display
β β βββ Settings.jsx # User preferences
β β βββ Card.jsx # Weather-to-music mapping
β βββ CSS/ # Styling system
β β βββ App.css # Layout & weather animations
β β βββ index.css # Global theming & particles
β β βββ Header.css # Authentication UI
β β βββ WeatherCard.css # Weather display styling
β β βββ Playlists.css # Music interface
β β βββ Settings.css # User controls
β β βββ Card.css # Music mood display
β βββ services/
β β βββ api.js # Spotify API & weather services
β β βββ weatherThemes.js # Dynamic theming system
β βββ App.jsx # Main application controller
β βββ main.jsx # Application entry point
βββ README.md
- Node.js 16+ and npm/yarn
- Spotify Developer Account
- OpenWeatherMap API Account
Create a .env
file in the root directory:
VITE_SPOTIFY_API_KEY=your_spotify_client_id
VITE_SPOTIFY_CLIENT_SECRET=your_spotify_client_secret
VITE_WEATHER_API_KEY=your_openweathermap_api_key
# Clone the repository
git clone https://github.com/yourusername/weatherbeats.git
cd weatherbeats
# Install dependencies
npm install
# Start development server
npm run dev
# Build for production
npm run build
- Create app at Spotify Developer Dashboard
- Add redirect URI:
https://yourapp.netlify.app/
- Copy Client ID to environment variables
- Configure OAuth scopes:
playlist-modify-public playlist-modify-private user-read-private
- Sign up at OpenWeatherMap
- Generate API key
- Add to environment variables
The application maps weather conditions to musical characteristics using psychological research and empirical data:
- Rain/Drizzle: Contemplative, introspective music (Lo-fi, Ambient, Indie Folk)
- Thunderstorms: High-energy, intense music (Rock, Electronic, Metal)
- Snow: Peaceful, winter-themed music (Classical, Ambient, Folk)
- Clear Day: Upbeat, energetic music (Pop, Reggae, Happy Hip Hop)
- Clear Night: Romantic, relaxed music (R&B, Smooth Jazz, Chillwave)
- Clouds: Balanced, alternative music (Indie Pop, Soft Electronic)
- Duration Filtering: Removes very short (<30s) or very long (>10min) tracks
- Popularity Thresholds: Filters out tracks with insufficient popularity scores
- Content Appropriateness: Explicit content filtering based on user preferences
- Market Availability: Ensures tracks are available in user's region
- Custom Recommendation Engine: Built proprietary algorithm instead of using basic recommendation APIs
- Regional Content Challenges: Solved global music availability issues with market detection and fallback strategies
- Performance Optimization: Implemented efficient API usage patterns to handle rate limiting
- User Experience: Created seamless integration between weather data and music discovery
- Comprehensive Documentation: Detailed inline comments explaining complex algorithms
- Modular Design: Separation of concerns with dedicated services and components
- Error Handling: Robust error management with user-friendly feedback
- Responsive Design: Mobile-first approach with advanced CSS techniques
- OAuth 2.0 Implementation: Secure authentication with PKCE flow
- RESTful API Consumption: Multiple API integrations with proper error handling
- Rate Limiting Management: Intelligent request throttling and retry mechanisms
- Data Transformation: Complex data processing and formatting for optimal UX
- Dynamic Theming: Real-time visual changes based on external data
- Animation Systems: CSS-based particle effects and micro-interactions
- Accessibility: WCAG compliance with reduced motion and high contrast support
- Progressive Enhancement: Functional core experience with enhanced features
- Machine Learning Integration: User behavior analysis for improved recommendations
- Social Features: Playlist sharing and collaborative weather playlists
- Extended Weather Data: Air quality, UV index, and seasonal influences
- Music Analysis: Audio feature matching (energy, danceability, valence)
- Offline Support: Service worker implementation for offline functionality
- Performance Monitoring: Analytics integration for user experience optimization
- Advanced Caching: Redis implementation for improved response times
- Microservices Architecture: Scalable backend with dedicated recommendation service
- A/B Testing: Feature flag system for experimental features
Portfolio: LinkedIn: linkedin.com/in/alexander-robaczewski Email: [email protected]
WeatherBeats demonstrates full-stack development skills, API integration expertise, advanced CSS techniques, and user-centered design thinking. The project showcases ability to solve complex technical challenges while maintaining excellent user experience and code quality.