A terminal-style music application that creates personalized Spotify playlists based on your mood using AI. beatsnotfound combines the power of Spotify's API with Google's Gemini AI to deliver a unique music experience.
- Terminal Interface: Retro-style terminal UI for a nostalgic computing experience
- Spotify Integration: Connect with your Spotify account to access your music library
- AI-Powered Playlist Creation: Generate playlists based on your mood using Gemini AI
- Real-time Communication: Socket.IO for seamless real-time interactions with per-user chat history
- Responsive Design: Works on desktop and mobile devices
- React: UI library for building the user interface
- Vite: Next-generation frontend tooling
- Tailwind CSS: Utility-first CSS framework
- Socket.IO Client: Real-time communication with the server
- Node.js: JavaScript runtime
- Express: Web framework for Node.js
- Socket.IO: Real-time bidirectional event-based communication with user session management
- Google Generative AI: AI-powered playlist generation using Gemini 2.0
- Spotify Web API: Access to Spotify's music data
- Helmet: Security middleware
- Rate Limiting: Protection against brute force attacks
- Node.js (v14 or higher)
- npm or yarn
- Spotify Developer Account
- Google AI API Key
git clone https://github.com/harshit960/beatsnotfound.git
cd beatsnotfoundCreate a .env file in the server directory with the following variables:
PORT=5000
NODE_ENV=development
GEMINI_API_KEY=your_gemini_api_key
SPOTIFY_CLIENT_ID=your_spotify_client_id
SPOTIFY_CLIENT_SECRET=your_spotify_client_secret
SPOTIFY_REDIRECT_URI=http://localhost:5000/callback
CLIENT_URL=http://localhost:3000
Create a .env file in the client directory with the following variable:
VITE_API_URL=http://localhost:5000
cd server
npm install
npm run devcd client
npm install
npm run dev- Open your browser and navigate to
http://localhost:3000 - Type
loginin the terminal to authenticate with Spotify - Once logged in, you can interact with the AI by typing your mood or preferences
- The AI will generate a personalized playlist based on your input
- The playlist will be created in your Spotify account
- Store sensitive API keys in environment variables
- Use HTTP-only cookies for token storage in production
- Implement rate limiting to prevent abuse
- Use Helmet for security headers
- Validate all user inputs
- Separate chat histories per user session
- Set up a server (e.g., Heroku, DigitalOcean, AWS)
- Configure environment variables
- Build and deploy the application:
cd server
npm install
npm start- Build the frontend application:
cd client
npm run build- Deploy the built files to a static hosting service (e.g., Netlify, Vercel, GitHub Pages)
chat_message: Send a message to the AIlogin_request: Request Spotify authentication
chat_response: Receive AI responselogin_success: Authentication successfulchat_error: Receive error messageslogin_request: Trigger login flowlogin_url: Receive Spotify authentication URL
GET /user-data: Get user's Spotify dataGET /login: Initiate Spotify authenticationGET /callback: Spotify authentication callbackGET /refresh_token: Refresh Spotify access tokenGET /api/health: Check server health status
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Send mail at raj.harshit960@gmail.com
This project is licensed under the MIT License - see the LICENSE file for details.