Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

App for managing apps (architecture)

I know it's gonna be a very broad question and I'm pretty sure this is not anything new in todays world, but I really don't now where to start on this one.

I've started working on a rails-based service that would allow users to create, configure and manage their projects (basicaly copies of a single app with customization). The projects would be run on a subdomain with an option of connecting their own domain. (Quite similar to how SquareSpace and Wix and many other website building services handle their websites)

I want these projects to be as flexible and customizable as possible (including the visual design, some additional features etc) while maintaing ease of setup and updates for the codebase itself.

So the questions I start with:

  1. Should each project be a separate app (basicaly a copy out of the same repo) with its own configs, database, nginx and unicorn configs, etc. or should I keep all in 1 app and differenciate them with different configs and maybe databases and assets?
  2. If it's better to keep everything separated...
    1. ... what's the best setup process (provided that I have basic configuration to start with)?
    2. ... how would I be able to update them all (with bugfixes, new features, performance improvements etc.) from one place?
  3. If I keep all the projects in the same app...
    1. ... how should I manage the configuration concurency between projects?
    2. ... how do I separate the data and assets?

As always, I'd be grateful for any sufficient help I can get.

like image 646
Almaron Avatar asked Dec 08 '25 16:12

Almaron


1 Answers

I have no experience building these kind of things and maybe there is an easy solution I'm not aware of. But my answer may give you some ideas/pointers to start with.

1) It's hard to give an accurate answer but based on the high personalization criteria and the "copies of a single app" you talk about, I would go for an architecture more PAAS-like than SAAS-like. So separated apps.

2.1) You may want to consider a setting using:

  • A main rails app, with a main webserver and a main nginx conf. A wildcard domain.
  • A bunch of dynamically managed docker containers. Each container is initialized from your single app, and then personalized by the user. User is associated to its containers through the main rails app. When a container is created from the main app, the main nginx config is updated (i.e. by adding a file in sites-enabled which define a new 'server' that bind the open port of the new container, and the right 'server_name').
  • Each contained rails app ship an unique and shared rails engine. The rails engine is shipped by adding the corresponding gem in the Gemfile so it can be updated.

2.2) You update the 'shared rails engine' gem. You can then run bundle install in each containers.

People interested in these kind of setups may consider tools like dokku and deis.

like image 171
rdupz Avatar answered Dec 11 '25 12:12

rdupz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!