# Many projects, with the same framework

**URL:** <https://www.ruby-forum.com/t/many-projects-with-the-same-framework/154027>\
**Category:** Deployment\
**Created:** [November 24, 2008, 6:38pm UTC](https://www.ruby-forum.com/t/many-projects-with-the-same-framework/154027 "2008-11-24T18:38:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![captaffy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f04885/32.png) [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Post date:** [November 24, 2008, 6:38pm UTC](https://www.ruby-forum.com/t/many-projects-with-the-same-framework/154027/1 "2008-11-24T18:38:00Z")

</div>

I have many websites but much the same framework for each of them. The  
only differences being the views, the styles, the databases and  
deploy.rb.

What’s the best way to arrange things in version control e.g. svn so  
that I can maintain and deploy these projects and keep the core code  
with the little differences for each project?

Thanks

John S.

---

<div class="post-metadata">

**Author:** ![captaffy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f04885/32.png) [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Post date:** [December 12, 2008, 7:23am UTC](https://www.ruby-forum.com/t/many-projects-with-the-same-framework/154027/2 "2008-12-12T07:23:10Z")

</div>

John S. wrote:

> I have many websites but much the same framework for each of them. The  
> only differences being the views, the styles, the databases and  
> deploy.rb.
> 
> What’s the best way to arrange things in version control e.g. svn so  
> that I can maintain and deploy these projects and keep the core code  
> with the little differences for each project?

John, laying out a project in SVN or other repository will depend a lot  
on how you have structured your code, so I can’t really speak directly  
to that. Instead, let me share how I’ve solved a similar problem.

I have a framework, with vertical plugins (based on Rails Engines, more  
below) that I organize like so:

/harness/trunk  
/plugins/\<plugin\_name\>/trunk  
/sites/\<site\_name\>/trunk

Harness contains the main rails framework, but virtually no code

The plugins each contain a vertical - user management, a CMS, a blog, a  
wiki… as well as a few core plugins for shared code, libraries, etc.

The site plugins each contain the custom information for a site -  
layout, css, custom app code (models, views, etc), which because I have  
such powerful vertical plugins, contains a small amount of code, css and  
configuration

So a deployed app has the harness, the core plugins all sites use, a  
selection of plugins for that site’s features (eg a blog), and the site  
plugin for that domain to put on a coat of paint and to add any  
site-custom config and functionality.

It’s a great system, and I’m very happy with the results. The trick is  
to figure out how to build your harness such that the plugins can do all  
the work. For example, my database.yml file is empty - I configure the  
database in a custom boot script that pulls its data from my site plugin  
automagically.

Hope that helps, and DEFINITELY check out [http://rails-engines.org](http://rails-engines.org) if  
you haven’t already. Engines rule for reusable web coding.
