Skip to content

About

Local-first browser music library built with React, TypeScript, and IndexedDB.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

96 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Clarus Music

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.

How It Works

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.

Prerequisites

  • Node.js (v18 or later recommended)
  • npm or yarn
  • Spotify Developer Account (optional, for Spotify metadata features when self-hosting)

Installation

  1. Clone the Repository

    git clone <your-repository-url>
    cd music_library
  2. Install Dependencies

    npm install

    This will install both frontend and backend dependencies.

  3. Configure Spotify API (Optional)

    The app uses Spotify API for song search and artist image validation. You need to set up Spotify credentials:

    Server Environment (app/backend/.env, or the Vercel project environment variables):

    SPOTIFY_CLIENT_ID=your_client_id
    SPOTIFY_CLIENT_SECRET=your_client_secret
    

    Note: The client secret is used only by the serverless routes in app/api. Never prefix it with VITE_, 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.

  4. 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.

Usage

  1. 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.
  2. Organize: Create albums, artists, and playlists
  3. Play Music: Click any song to start playing
  4. Enjoy: Your library persists in your browser - no login needed!

Building for Production

npm run build

Technical Details

  • 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)

Browser Compatibility

Works in all modern browsers that support:

  • IndexedDB
  • File API
  • Audio API

Limitations

  • 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)

License

MIT License - see LICENSE file for details.

About

Local-first browser music library built with React, TypeScript, and IndexedDB.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages