views:

523

answers:

3

I'm trying to setup Spree within my application (I'm open to using the Gem or running it in vendor mode).

I've reviewed the documentation and the wiki and I'm still a bit confused as to how it might work within my existing application. I have no problem using a separate database for Spree and customizing my application to pass data between my databases, but how does Spree run within my application?

I've seen suggestions from the Spree Mailing List about moving my existing application to run as an extension within Spree, but it doesn't seem to be optimal to convert my large application to run within/as an extension of a small part of my overall application.

Has anyone figured this out? How to run Spree within an existing Rails app?

+2  A: 

You really are probably better off running your application as an extension in Spree.

Spree is quite the large application itself, and with the way extensions are handled (separate directory trees that override core files) it would seem kind of backwards to handle this any other way.

If you needed to make any cosmetic changes to Spree (and you would have that need, of course), they would typically be handled by copying over the original file(s) to your extension and making the changes there. If you had Spree contained within your app, that whole process could become a little muddy.

Due to the separate directory tree nature of Spree extensions, it really lends itself well to having applications as extensions. I'm sure it wouldn't be that simple, but it would mostly just be a matter of dropping your app into an extension directory and running your tests, etc.

Spree is quite a large application, anyway. Even without the worry of integrating another app it can sometimes feel overwhelming. And with its relatively immature codebase, I can't imagine integration of any kind would be fun.

But anyway, there's a good chance you've already made the decision but good luck anyway!

Jay Mendoza
A: 

I'm asking the same question in fact and wondered whether just running Spree as a separate app under a sub-domain on the site is the simplest way to go even if it means copying CSS and images etc. into the Spree directory structure. My worry would be conflicts from Routes in my web app/site in particular. Did you think about this option? Did you rule it out? If so, why so? :)

gman
A: 

@gman, that's the route I'm going with. It just seemed to messy to take an existing application and try and force it into Spree as an extension.

michaeldelorenzo