Should I split the Rails application?

I have two tasks using rails:

  • To make an inventory application to help employees track inventory
  • Make a website for the company so that customers can visit and gain a little knowledge about our product.

My plan is for the inventory application for each branch of the company to have this domain:

branch1.example.com
branch2.example.com
branch3.example.com

and for a customer-oriented site, just visit www.example.com

My question is: should I make two separate applications for rails, one for an inventory application and one for a client-oriented site? Or would it be easier to manage the two as a single combined application? These two applications are unlikely to use a lot of code.

And if I had to separate my applications, how could I host both of my applications using the same domain, as shown above (using subdomains) with the hero?

Thanks!

+4
source share
1 answer

Well, in fact, not one correct answer, but, as an experience in working with rails, I would recommend one application.

If you split, there will be many times you will have to copy and paste the common code (becomes unmanageable). In addition, you will be dealing with a common database or multiple databases.

Without breaking, you can use a wildcard domain and access the current subdomain through request.subdomain to easily execute any logic that should happen in each subdomain. You will also only need to create a product model.

In short, all the requirements mentioned sound close enough to make one application the easiest.

+2
source

All Articles