I did exactly that years ago on an old laptop which I used to drive our stereo. I wrote in PHP because I was interested in learning PHP at the time. Or maybe I used mod_perl. I'm no longer interested in PHP and find no need to sharpen my Perl skills these days so I would probably choose Python. There's an outside chance I might choose Java and write it as a back end for an Android and/or IOS app.
I just checked my backups and find the file is still there. It's in mod_perl. I could make it available to you if you would be interested in using it as a starting point. Looking deeper, I might have PHP and mod_perl implementations.
Here's the steps I followed IIRC (and guessing from looking at the files. It was about 12 years ago.)
- Install a web server, probably apache, and configure PHP and mod_perl. I would probably look for a lighter weight server for RPi.
- Install a database engine. I used MySQL which was popular at the time. I think I'd go with SQLite today.
- Write the code which populates the database of the music collection. (probably not a web app.)
- Write the code to put up a web page and query the database in various ways to select music to play.
- Write the code to put selections in a play list or queue of some sort.
- Write a back end that would pick music off the queue and play it. (Probably not be a web app.)
- Write a web page that would allow me to control the player (start/stop/pause/skip.)
If all you want to do is get a music player going and have no interest in developing a web page or learning all of this stuff, I would start searching 'the usual subjects' (Bitbucket, Github, etc) for something that will meet your needs.