A comprehensive JavaFX-based music library management system that allows users to browse, purchase, manage, and play audio tracks with an intuitive graphical interface.
AudioLibrary is a desktop application built with JavaFX that provides a complete music library experience. Users can:
- Browse & Discover: Explore audio tracks by artists, albums, and genres
- Purchase Music: Add tracks to cart and purchase using virtual currency
- Library Management: Organize purchased tracks in personal library
- Playlist Creation: Create and manage custom playlists
- Audio Playback: Play music with controls for play/pause, skip, shuffle, and loop
- Download: Save purchased tracks to local storage
- User Profiles: Manage account balance and view payment history
The application uses a MySQL database backend to store user data, audio metadata, purchases, and playlists.
- Java 17+
- JavaFX - UI framework
- MySQL - Database
- JDBC - Database connectivity
- Maven - Build and dependency management
- FXML - UI layout definitions
Before running this application, ensure you have the following installed:
-
Java Development Kit (JDK) 17 or higher
-
MySQL Server
- Download from MySQL Community Server
- Default port: 3306
-
Maven (optional - included via Maven Wrapper)
- Download from Apache Maven
-
Start MySQL Server
- Ensure MySQL is running on
localhost:3306
- Ensure MySQL is running on
-
Create Database
CREATE DATABASE NullPointers_db;
-
Import Database Schema
- Locate the SQL schema file in
src/main/resources/SQLsdirectory - Import the schema:
mysql -u root -p NullPointers_db < src/main/resources/SQLs/schema.sql - Locate the SQL schema file in
-
Configure Database Credentials
- Open
src/main/java/AudioController/DatabaseConnection.java - Update credentials if needed (default: user=
root, password=``)
private static final String DB_URL = "jdbc:mysql://localhost:3306/NullPointers_db"; private static final String DB_USER = "root"; private static final String DB_PASSWORD = "";
- Open
On Windows:
# Navigate to project directory
cd AudioLibrary
# Run the application
mvnw.cmd clean javafx:runOn Linux/Mac:
# Navigate to project directory
cd AudioLibrary
# Make the wrapper executable
chmod +x mvnw
# Run the application
./mvnw clean javafx:run-
Import Project
- Open your IDE
- Select
File → Openand choose theAudioLibraryfolder - IDE will automatically detect it as a Maven project
-
Configure JavaFX
- Ensure JavaFX SDK is configured in your IDE
- Maven should handle dependencies automatically
-
Run Application
- Locate
src/main/java/AudioController/Main.java - Right-click and select
Run Main.main()
- Locate
# Navigate to project directory
cd AudioLibrary
# Compile the project
mvn clean compile
# Run the application
mvn javafx:runAudioLibrary/
├── src/
│ └── main/
│ ├── java/
│ │ ├── AudioController/
│ │ │ ├── Main.java # Application entry point
│ │ │ ├── AudioPlayer.java # Audio playback manager
│ │ │ ├── DatabaseConnection.java # Database connection
│ │ │ ├── ResourceLoader.java # Resource utility
│ │ │ ├── DownloadManager.java # Audio download manager
│ │ │ └── controllers/ # FXML controllers
│ │ │ ├── HomeScene.java
│ │ │ ├── LibraryScene.java
│ │ │ ├── PlaylistContentsScene.java
│ │ │ ├── SongPageScene.java
│ │ │ └── ...
│ │ └── module-info.java
│ └── resources/
│ ├── audioFiles/ # Audio file storage
│ ├── coverArt/ # Album/track artwork
│ ├── artistImages/ # Artist images
│ ├── CSS/ # Stylesheets
│ ├── FXMLs/ # UI layout files
│ ├── ProjectImages/ # UI assets
│ └── SQLs/ # Database scripts
├── pom.xml # Maven configuration
├── mvnw # Maven wrapper (Unix)
├── mvnw.cmd # Maven wrapper (Windows)
└── README.md
- User registration and authentication
- Account balance management
- Payment history tracking
- Browse all available tracks
- View by artist, album, or genre
- Purchase tracks and add to personal library
- View detailed audio information
- Play/Pause functionality
- Skip to next/previous track
- Shuffle and loop modes
- Volume control
- Queue management
- Create custom playlists
- Add/remove tracks from playlists
- Edit playlist names and artwork
- Play entire playlists
- Add tracks to cart
- View cart contents
- Process payments
- Automatic library updates after purchase
Audio files should be placed in: src/main/resources/audioFiles
- Album/track art:
src/main/resources/coverArt - Artist images:
src/main/resources/artistImages - UI images:
src/main/resources/ProjectImages
- Verify MySQL is running on port 3306
- Check credentials in
DatabaseConnection.java - Ensure database
NullPointers_dbexists
- Ensure JDK 17+ is being used
- Verify JavaFX dependencies in
pom.xml - Check
src/main/java/module-info.javaexports and opens declarations
- Verify audio files exist in
resources/audioFiles/ - Ensure audio files are in supported format (MP3 recommended)
- Check
AudioPlayer.javafor file path resolution
This project was developed by the NullPointers team. Contributions, issues, and feature requests are welcome!
Note: Make sure all audio files and database are properly set up before running the application for the first time.