A local-first music library whose core storage, organization, and playback run entirely in your browser. Built with React, TypeScript, and IndexedDB. It started as a database course project using PostgreSQL and Express, then moved to browser-local storage for the deployed version.
The deployed app does not need an account or database for local music-library features. Spotify and Bandcamp metadata features use hosted API routes. If you self-host the full app, you need to configure those routes and Spotify credentials.
This app uses IndexedDB (via Dexie.js) to store:
- Audio files as Blobs
- Song metadata (title, artist, album, duration)
- Playlists and their song associations
- All other library data
Everything is stored locally in your browser. Your music library is tied to the browser/device you use.
- Node.js (v18 or later recommended)
- npm or yarn
- Spotify Developer Account (optional, for Spotify metadata features when self-hosting)
-
Clone the Repository
git clone <your-repository-url> cd music_library
-
Install Dependencies
npm install
This will install both frontend and backend dependencies.
-
Configure Spotify API (Optional)
The app uses Spotify API for song search and artist image validation. You need to set up Spotify credentials:
- Register your app at Spotify Developer Dashboard
- Create a new app and get your Client ID and Client Secret
Server Environment (
app/backend/.env, or the Vercel project environment variables):SPOTIFY_CLIENT_ID=your_client_id SPOTIFY_CLIENT_SECRET=your_client_secretNote: The client secret is used only by the serverless routes in
app/api. Never prefix it withVITE_, because Vite would bake it into the browser bundle. Without Spotify credentials, the local library still works, but Spotify search and artist-image features do not. -
Run the Application
npm run dev
This will start both the backend API server (on port 3000) and the Vite development server (on port 5173). Open your browser to the URL shown (typically
http://localhost:5173).Note: The backend server is only required for Bandcamp metadata extraction and Spotify API calls. Local imports, storage, organization, and playback remain browser-local.
- Add Songs: Click "add song" and select audio files from your device. You can also paste Spotify or Bandcamp URLs in the search field to automatically fill in song metadata (artist, album, cover art). For Spotify, you can also search by song name.
- Organize: Create albums, artists, and playlists
- Play Music: Click any song to start playing
- Enjoy: Your library persists in your browser - no login needed!
npm run build- Frontend Framework: React with TypeScript
- Database: IndexedDB (via Dexie.js)
- Build Tool: Vite
- Routing: React Router
- State Management: React Context API
- External APIs: Spotify Web API (for song search and artist images), Bandcamp (for metadata extraction)
- Backend: Express.js server for Bandcamp metadata extraction and audio streaming (runs on port 3000)
Works in all modern browsers that support:
- IndexedDB
- File API
- Audio API
- Library is tied to a single browser/device
- If you clear browser data, your library will be lost
- No cross-device synchronization (by design - keeps it simple and free)
MIT License - see LICENSE file for details.