Technologies Used
- Python
- SQLite3
- HTML/CSS
- MusicBrainz Database
- https://coverartarchive.org
The journey to build my music collection app began with a personal frustration: keeping track of an extensive CD collection. Without an organized system, I frequently found myself wondering if I already owned certain albums, especially when browsing through music stores. The need was simple yet critical—an easily searchable, visually engaging, and mobile-friendly catalog of my collection.
This project evolved far beyond its initial purpose. What started as a way to keep track of albums became a showcase for my skills in front-end development, database management, and iterative problem-solving. The final result is a one-page application, combining sleek design with robust functionality, powered by HTML5, CSS3, and JavaScript, and backed by an SQLite database.
The first version of the app focused on gathering and organizing data. I chose SQLite as the database because of its simplicity and portability, and I integrated the MusicBrainz API to fetch metadata for each album using barcodes.
Challenges:
missing.jpg placeholder for cover art.Key Code Snippet: Fetching Metadata
import requests
def fetch_album_metadata(barcode):
url = f"https://musicbrainz.org/ws/2/release/?query=barcode:{barcode}&fmt=json"
response = requests.get(url)
if response.status_code == 200:
data = response.json()
if data['releases']:
return {
'artist': data['releases'][0]['artist-credit'][0]['artist']['name'],
'album_name': data['releases'][0]['title'],
'release_year': data['releases'][0].get('date', '').split('-')[0],
'cover_art_url': f"https://coverartarchive.org/release/{data['releases'][0]['id']}/front"
}
return None
This initial phase taught me the importance of handling edge cases (like missing data) and set the groundwork for a robust database.
With the data in place, the second version introduced an HTML page to display the collection. Initially, the layout was basic—a long, unorganized table.
Improvements:
Challenges:
.card img {
width: 100%;
height: auto;
object-fit: cover;
}
As the collection grew, navigating it became cumbersome. This led to the introduction of filters (e.g., by genre or rating) and sorting options.
JavaScript for Dynamic Filters:
function filterList() {
const genre = document.getElementById('genre-filter').value;
const rows = document.querySelectorAll('#album-list tbody tr');
rows.forEach(row => {
const matchesGenre = !genre || row.cells[3].textContent === genre;
row.style.display = matchesGenre ? '' : 'none';
});
}
Key Learning: Users value intuitive filtering and sorting. Implementing these features improved both usability and performance.
Downloading, resizing, and renaming album cover images became a significant focus. I wrote a Python script to handle this automatically, ensuring consistency and optimal file sizes for mobile viewing.
Challenges Solved:
from PIL import Image
def resize_image(input_path, output_path): with Image.open(input_path) as img: img.thumbnail((300, 300)) img.save(output_path)
The final iteration consolidated all features into a single, dynamic HTML page with:
<section id="stats-filters"> <div class="stat-dropdown"> <select id="genre-filter" onchange="filterList()"> <option value="">Genres: 12</option> <option value="Rock">Rock</option> <option value="Jazz">Jazz</option> </select> </div> <div class="stat">Total Albums: 250</div> </section>
<section id="search"> <input type="text" id="search-bar" placeholder="Search..."> </section>
<table id="album-list"> <thead> <tr> <th>Image</th> <th>Artist</th> <th>Album</th> <th>Genre</th> <th>Year</th> </tr> </thead> <tbody> <tr> <td><img src="images/example.jpg" alt="Album Art"></td> <td>The Beatles</td> <td>Abbey Road</td> <td>Rock</td> <td>1969</td> </tr> </tbody> </table>
.stat {
background-color: #27374D;
color: #66FCF1;
padding: 15px;
border-radius: 10px;
text-align: center;
}
#search-bar {
width: 80%;
padding: 10px;
margin: 20px auto;
display: block;
}
This project started as a simple way to manage my CD collection and evolved into a dynamic, mobile-friendly app that showcases my technical expertise. From integrating APIs to managing a database and designing a responsive UI, every aspect of this project reflects thoughtful planning and execution. Whether for personal use or as part of a professional portfolio, this app demonstrates how iterative development and a focus on user experience can turn an idea into a polished solution.