I was thinking of a similar concept, but in the context of mobile applications. The mobile application itself would be accessible via Google Play Store/App Store, but the backend part would be self hosted and upon opening the application you would have to specify how to access backend.
My question is how would I access the backend if it was hosted on let's say rpi running in the living room? It's not a problem as long as I'm within the home network, but I want seemless network transition without losing access when entering/leaving the house. I was told https://www.cloudflare.com/en-gb/products/zero-trust/access/ could be used for this, but to me it sounds a bit of an overkill to use it for an application which would never be used by more than a single digit amount of users. This looks more suitable: https://github.com/boringproxy/boringproxy but I still don't like it due to password and not exchanged in advance key (like ssh) authentication. Ideally I would want this accessible via Wireguard which shouldn't require any additional setup given a modern router.
Maybe there are better/other options I'm not aware? Let me know your opinions/thoughts.