Transform your Spotify playlists into a visual journey. Organize your music by the colors of album artwork.
ColorBeats is a Next.js web application that connects to your Spotify account, analyzes the dominant colors in your playlist's album artwork, and allows you to reorganize your playlists based on these colors. Create beautiful rainbow-ordered playlists and discover your music in a whole new way!
- π¨ Color Analysis: Automatically extracts dominant colors from album artwork
- π Rainbow Sorting: Organizes tracks by color to create visually pleasing playlists
- π Smart Backup: Automatically backs up your original playlist order
- π± Responsive Design: Works beautifully on desktop and mobile devices
- π΅ Spotify Integration: Seamlessly connects with your Spotify account
- β‘ Fast Processing: Efficient color extraction and playlist reordering
- π― Multiple Sort Options: Sort by color, date, or track count
Visit the live demo: https://colorbeats.matsdh.nl
- Framework: Next.js 15 with App Router
- Language: TypeScript
- Styling: Tailwind CSS
- Animations: Framer Motion
- Color Analysis: node-vibrant
- Spotify API: @spotify/web-api-ts-sdk
- Node.js 18+ and npm
- A Spotify Developer Account
git clone https://github.com/yourusername/colorbeats.git
cd colorbeatsnpm install- Go to the Spotify Developer Dashboard
- Create a new app
- Add your redirect URI (e.g.,
http://localhost:3000for development) - Note your Client ID
Create a .env.local file in the root directory:
NEXT_PUBLIC_SPOTIFY_CLIENT_ID=your_spotify_client_id_hereIn src/lib/spotify.ts, update the REDIRECT_URI constant:
const REDIRECT_URI = 'http://localhost:3000'; // For developmentnpm run devOpen http://localhost:3000 to see the application.
src/
βββ app/ # Next.js App Router
β βββ globals.css # Global styles
β βββ layout.tsx # Root layout
β βββ page.tsx # Home page
βββ components/ # React components
β βββ Navbar.tsx # Navigation bar
β βββ PlaylistGrid.tsx # Main playlist grid
β βββ PlaylistModal.tsx # Playlist detail modal
βββ lib/ # Utility libraries
βββ colorExtractor.ts # Color analysis functions
βββ colors.ts # Color manipulation utilities
βββ spotify.ts # Spotify API integration
The application requests the following Spotify permissions:
playlist-read-private- Read private playlistsplaylist-modify-public- Modify public playlistsplaylist-modify-private- Modify private playlistsuser-library-read- Read user's library
The app implements intelligent rate limiting to respect Spotify's API limits:
- Maximum 3 requests per 2-second window
- Automatic request queuing
- Graceful error handling and retries
We welcome contributions! Please follow these guidelines:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes
- Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
- Code Style: We use Prettier and ESLint. Run
npm run lintbefore committing - TypeScript: Maintain strict type safety
- Components: Keep components small and focused
- Testing: Add tests for new features (we welcome help setting up a testing framework!)
- π§ͺ Testing: Help set up Jest/Testing Library
- π¨ UI/UX: Improve the design and user experience
- π Audio Features: Add music preview capabilities
- π Analytics: Track color distribution and statistics
- π Internationalization: Add multi-language support
- βΏ Accessibility: Improve accessibility features
- π± Mobile: Enhance mobile experience
- β‘ Performance: Optimize color extraction algorithms
- Be respectful and inclusive
- Provide constructive feedback
- Help others learn and grow
- Follow the existing code patterns
| Variable | Description | Required |
|---|---|---|
NEXT_PUBLIC_SPOTIFY_CLIENT_ID |
Your Spotify app's Client ID | Yes |
- Push your code to GitHub
- Connect your repository to Vercel
- Add your environment variables in the Vercel dashboard
- Update the
REDIRECT_URIinsrc/lib/spotify.tsto your production URL - Deploy!
The app can be deployed to any platform that supports Next.js:
- Netlify
- Railway
- DigitalOcean App Platform
- AWS Amplify
- Color extraction may be slower for large playlists (we're working on optimization)
- Some album artwork may not have sufficient color contrast for sorting
- Spotify's rate limits may cause delays with very large playlists
This project is licensed under the MIT License - see the LICENSE file for details.
- Spotify Web API for the music data
- node-vibrant for color extraction
- Next.js team for the amazing framework
- All contributors who help make this project better!
- π Report a Bug
- π‘ Request a Feature
- π¬ Discussions
Made with β€οΈ and π΅ by the ColorBeats community
