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

20 1388 9

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

Popular Backend topics Top

PragmaticBookshelf
Machine learning can be intimidating, with its reliance on math and algorithms that most programmers don't encounter in their regular wor...
6 2154 3
New
PragmaticBookshelf
Classroom-tested by tens of thousands of students, this new edition of the bestselling intro to programming book is for anyone who wants ...
2 1357 0
New
PragmaticBookshelf
Dig under the surface and explore Ruby’s most advanced feature: a collection of techniques and tricks known as metaprogramming. Pa...
32 1858 8
New
DevotionGeo
I know that these benchmarks might not be the exact picture of real-world scenario, but still I expect a Rust web framework performing a ...
36 6147 11
New
DevotionGeo
For me it’s the semicolon, because I stopped using a semicolon in JavaScript, two other of my favorite languages, Elixir and Go don’t hav...
49 2259 25
New
AstonJ
Consider this Erlang code: Rectangle = {rectangle, 20, 10}. {rectangle, Width, Height} = Rectangle. > Width. 20 > Height. 10 When...
6 1731 5
New
New
ManningBooks
Rust in Action introduces the Rust programming language by exploring numerous systems programming concepts and techniques. You'll be lear...
71 2005 18
New
mafinar
Hello folks! We had a pretty fun thread here around the same time last year - talking about Advent of Code problems. That also happened t...
107 2741 40
New
AstonJ
If when trying to create (or recreate) your dev db with rails db:create you are getting: PG::ConnectionBad: connection to server on soc...
3 1799 1
New

Other popular topics Top

PragmaticStudio
Let’s get real. As in really knowing—clearly and practically—what’s up with Phoenix LiveView. What is it? How does it work? What can I ...
44 2669 11
New
brentjanderson
Bought the Moonlander mechanical keyboard. Cherry Brown MX switches. Arms and wrists have been hurting enough that it’s time I did someth...
212 14605 90
New
New
AstonJ
You might be thinking we should just ask who’s not using VSCode :joy: however there are some new additions in the space that might give V...
105 4396 51
New
Exadra37
I am a Linux user since 2012, more or less, and I always use Ubuntu on my computers, and my last 2 laptops have been used Thinkpads, wher...
64 2908 29
New
AstonJ
Biggest jackpot ever apparently! :upside_down_face: I don’t (usually) gamble/play the lottery, but working on a program to predict the...
19 2824 11
New
DevotionGeo
I have always used antique keyboards like Cherry MX 1800 or Cherry MX 8100 and almost always have modified the switches in some way, like...
27 2373 10
New
PragmaticBookshelf
Author Spotlight: Bruce Tate @redrapids Programming languages always emerge out of need, and if that’s not always true, they’re defin...
54 4265 23
New
PragmaticBookshelf
A Ruby-Centric Chat with Noel Rappin @noelrappin Once you start noodling around with Ruby you quickly figure out, as Noel Rappi...
41 2554 20
New
CommunityNews
Will Swifties’ war on AI fakes spark a deepfake porn reckoning?
0 5637 0
New