A modern Windows desktop application for managing your music collection with a sleek, Spotify-inspired interface. This application allows you to organize albums, view track listings, and watch YouTube videos directly within the app.
- Album Management: Add, view, and search through your music albums
- Track Integration: View detailed track listings for each album
- YouTube Integration: Watch music videos directly in the application
- Modern UI: Clean, dark theme inspired by popular music streaming services
- Database-Driven: Robust MySQL backend for data persistence
- Image Support: Display album artwork from URLs
- C# - Primary programming language
- Windows Forms - GUI framework
- Microsoft WebView2 - Embedded browser for YouTube integration
- Newtonsoft.Json - JSON processing
- MySQL - Database management system
- MySql.Data - .NET MySQL connector
- .NET 9.0 - Runtime framework
- Visual Studio - Development environment
- Windows 10 or later
- .NET 9.0 Runtime
- MySQL Server
- Internet connection (for YouTube videos and album images)
Install the following software:
- .NET 9.0 SDK
- MySQL Server
- Visual Studio 2022 (optional, for development)
- Open MySQL Command Line Client or MySQL Workbench
- Execute the following SQL commands:
-- Create the database
CREATE DATABASE music;
-- Use the database
USE music;
-- Create albums table
CREATE TABLE albums (
ID INT AUTO_INCREMENT PRIMARY KEY,
album_title VARCHAR(255) NOT NULL,
artist_name VARCHAR(255) NOT NULL,
year INT NOT NULL,
image_url VARCHAR(500),
description TEXT
);
-- Create tracks table
CREATE TABLE tracks (
ID INT AUTO_INCREMENT PRIMARY KEY,
track_title VARCHAR(255) NOT NULL,
track_number INT NOT NULL,
video_url VARCHAR(500),
lyrics TEXT,
albums_ID INT,
FOREIGN KEY (albums_ID) REFERENCES albums(ID) ON DELETE CASCADE
);
-- Insert sample data (optional)
INSERT INTO albums (album_title, artist_name, year, image_url, description) VALUES
('Abbey Road', 'The Beatles', 1969, 'https://upload.wikimedia.org/wikipedia/en/4/42/A_With_Recording.jpg', 'The eleventh studio album by the English rock band the Beatles'),
('Thriller', 'Michael Jackson', 1982, 'https://upload.wikimedia.org/wikipedia/en/5/55/Michael_Jackson_-_Thriller.png', 'The sixth studio album by American singer and songwriter Michael Jackson');
INSERT INTO tracks (track_title, track_number, video_url, lyrics, albums_ID) VALUES
('Come Together', 1, 'https://www.youtube.com/watch?v=3QhoVYUKkLQ', 'Here come old flattop, he come groovin'' up slowly...', 1),
('Something', 2, 'https://www.youtube.com/watch?v=QF2RvU4c0dQ', 'Something in the way she moves...', 1),
('Thriller', 1, 'https://www.youtube.com/watch?v=sOnqjkJTMaA', 'It''s close to midnight...', 2),
('Beat It', 2, 'https://www.youtube.com/watch?v=82Tl4kLF1iQ', 'They told him don''t you ever come around here...', 2);- Open
AlbumsDAO.csin the project - Update the connection string to match your MySQL setup:
private string connectionString = "datasource=localhost;username=your_username;password=your_password;database=music";Replace:
your_usernamewith your MySQL username (commonly 'root')your_passwordwith your MySQL passwordlocalhostwith your MySQL server address if different
- Open
SQLMusicApp.slnin Visual Studio - Restore NuGet packages (right-click solution β Restore NuGet Packages)
- Build the solution (Build β Build Solution)
- Run the application (Debug β Start Debugging)
- Navigate to the project directory in Command Prompt
- Run:
dotnet restore - Run:
dotnet build - Run:
dotnet run
- Click "Add Album" button
- Fill in the album details:
- Album Name (required)
- Artist Name (required)
- Year (required)
- Image URL (optional)
- Description (optional)
- Click "Add Album" to save
- Click "Load Albums" to display all albums
- Use the search box to filter albums by name
- Click on an album row to view its tracks
- Select an album to view its tracks
- Click on a track to watch its YouTube video
- Use "Delete Track" to remove selected tracks
- Videos load automatically when you select a track
- If embedded playback fails, a link opens in your default browser
- Supports various YouTube URL formats
SQLMusicApp/
βββ Form1.cs # Main application form and UI logic
βββ AlbumsDAO.cs # Data Access Object for database operations
βββ Album.cs # Album data model
βββ Tracks.cs # Track data model
βββ Program.cs # Application entry point
βββ SQLMusicApp.csproj # Project configuration
βββ SQLMusicApp.sln # Visual Studio solution file
βββ README.md # This file
The application uses a modern dark theme. To customize colors:
- Open
Form1.cs - Modify the color constants in
ApplyModernStylingToControls()method - Colors are defined using RGB values for precise control
The current schema supports basic album and track management. To extend functionality:
- Modify the database tables in your MySQL server
- Update the corresponding C# classes (
Album.cs,Tracks.cs) - Update the SQL queries in
AlbumsDAO.cs
Application won't start:
- Ensure .NET 9.0 is installed
- Check that all NuGet packages are restored
- Verify database connection string is correct
Database connection errors:
- Confirm MySQL server is running
- Check username/password in connection string
- Ensure the 'music' database exists
YouTube videos not loading:
- Check internet connection
- Verify YouTube URL format is correct
- Try opening the video in a browser first
Album images not displaying:
- Check image URL is valid
- Ensure the URL is accessible from your network
- Some image hosts may block programmatic access
If you encounter issues:
- Check the error messages in the application
- Verify your database setup
- Ensure all dependencies are installed
- Review the connection string configuration
Contributions are welcome! To contribute:
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
This project is open source and available under the MIT License.
- Spotify - For the beautiful UI inspiration
- YouTube - For the video integration
- MySQL - For the reliable database backend
- .NET Foundation - For the excellent development platform
Note: This application is for educational and personal use. Ensure you have proper rights to any music content you manage.