MySpotifyAI is an intelligent web-based Spotify client that combines modern web technologies with artificial intelligence to deliver a personalized and immersive music experience. By integrating Spotify's powerful API with advanced AI capabilities, MySpotifyAI offers smart music recommendations based on your listening preferences and emotional state.
- Secure OAuth 2.0 authentication flow through Spotify
- Seamless integration with NextAuth.js for session management
- Protected routes and API endpoints
- Persistent user sessions
-
Playlist Management
- View and browse personal playlists
- Create new playlists with custom covers
- Edit playlist details and track order
- Delete unwanted playlists
- Collaborative playlist support
-
Music Playback
- Full playback control using Spotify's Web Playback SDK
- Real-time track progress
- Volume control and shuffle/repeat options
- Queue management
-
User Library
- Access to recently played tracks
- Display favorite artists and albums
- Save tracks to library
- Browse personal music collection
-
Intelligent Conversation
- Natural language interaction using GPT-4/Google Gemini
- Context-aware music recommendations
- Music discovery through conversation
- Playlist generation based on chat input
-
Personalized Recommendations
- Analysis of listening history
- Genre and artist preferences learning
- Mood-based song suggestions
- Discovery of similar artists and tracks
-
Sentiment Detection
- Real-time analysis of chat messages
- Emotion classification (happy, sad, energetic, calm, etc.)
- Mood tracking over time
-
Emotional Response
- Curated playlists based on current mood
- Dynamic song suggestions matching emotional state
- Mood-transition aware recommendations
-
Frontend
- Next.js 14
- Shadcn UI
- React 18
- TailwindCSS
- TypeScript
- SWR for data fetching
- Radix UI components
- Recharts for data visualization
-
Backend
- Node.js
- NextAuth.js
- Spotify Web API
- Anthropic API
-
Authentication
- OAuth 2.0
- JWT tokens
- Secure session management
- Node.js (v18 or higher)
- Spotify Developer Account
- Anthropic API key
- Modern web browser with JavaScript enabled
- Clone the repository:
git clone https://github.com/yourusername/spotify-ai-stuff.git
cd spotify-ai-stuff- Install dependencies:
npm install- Set up environment variables:
cp .env.example .env.local- Configure your environment variables:
SPOTIFY_CLIENT_ID=your_spotify_client_id
SPOTIFY_CLIENT_SECRET=your_spotify_client_secret
NEXTAUTH_SECRET=your_nextauth_secret
ANTHROPIC_API_KEY=your_anthropic_api_key
NEXTAUTH_URL=http://localhost:3000- Run the development server:
npm run dev- Open http://localhost:3000 in your browser
- Go to Spotify Developer Dashboard
- Create a new application
- Add
http://localhost:3000/api/auth/callback/spotifyto Redirect URIs - Copy Client ID and Client Secret to your
.env.localfile
- Obtain API key from Anthropic
- Add key to
.env.localfile