Kurisu

Kurisu

I'm curious if I can have a feature like Elixir/Phoenix umbrella project when using Ruby On Rails

Following on an old discussion I started on Elixir Forum here, I finally made my mind to learn Ruby on Rails in addition to Elixir/Phoenix. The thread is visible only for Elixir Forum members.

One of the things that makes me going for that choice is that even if Ruby is not Elixir, the syntax seems a bit familiar to me at a quick glance. So I think my learning would be somehow fast.

But I really appreciate Elixir umbrella feature and after some googling I’m not finding anything similar for Ruby. So I would like to know if there is at least a way when working with Rails to have multiple web apps in the same project but into different folders (separated controllers, views, templates , assets) but still sharing for example some core “context modules”.

Thanks

Marked As Solved

AstonJ

AstonJ

I don’t think there is anything exactly like Umbrellas, but there are some architectural styles in Rails land that might be of interest to you, like this one:

The Modular Monolith

Here’s how we do it.

  • We don’t have an app/ directory in our Rails project. All of our code is either in gems/ or engines/.
  • Gems contain Ruby code that does not depend on Rails. We use ActiveSupport, but we do not use ActiveRecord or ActionPack. The gems are all stateless.
  • Engines contain Ruby code that does depend on Rails. Persistence happens at this layer through ActiveRecord. API and Web interfaces are exposed at this layer through ActionPack.

https://medium.com/@dan_manges/the-modular-monolith-rails-architecture-fb1023826fc4

Also Liked

cpgo

cpgo

Well, regarding file uploads you can use shrine which is really well desgined and have a thin wrapper for hanami (https://github.com/katafrakt/hanami-shrine)

For authentication there is the awesome (as any thing by jeremy evans) rodauth .
This blog post shows a bit of its capabilities.

Unfortunately I cant really point you to any admin panel.

Rails is still awesome for a quick and dirty mvp, but I have been bitten so many times by devise, or autoloading issues, or active support black magic that I prefer to have a bit slower start using something “simpler” like hanami or even go straight to sinatra/roda/hanami-router

Kurisu

Kurisu

Thanks @AstonJ !
At this moment it seems a bit complex for me but I felt the same with elixir Umbrella when started Elixir some time ago. I think once I will get more familiar with the basics I can go on the path suggested on the blog post. I just wanted to be sure there are such solutions before starting my new journey. ^^

AstonJ

AstonJ

Is there any particular reason why you want to do it?

Something I do with almost all of my Rails apps (thanks to a tip from Yehuda Katz) is to create a classes folder in my app directory and this is where all my non-Rails functionality lives - you may find this is sufficient :smiley:

Popular Backend topics Top

Kurisu
Hello, Please, let’s say I have a website with user authentication made with Elixir/Phoenix, and now want to add a forum to it (using a ...
New
joshi
Hey everybody! I’m working on the project that includes import of Oracle data to PostgreSQL. That data comes as Oracle export (expdp) fi...
New
conradwt
Hi, I’m building an application that will have support for both the web and mobile. At this time, I’m using PhxGenAuth for authenticatio...
New
JimmyCarterSon
Hello, I am working on a new application with Elixir, Dish_out. I want to see Data I follow this tutorial with Elixir Casts. However, I ...
New
MarkIden
Hi, Recommend pls your favorite learning resources in Go, with best books, podcasts etc.
/go
New
Manish_bose
Can anyone help me how to convert a long data to wide data in SQL without using hard coding? Regards Manish
New
Fl4m3Ph03n1x
Background I am a fan of dialyzer and friends (looking at Gradient) and I try to have sepcs in my code as much as I can. To this end, I a...
New
harwind
In C, how they are different? char str[] = "xyz"; // statement //and char str[4] = "xyz"; // statement The first, i...
/c
New
Fl4m3Ph03n1x
Background When trying to execute mix release on a Windows 11 machine for a Phoenix project I get the following error: * assembling mark...
New
apoorv-2204
Anyone know how to get in golang? I am from elixir background?.
New

Other popular topics Top

AstonJ
If it’s a mechanical keyboard, which switches do you have? Would you recommend it? Why? What will your next keyboard be? Pics always w...
New
DevotionGeo
I know that -t flag is used along with -i flag for getting an interactive shell. But I cannot digest what the man page for docker run com...
New
New
AstonJ
We have a thread about the keyboards we have, but what about nice keyboards we come across that we want? If you have seen any that look n...
New
AstonJ
Thanks to @foxtrottwist’s and @Tomas’s posts in this thread: Poll: Which code editor do you use? I bought Onivim! :nerd_face: https://on...
New
AstonJ
I ended up cancelling my Moonlander order as I think it’s just going to be a bit too bulky for me. I think the Planck and the Preonic (o...
New
Maartz
Hi folks, I don’t know if I saw this here but, here’s a new programming language, called Roc Reminds me a bit of Elm and thus Haskell. ...
New
PragmaticBookshelf
Author Spotlight Jamis Buck @jamis This month, we have the pleasure of spotlighting author Jamis Buck, who has written Mazes for Prog...
New
PragmaticBookshelf
Author Spotlight Mike Riley @mriley This month, we turn the spotlight on Mike Riley, author of Portable Python Projects. Mike’s book ...
New
New