A modern, clean web application that plays MP3 files stored in Google Drive with an intelligent ranking system based on play counts.
- 🔐 Google OAuth Login - Secure authentication using Google Identity Services
- 📁 Google Drive Integration - Fetch and play MP3 files directly from your Drive folder
- 🎵 Smart Ranking Algorithm - Songs are ranked by play count (lower = higher priority)
- ⭐ Favorites System - Mark songs as favorites and filter by them
- 🎲 Random Play - Play random songs prioritizing low-rank (less played) songs
- 💾 Persistent Storage - Play counts and favorites saved in browser local storage
- 🎨 Modern Dark UI - Spotify-inspired clean, responsive design
- 📱 Mobile Responsive - Works seamlessly on desktop and mobile devices
- New songs start with
play_count = 0(highest priority) - When a song is played for >30 seconds, its
play_countis incremented - Lower play_count = higher priority in rankings
- Random play always picks from the lowest-rank songs first
- Favorites can override sorting but still update rank when played
Before you begin, ensure you have:
- A Google Cloud Project (create one at Google Cloud Console)
- Enabled APIs:
- Google Identity Services (OAuth)
- Google Drive API
- OAuth 2.0 Credentials:
- Client ID (Web application type)
- Authorized redirect URIs configured
- A Google Drive folder containing MP3 files
-
Create a Google Cloud Project:
- Go to Google Cloud Console
- Click "Create Project" and give it a name
-
Enable Required APIs:
- Navigate to "APIs & Services" > "Library"
- Enable Google Identity Services
- Enable Google Drive API
-
Create OAuth 2.0 Credentials:
- Go to "APIs & Services" > "Credentials"
- Click "Create Credentials" > "OAuth client ID"
- Choose "Web application" as the application type
- Add your Authorized redirect URIs:
- For local development:
http://localhost:5173(or your Vite port) - For production: Your deployment URL (e.g.,
https://yourusername.github.io)
- For local development:
- Copy your Client ID (you'll need this in Step 3)
- Create a folder in Google Drive
- Upload your MP3 files to this folder
- Important: The folder should contain only MP3 files (or the app will filter them)
- Get your Folder ID from the folder URL:
- Open the folder in Google Drive
- The URL looks like:
https://drive.google.com/drive/folders/FOLDER_ID_HERE - Copy the
FOLDER_ID_HEREpart
# Clone the repository
git clone <your-repo-url>
cd Freedoom
# Install dependencies
npm installCreate a .env file in the root directory:
VITE_GOOGLE_CLIENT_ID=your_client_id_here
VITE_DRIVE_FOLDER_ID=your_folder_id_hereNote: If you don't set these, you can enter them manually in the app UI.
# Development server
npm run dev
# Build for production
npm run build
# Preview production build
npm run previewThe app will be available at http://localhost:5173 (or the port shown in your terminal).
-
Update
vite.config.jsbase path:base: '/your-repo-name/' -
Build the project:
npm run build
-
Deploy the
distfolder to GitHub Pages
- Connect your repository to Netlify
- Set build command:
npm run build - Set publish directory:
dist - Add environment variables in Netlify dashboard:
VITE_GOOGLE_CLIENT_IDVITE_DRIVE_FOLDER_ID
- Import your repository to Vercel
- Add environment variables in project settings
- Deploy
- Sign in to Render with your GitHub account
- Create a new Static Site
- Connect your repository:
AsimMahata/Freedoom - Configure:
- Build Command:
npm install && npm run build - Publish Directory:
dist
- Build Command:
- Add environment variables:
VITE_GOOGLE_CLIENT_IDVITE_DRIVE_FOLDER_ID
- Important: Add your Render URL to Google OAuth authorized redirect URIs
- Deploy
See DEPLOYMENT.md for detailed Render deployment instructions.
If you don't set environment variables, you can:
- Enter your Client ID on the login screen
- Enter your Folder ID after logging in
Both values are saved in browser local storage for convenience.
Freedoom/
├── src/
│ ├── components/
│ │ ├── Login.jsx # Login component with OAuth
│ │ ├── MusicPlayer.jsx # Main player component
│ │ ├── AudioControls.jsx # Audio playback controls
│ │ └── SongList.jsx # Song list display
│ ├── utils/
│ │ ├── googleAuth.js # Google OAuth utilities
│ │ ├── driveApi.js # Google Drive API integration
│ │ ├── storage.js # Local storage utilities
│ │ └── ranking.js # Ranking algorithm
│ ├── App.jsx # Main app component
│ ├── main.jsx # React entry point
│ └── index.css # Global styles
├── index.html
├── vite.config.js
├── package.json
└── README.md
- Login: Click "Sign in with Google" and authorize the app
- Enter Folder ID: If not set in env, enter your Google Drive folder ID
- Play Music: Click the play button on any song
- Navigate: Use previous/next buttons or click songs directly
- Favorites: Click the star icon to favorite/unfavorite songs
- Filter: Toggle "Show Favorites" to see only favorited songs
- Random Play: Click "Play Random" to play a random low-rank song
- The app uses read-only Google Drive API access
- OAuth tokens are stored in browser local storage (not recommended for production apps with sensitive data)
- For production, consider implementing a backend to handle OAuth securely
- Make sure your OAuth redirect URIs match your deployment URL exactly
Issue: "Login failed"
- Check that your Client ID is correct
- Ensure redirect URIs are properly configured in Google Cloud Console
- Make sure Google Identity Services API is enabled
Issue: "Failed to load songs"
- Verify your Folder ID is correct
- Ensure the folder contains MP3 files
- Check that Google Drive API is enabled
- Make sure you have read access to the folder
Issue: "Error playing audio"
- The file might not be accessible with the current token
- Try refreshing the page and logging in again
- Ensure the MP3 file format is valid
This project is open source and available under the MIT License.
Contributions, issues, and feature requests are welcome!
- Google Identity Services for OAuth
- Google Drive API for file access
- React and Vite for the amazing development experience
Made with ❤️ for music lovers