Embeded phoenix instance for offline Live View support

mobile
liveview
#1

I just finished my first LiveView powered app. And I am really happy about the whole app structure and organization.

The only thing missing from LiveView is mobile app/offline support.

So I had an idea. I’m quite sure I am not the first, but I could not find any discussion of it.

What about some sort of SDK with an embedded phoenix server running on the client. I know erlang can be compiled on both iOS and android (or at least it used to work).

Basically it would be:

phoenix (server)->phoenix (client)->webview (client)

I know it is not a simple project, as it requires quite a few elements:

  • Compiling erlang and elixir for iOS and Android
  • Creating a caching DB for client data (ETS saved to file?)
  • Sync protocol and conflict resolution between the two phoenix instances

Live View wouldn’t need any changes, but views, instead of using ecto to load data, would use some library that run the code remotely, and gracefully fallback in case of the user being offline.

I have a rough idea of the architecture, and again, I know it is not a small task, but as removing JS has been so successful (for me, and I think others), I’d like to extend the idea to mobile app.

What are your thoughts? If there is some real interest, I might dedicate times to this.

3 Likes
#2

There is an Elixir/Beam to Javascript compiler that could likely be leveraged for that. Otherwise if you are making an app for installation just use the native ecosystem.