architecture – How to create lots of web projects that are copies of each other (90%) but also have some unique elements (10%) in each? And that also support updates


I have a web project in. Say, it’s in Rails, or any other well web framework. And I plan to be creating copies of it and running them all. Let’s say, it’s a blog. Each blog will be deployed on its own domain and they basically, 90%, will be identical. And around 10% will be unique, custom on each blog.

Whenever I update the code of ‘Blog1’ locally, I’ll push an update to git, then I’ll log in to the servers of other blogs and do “git pull” to retrieve an update, and rebuild them. An update won’t overwrite the 10% of custom stuff of each blog.

Custom stuff will include: js, css, images files, some parts of the pages, names, texts, etc…

(1) How will I organise all that? The amount of js, css, images, etc can very on each blog, therefore I can’t simply add “custom_style.css” to .gitignore

Saving css, js, image in a database isn’t an option, because retrieving them on each request will cost too much.

Or perhaps, do it somehow statically and only once at booting a blog, when they’ll be retrieved from Sqlite3.

(2) And how would I go about rendering unique parts of html pages? Such as footers, top nav bars. They may or may not, or may be partially different.

(3) All the code itself will identical, at this point, probably. Otherwise, how would I go about code as well? Namely, some blogs would have peaces or whole files of code unique to them. Something similar to plug-in system, I figure.

P.S. I’m aware of tenant architecture, that’s not completely it.