[edit] To my mind, the biggest hurdle wouldn't be networking to allow this box to host its own app that was accessible to the user from elsewhere. The hurdles would be things like lack of "smart" reporting / facial recognition, backup power, backup connectivity, etc..But in theory, a repurposed smartphone as the platform could solve the backup power and connection issues.
The same approach could be used for cameras - see for example Home Assistant's remote access. Sure, you'd still need a cloud-based STUN-like discovery service, but a small one-time fee should easily cover operating it.