Phoenix - possible PWA/Embedded Systems framework?

Hello guys, I recently crashed into the Elixir train and hopped onto it… I was excited to try the language since it was vaguely similar to Python(ok, closer to Ruby, but Ruby is Python with built in methods and “end” blocks) and it was really easy to implement a web app in Phoenix in comparison to Django/Flask, the dominating web dev frameworks. I’m curious about Phoenix’s direction in other areas besides web apps.

  • Can it be used for building PWAs? PWAs are just websites with sw.js file and manifest.json file, so indirectly I’m asking if Phoenix can be used for websites? If not, no worries! I will make a website-like web app with sw.js and manifest.json
  • Can it be used for embedded systems and IoT? I also enjoy embedded apps, and Elixir is good for concurrent/distributed apps, so can it be used to program a smart fridge with a chip running multi cores? I want to see how general-purpose Elixir and Phoenix is.

I also notice C++ is used in places where Elixir simply… stinks. Lots of numerical computation, gamedev, OOP and Imperative programming. Is it possible to interop C++ and Elixir, with C++ for the game, and Elixir for the game running on multi cores?

Thanks for reading this far!

2 Likes

Hello friend.

  • Can Phoenix be used to make websites? Considering it is a web framework, I’m going to say yes :wink:
  • Embedded systems you’re talking Nerves
  • C++ interop: you have NIFs and Ports or you can write your NIFs in Rust using Rustler. There is also Zigler for Zig but Rustler gets more love. Not sure on the status of otter but that’s a new approach.
  • you can tell yourself you’re doing OOP if you define objects as data and orient your program around data.
2 Likes

You cannot assume that everyone will understand what a PWA, sw.js, manifest.json are. I knew about PWAs but no idea about sw.js, that turns out to be Service Workers to support offline mode:

No, Phoenix web Framework doesn’t have support for offline use, neither for PWA’s, but to make any website eligible to be added as a mobile app on a mobile device is to add a manifest.json file to the root, and for that online tools exist:
https://app-manifest.firebaseapp.com/

Yes, a true PWA app is not just about adding the manifest file to it, a lot more needs to be done, but that’s how easy is to get started in having a website added to the home screen of a mobile device.

2 Likes

Yeah, the term PWA is too generic because it can go from a very simple website that has a shortcut, to a full fledge app with offline support.

1 Like

As a side note, PWA is related to js frontend. It’s possible to do it with Rails, Phoenix, Django because it is not backend related. Phoenix has LiveView, and LiveView is not for PWA and cannot be used offline. but it’s fine to build API with it.

The rest has already been answered…