This is a basic repo that uses NodeJS to set up a basic Raspi bluetooth speaker controller. Simply install Raspbian and then clone this repo down. Requires a few dependencies that you can determine by digging through source. This was just a personal project that I've moved on from, but it's pretty far along, so feel free to fork and modify. I think BlueAlsa might be the only non-default dependency but do verify that if you intend to use it!
Side note: I personally used a digital audio amplifier and connected the Raspi to it using the GPIO pins rather than analog out, but this should work on an Analog Pi setup too.