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:

Where Next?

Popular Backend topics Top

IhorYachmenov
Hello. I have an iOS app where needs a proxying website through private server(HTTP / HTTPS proxy), but its idea each time has some trou...
New
Jsdr3398
Are there any databases that require no setup (can be shipped in a small zip together with the project)?
New
GermaVinsmoke
Reading Programming Elixir 1.6 book, I’ve completed part 1 of the book. Now I’m thinking of reading Elixir in Action. What do you all sug...
New
gagan7995
API 4 Path: /user/following/ Method: GET Description: Returns the list of all names of people whom the user follows Response [ { ...
New
Fl4m3Ph03n1x
Background I am trying to find a cheap and easy way to create New Types in Elixir, and Records seem to be just what I would need. Probl...
New
MarkIden
Hi, Recommend pls your favorite learning resources in Go, with best books, podcasts etc.
/go
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...
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
sona11
I’m having a difficulty. I want to modify an attribute’s data type from String to Array. { “id”: “trn:tarb:tradingpartner:uuid:00000...
New
jaeyson
Hi! I have clarifications (please correct me, as I mostly mix/confuse this details) with the following: The term RAG here where it read...
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
PragmaticBookshelf
A PragProg Hero’s Journey with Brian P. Hogan @bphogan Have you ever worried that your only legacy will be in the form of legacy...
New
Rainer
My first contact with Erlang was about 2 years ago when I used RabbitMQ, which is written in Erlang, for my job. This made me curious and...
New
AstonJ
There’s a whole world of custom keycaps out there that I didn’t know existed! Check out all of our Keycaps threads here: https://forum....
New
AstonJ
I’ve been hearing quite a lot of comments relating to the sound of a keyboard, with one of the most desirable of these called ‘thock’, he...
New
Margaret
Hello everyone! This thread is to tell you about what authors from The Pragmatic Bookshelf are writing on Medium.
1139 25652 757
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...
New
PragmaticBookshelf
Build efficient applications that exploit the unique benefits of a pure functional language, learning from an engineer who uses Haskell t...
New
PragmaticBookshelf
Author Spotlight: Peter Ullrich @PJUllrich Data is at the core of every business, but it is useless if nobody can access and analyze ...
New
sir.laksmana_wenk
I’m able to do the “artistic” part of game-development; character designing/modeling, music, environment modeling, etc. However, I don’t...
New