How to I create multiple versions of one rails 6 app?

149 Views Asked by At

I've built a Rails 6 app that I want to a) keep improving b) use for multiple different projects.

I've tried to work out how to do this. One way seems the Engine route - eventually maybe I will go this route, but it seems like there is a lot to do and I want to start launching multiple projects now.

The only other thing I could think of is to have a separate git branch of each project, and perhaps use updates to the master to flow through to the other branches and the projects, but although I can't find anything that says "don' do that" I have a feeling it's because no-one imagined someone would even think of trying!

Are there any shortcuts to this? I'm maintaining everything myself (the projects the app) and I just want to use what I've build in multiple ways whilst I carry on improving it!

2

There are 2 best solutions below

5
On BEST ANSWER

You can create a base git repo and then fork it into multiple repositories. While this might save you some time at the present it may cost you time in the long run as you have to merge changes from the base application into the forks (and vice versa) and handle resolving conflicts in each fork.

In the long run using engines to share common features together with application templates in the way to go. With engines updating the "base" functionality of the apps can just be done by bumping the version in the gemfile.

0
On

Like you said you can use a different git branch or you can use feature toggle pattern. Refer this link https://rubygarage.org/blog/separating-features-in-a-multi-tenant-saas-app.