Create beautiful, shareable mixtapes presented as animated retro cassette tapes. Connect with Spotify, curate your perfect playlist, and share it with friends through a nostalgic cassette player interface.
- ๐ Spotify OAuth Integration - Secure authentication with Spotify
- ๐ Track Search - Search millions of songs from Spotify's library
- ๐จ Retro Cassette UI - Beautiful animated cassette tape with spinning reels
- ๐ต Web Playback - Stream music directly using Spotify's Web Playback SDK
- ๐ Shareable Links - Each mixtape gets a unique URL to share
- ๐ฑ Mobile Responsive - Works beautifully on all devices
- ๐พ Dual Database Support - PostgreSQL for production, SQLite for local development
- ๐ญ Personalization - Add custom titles and messages to your mixtapes
- โ๏ธ Cloud Ready - One-click deploy to Railway + Vercel
- React 18 - UI library
- Vite - Fast build tool and dev server
- React Router - Client-side routing
- Axios - HTTP client
- Spotify Web Playback SDK - Music streaming
- Node.js - Runtime environment
- Express - Web server framework
- PostgreSQL / SQLite - Database (PostgreSQL in production, SQLite for local dev)
- Spotify Web API - Music data and authentication
Before you begin, ensure you have:
- Node.js 18+ installed (Download)
- A Spotify Premium account (required for Web Playback SDK)
- A Spotify Developer account (Sign up)
```bash git clone cd mixtape ```
- Go to Spotify Developer Dashboard
- Click "Create App"
- Fill in the details:
- App Name: Mixtape (or your choice)
- App Description: Create and share musical mixtapes
- Redirect URI: `http://localhost:3000/api/auth/callback\`
- API: Web API & Web Playback SDK
- Save your app
- Copy your Client ID and Client Secret
```bash cd backend npm install cp .env.example .env ```
Edit `.env` with your Spotify credentials:
```env SPOTIFY_CLIENT_ID=your_client_id_here SPOTIFY_CLIENT_SECRET=your_client_secret_here FRONTEND_URL=http://localhost:5173 BACKEND_URL=http://localhost:3000 REDIRECT_URI=http://localhost:3000/api/auth/callback SESSION_SECRET=generate_a_random_string_here PORT=3000 ```
```bash cd ../frontend npm install ```
Open two terminal windows:
Terminal 1 - Backend: ```bash cd backend npm run dev ```
Terminal 2 - Frontend: ```bash cd frontend npm run dev ```
Navigate to: http://localhost:5173
- Connect with Spotify - Click "Connect with Spotify" on the home page
- Authorize - Grant permissions to the app
- Search for Songs - Use the search bar to find tracks
- Build Your Mixtape - Add up to 20 tracks
- Customize - Add a title and optional message
- Create - Click "Create Mixtape" to generate your shareable link
- Copy the unique URL from the success screen
- Share it with friends via text, email, or social media
- Recipients can listen by logging in with their Spotify account
- Click on a mixtape link
- Login with Spotify (if not already logged in)
- Press play on the cassette player
- Use controls to navigate through tracks
Edit the CSS variables in /frontend/src/index.css:
```css :root { --orange: #ff6b35; --teal: #4ecdc4; --beige: #f7e5d0; --dark-brown: #3d2817; /* ... */ } ```
Modify the cassette component in:
/frontend/src/components/Cassette.jsx/frontend/src/components/Cassette.css
``` mixtape/ โโโ backend/ โ โโโ db/ โ โ โโโ database.js # SQLite database operations โ โโโ routes/ โ โ โโโ auth.js # Spotify OAuth routes โ โ โโโ mixtapes.js # Mixtape CRUD routes โ โ โโโ spotify.js # Spotify API routes โ โโโ server.js # Express server โ โโโ package.json โ โโโ .env โโโ frontend/ โ โโโ src/ โ โ โโโ components/ โ โ โ โโโ Cassette.jsx # Cassette UI component โ โ โ โโโ Cassette.css โ โ โโโ context/ โ โ โ โโโ AuthContext.jsx # Auth state management โ โ โโโ pages/ โ โ โ โโโ Home.jsx # Landing page โ โ โ โโโ Create.jsx # Mixtape creation โ โ โ โโโ MixtapePlayer.jsx # Playback page โ โ โ โโโ MyMixtapes.jsx # User's mixtapes โ โ โโโ utils/ โ โ โ โโโ api.js # API client โ โ โ โโโ spotify.js # Spotify SDK utilities โ โ โโโ App.jsx โ โ โโโ main.jsx โ โ โโโ index.css โ โโโ index.html โ โโโ vite.config.js โ โโโ package.json โโโ README.md ```
- `GET /api/auth/login` - Initiate Spotify OAuth
- `GET /api/auth/callback` - OAuth callback handler
- `GET /api/auth/me` - Get current user
- `POST /api/auth/refresh` - Refresh access token
- `POST /api/auth/logout` - Logout user
- `GET /api/spotify/search?q={query}` - Search tracks
- `GET /api/spotify/playlists` - Get user playlists
- `GET /api/spotify/playlists/:id/tracks` - Get playlist tracks
- `POST /api/mixtapes` - Create new mixtape
- `GET /api/mixtapes/:slug` - Get mixtape by slug
- `POST /api/mixtapes/:id/play` - Increment play count
- `GET /api/mixtapes/user/mine` - Get user's mixtapes
The Spotify Web Playback SDK requires a Premium subscription. Free accounts cannot stream music.
- Check that you have Spotify Premium
- Verify your access token is valid
- Check browser console for errors
- Try refreshing the page
- Verify redirect URI in Spotify Dashboard matches your `.env`
- Ensure backend is running on the correct port
- Clear cookies and try again
If you encounter database issues: ```bash cd backend rm db/mixtapes.db # Delete the database npm start # Restart - database will be recreated ```
We've made deployment super easy! Follow our comprehensive deployment guide:
๐ Read the Full Deployment Guide โ
Backend โ Railway
- Free tier includes PostgreSQL database
- Automatic deployments from GitHub
- Environment variable management
- SSL included
Frontend โ Vercel
- Free tier with unlimited deployments
- Automatic builds and deployments
- Global CDN
- SSL included
-
Deploy Backend to Railway
- Connect your GitHub repo
- Set root directory to
backend - Add PostgreSQL database
- Configure environment variables
- Get your backend URL
-
Deploy Frontend to Vercel
- Connect your GitHub repo
- Set root directory to
frontend - Add
VITE_API_URLenvironment variable - Get your frontend URL
-
Update Spotify App
- Add production redirect URI
- Update website URL
That's it! Every git push automatically deploys your changes.
For detailed step-by-step instructions with screenshots and troubleshooting, see DEPLOYMENT.md
- Docker: Use the provided configuration (coming soon)
- Other PaaS: Render, Fly.io, Heroku all work similarly
- VPS: Requires manual setup with PM2 or similar
MIT License - feel free to use this project for personal or commercial purposes!
Contributions are welcome! Please feel free to submit a Pull Request.
- Built with love and nostalgia for the mixtape era
- Powered by Spotify Web API
- Fonts: Press Start 2P & VT323
If you encounter any issues or have questions:
- Check the Troubleshooting section above
- Review Spotify Web API docs
- Open an issue on GitHub
Made with ๐ต by [Your Name]
