Greater_Good

Greater_Good

Using plugins from Rails and other frameworks with Elixir/Phoenix for auth, forums etc

I run a nonprofit organization that is using Rails. We’re about to create a collection of new inter-related websites to improve human rights, free modern-day slaves, and help people in extreme poverty who lack food, clean water and basics. We’re considering using Elixir (possibly with Phoenix). Our main hesitation is that it doesn’t have key plugins or libraries we need that would be too expensive to build on our own. An important one is with the large number of inter-related websites, we need users to have SSO to be automatically logged in when they arrive at our other websites. We also want to let people choose between signing up with FB, Twitter, Google or by creating an account without using a social media account.

Someone suggested we do the majority of the development in Elixir, but use the Rails CAS plugin/server to meet our auth needs. I.e. when users log in, we ping the SSO server to verify them, then the rest of their activity interacts with Elixir, and when they go to another website, it recognizes them. How easy is that to set up, and what are common problems/weaknesses to that approach, and how roughly how time-consuming are they to overcome? I read 99% of the thread on Elixir/Phoenix auth, and didn’t see anything that answered these questions.

Likewise, we’d probably use a forums plugin from another framework. I was told PHP has the best full-featured open-source forums plugins. Does each additional language/framework we add to our system create significant problems/risks or is it mild? Right now we only have Rails (plus of course front end things like html or javascript), so I have no knowledge of how easy or hard/costly it is to have multiple languages/frameworks in the same system. E.g. cost of building, cost of maintaining, risks, etc.

I’m not a developer, but I’ve run this nonprofit for 12 years and I’ve done a lot of the UX design and user specs for our past websites, so I understand many of the basics of web dev, though not a lot of highly technical details. I think this likely is a useful topic for potential users of Elixir to hear about because the only real weakness I consistently hear people mention about Elixir is the lack of libraries and plugins. So people having more knowledge about the feasibility of mixing Elixir with plugins from other frameworks, and information about how to mix them, would likely increase adoption of Elixir.

Most Liked

JEG2

JEG2

Author of Designing Elixir Systems with OTP

One of the challenges is maintaining different deployment setups. It’s common deploy each language and framework a little differently, so expect some ops overhead.

hubertlepicki

hubertlepicki

Using a central CAS server seems like good idea for your use case. The pros are thay you will be able not only integrate logins for multiple Rails apps, but you can mix and match different solutions this way (PHP, Elixir, Java…).

I would recommend you not making a big decision to jump onto Elixir with everything you do just yet. When you have stand alone, fairly simple use case - give it a shot. See how your programmers deal with the task, let them learn the new stack. Maybe some API or a service first, and only when they are flient and confident do bigger apps.

This is actuallu advice that I would apply to any new tech stack. Try it in limited fashion before making big decisions on switching whole stack.

It seems you need a central SSO solution anyway, so implementing it may be good wether you decide to stay on Rails stack or move on.

Greater_Good

Greater_Good

Thanks. For context, we haven’t needed much web development the last months, so we currently only have one part-time Rails dev doing a few hours a week on small features. We’re going to hire either 1-2 full-time developers or hire an agency to build the new collection of websites.

We don’t plan to switch our main existing website to Elixir. It has a sizable backend content management system we developed with Rails for publishing daily news related to making the world a better place. It isn’t going to be part of the new collection of websites so we don’t need to integrate with it.

Besides authentification, does the Ruby CAS do other things to make it easier to integrate plugins from other frameworks with elixir?

Also, given that two of the benefits of Elixir are 1) being able to do hot-swapping when deploying new code to production; 2) when one thing in Elixir goes down, it doesn’t cause multiple things to crash.

When things such as RubyCAS or PHP forums are added to a mostly elixir system, are either of those benefits either lost or reduced? For example in the future, when our new versions of our Elixir codebase are deployed, can hot swapping still easily occur when some parts of our system that interact with our Elixir codebase are PHP (forums plugin) or Rails (e.g. CAS)?

Where Next?

Popular in Questions Top

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
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lists...
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
beno
I will often find my self writing things similar to: case some_value do nil -> something() "" -> something() _ -> somethi...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
shahryarjb
Hello, I get Persian date from my client and convert it to normal calendar like this: def jalali_string_to_miladi_english_number(persi...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: The documentation above suggests that while ...
New
svb
Hi! Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New

Other popular topics Top

Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
boundedvariable
I am going through the kafka architecture. All the features what the kafka is providing are already in Erlang. I would like hear your opi...
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New
AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement