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

PragmaticBookshelf
You want increased customer satisfaction, faster development cycles, and less wasted work. Domain-driven design (DDD) and functional prog...
New
ErlangSolutions
Hi this week it’s Code Mesh V when London’s leading alternative tech conference goes virtual for the first time. Talks are set for both U...
New
New
First poster: bot
Node.js v12.20.0, v15.3.0 and v14.15.1 has been released. Link: Release 2020-11-24, Version 12.20.0 'Erbium' (LTS), @mylesborins · node...
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
First poster: OvermindDL1
Today we are happy to announce axum: An easy to use, yet powerful, web framework designed to take full advantage of the Tokio ecosystem. ...
New
PragmaticBookshelf
SQL Antipatterns is a short-cut to wisdom, showing you how to avoid "easy" solutions that don't work, and be a better database developer ...
New
sampu
I have a use case where a client is invoking a Rest endpoint via a load balancer, which in turn invokes a third party endpoint which is r...
New
ManningBooks
Spring Security in Action, Second Edition is a revised version of the bestselling original, fully updated for Spring Boot 3 and Oauth2/Op...
New
PragmaticBookshelf
Develop, deploy, and debug BEAM applications using BEAMOps: a new paradigm that focuses on scalability, fault tolerance, and owning each ...
New

Other popular topics Top

Devtalk
Hello Devtalk World! Please let us know a little about who you are and where you’re from :nerd_face:
New
wolf4earth
@AstonJ prompted me to open this topic after I mentioned in the lockdown thread how I started to do a lot more for my fitness. https://f...
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 ...
New
Exadra37
Please tell us what is your preferred monitor setup for programming(not gaming) and why you have chosen it. Does your monitor have eye p...
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
This looks like a stunning keycap set :orange_heart: A LEGENDARY KEYBOARD LIVES ON When you bought an Apple Macintosh computer in the e...
New
AstonJ
In case anyone else is wondering why Ruby 3 doesn’t show when you do asdf list-all ruby :man_facepalming: do this first: asdf plugin-upd...
New
AstonJ
Seems like a lot of people caught it - just wondered whether any of you did? As far as I know I didn’t, but it wouldn’t surprise me if I...
New
Help
I am trying to crate a game for the Nintendo switch, I wanted to use Java as I am comfortable with that programming language. Can you use...
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...
New