Inspiration I just wanted to craft a custom desktop interface in JavaFX. I wanted to experiment with additional UI tweaks, like a day/night toggle or a full-screen lyrics pane.

What it does Spoofify is a JavaFX desktop application that connects to a user’s Spotify account via the Spotify Web API. It can:

  • Authenticate the user with Spotify OAuth.
  • Remotely control playback (play, pause, next, previous, shuffle, repeat) on any active Spotify device.
  • Display track information (title, artist, album art) and allow users to drill down for more detailed metadata.
  • Show a “full-screen” layout with lyrics, progress tracking, and volume control—all styled to mirror Spotify’s aesthetic.

How I built it

  • JavaFX for the desktop UI (multiple layouts: bottom bar or full-screen mode).
  • Spotify Web API for player control, track/album metadata, and user authentication.
  • Maven for dependency management (OpenJFX libraries, org.json, and others).
  • Local HTTP server to handle OAuth callbacks, exchanging authorization codes for access tokens.
  • JSON parsing (org.json) to interpret Spotify’s responses and update the interface in real time.

Challenges I ran into

  • Spotify API locking public tokens temporarily
  • inability to port audi through web API—I discovered we cannot stream Spotify audio directly into our JavaFX MediaPlayer due to API restrictions.
  • inability to port synced lyrics through web API
  • Version mismatches between JavaFX and the installed JDK caused class-loading issues.
  • pom XML crashing regularly
  • Resource loading for image icons (PNG files) and ensuring they were packaged properly in Maven.
  • Authentication flow required setting up a local callback server and precisely matching Spotify’s redirect URIs.

Accomplishments that we're proud of

  • Making something that doesn't crash
  • Crafting a cohesive JavaFX interface that emulates Spotify’s look and feel.
  • Successfully controlling Spotify playback from a custom app—proving we can integrate official APIs into a purely desktop-based UI.
  • Implementing clickable track/album labels to show deeper metadata and mock lyrics in a second window.

What I learnt

  • The importance of aligning JavaFX library versions with the JDK to avoid runtime errors.
  • OAuth flows can be tricky, especially ensuring that the redirect URI is exactly consistent with Spotify’s developer settings.
  • Designing a user interface in JavaFX that balances flexibility (multiple layouts) and maintainability (modular code, minimal duplication).

What's next for Spoofify

  • Improved Lyrics Integration: Possibly integrating a third-party lyrics API with real-time syncing. Maybe AI.
  • Search & Library: A more comprehensive approach to browsing your Spotify library, searching for tracks/artists, and tapping into recommended tracks.
  • Web Playback SDK (Advanced): Embedding an official Spotify web player in a JavaFX WebView to play audio locally and appear as its own Spotify Connect device.

Built With

Share this project:

Updates