The best starting point would be the
svag-mini repository, that implements all of what you want above. Because I built that on the ESP32 BLE stack it doesn't contain any of the PIN generation code because I found that wasn't required.
I'd like to publish the app but I decided to wait as Stark did reach out a bit ago and confirmed they are working towards improving the security of the app/vcu connection. That's a great sign and I'm glad to see they care about this stuff, but I'd rather wait for those changes (which admittedly might be on the Stark timeline of taking quite a while...), since its not clear to me whether they will be changing the underlying PIN-generation. If they don't change that, I'd rather not have it published on GitHub so I'll have to sort something else out for open-source. If they do end up changing that, or perhaps improving things to the point where Svag can't function anymore, I'd happily push stuff for reference, although obviously its a lot less useful then.