teatimes

teatimes

Run natively/local

I have the last years worked on an application written mainly in Elixir and Phoenix, and recently added Elm frontend. Because of the sensitivity of the data (a users bank transactions and financial information), and because it would be nice to not have to think about server costs until I might have customers on it, I have tried to find an easy way to run it locally/native for now, also for users that are non-technical.

I develope it on Manjaro, so there I could use a simple script to install everything, start the backend and then open an electron window by using nativefier. The problem is mainly on windows, both in making a package with what I need and make it all run.

I tried building it with distillery and run it in foreground on windows, but I only got error messages. I think it can have something to do with having Erlang 21 and Elixir 1.18 with Erlang 20 as opt on Windows, while I have Elixir 1.18 with Erlang 21 as opt on Manjaro. But I did not figure out how to upgrade the opt Erlang on Windows.

I know this is not the “right way” to use an Elixir/Phoenix application, but I would assume there is a way to make it work, at least for now so that I can test it on people without thinking about server costs or security.

Does anybody have any tips how I can make it run locally/native on Windows?

Most Liked

NobbZ

NobbZ

Docker is probably not a solution for the non-tech people. Especially docker for windows.

12433412

12433412

Just a few things to consider (sorry for not answering your question):

  • thick client requires maintenance on machines that are out of your control
  • thick client is a pain to upgrade (you have to keep at least some backwards compatibility)
  • server cost is a temporary problem that will go away, the decisions stay
  • webapps are precisely the thing for non-technical users due to lack of installation and configuration on user side
  • you need to transmit the sensitive information to the server either way regardless if they come from a native app or browser
  • you are likely to keep the web interface as well having two products to maintain in the end
xlphs

xlphs

I use exrm to release as Windows Service, I have tried distillery, it doesn’t work. After release, strip your beam files of debug symbols, and edit the bat script as necessary, eg add new firewall rule to open up ports. I use InnoSetup to ship the entire release (elixir server plus a local GUI app), which also takes care of calling the install/uninstall script.

A small problem with this is starting up the database, for now I’m using sqlite so the entire service is standalone. But I think there’s a way to configure windows service dependency so you ask postgresql/etc to start first, or just have the service do delayed startup.

Last Post!

teatimes

teatimes

I have wrapped the frontend in Electron trough nativelify, but the problem is the backend. But I will take a look at the thread!

Where Next?

Popular in Questions Top

jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New

Other popular topics Top

nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New

We're in Beta

About us Mission Statement