Suggestion for new app architecture

I am planning a new app which will have web app and desktop desktop counterpart using electron. This would be my first production phoenix project and also first electron project. I would love some suggestion from experience people who has worked with this or similar stacks. Below is my planned tech stack, if possible please share your experience, best practices and tech advice.

  • API written in phoenix framework
  • Authentication using Guardian
  • Web app build with angular 6
  • Electron app with angular 6
  • Webpack for asset management
  • No channels for now but will implement it later for fast search.

I’ll need some advice on

  • How to manage frontend angular assets for phoenix and electron. Its one of my main concern. Duplication can turn into nightmare.
  • API versioning to so I can deploy web app daily while update desktop app less frequently.
  • Website will have some public content part that should be visible to public, search engines and fast to load. I am not sure angular is best fit for such content. If I separate it out as plain html, it would create duplication. Server side rendering is possible with phoenix? If possible how’s your experience with it? I haven’t worked with anything beyond angularjs 1.2 and new version has changed a lot.
  • How do you deploy phoenix? I have a build server on linode 1 GB instance and its super slow. Takes around 20-25 min to build release.

Any suggestions are welcome…

It seems You have already choosen your stack, but let me give You my 2 kopecks…

  • You can use Absinthe/GraphQL as API
  • You can use Phoenix Token instead of Guardian
  • Definitively use channels, there is good js support

But as always… it depends on situation :slight_smile:

PS: I build release on a Linux box, similar to the one I deploy too, and just transfer the tar file.

3 Likes

I haven’t decided on stack yet, still open to suggestion. I’ll look into GraphQL as api. I chose guardians because there’s not much boilerplate required for it.

Building locally is not an option for me, upload connection is not fast and reliability is not that great. Releases goes around 30 MB which takes multiple minutes and sometime connection breaks. So I chose remote build server.

There is no boilerplate with Phoenix Token, You might find this post from @michalmuskala useful

http://cryto.net/~joepie91/blog/2016/06/13/stop-using-jwt-for-sessions/

Most of it (the ERTS runtime) is the same every time. Expand locally and rsync up (with z flag), you’ll be moving very little data.

1 Like

There not even need to expand something. Distillery can skip the compressing step and just update the plain files in the release folder.

1 Like