You could split the ui and backend code using fast api and sqlalchemy. so you later could change the ui endpoint to point to your nas hosted remote backend (using vpn), but thanks for the i spiration using a tui.
Or you could create a app user on a ssh server and this user starts this app instead of a shell on the server, like your-app@your-server.con
Textual apps powered by sqlite running on a phone sounds like a superpower for filling your phone with useful tools, thanks for sharing! Does it access a local sqlite file or are you hosting that somewhere? Either way, this is really neat.
Nice experiment. Running a Python terminal app on a phone is more practical than people expect for small tools like this. The demo looks smooth. Looking forward to the code when you release it.