So, we want to rebuild part of our site as a Rails application. The initial plan was to have the main site application with several plugins (Rails 3.1 Engines) with separate functionality - a store component, a social / forums / chat component, etc. We also wanted to place themes / styling in a gem so that our web designers could change the appearance of the site and some minor layout settings without the need to “know Rails”. This originally happened well; we created the main architecture and plugins and themed gem, and all this went perfectly together; end-to-end functions, such as auth, were placed in the main “site” application and were expendable plug-in applications, which gave us a single input for the site (design requirement).
Our initial plan for the store component was to use Spree (http://spreecommerce.com/), as it included 95% plus the features we needed. Nevertheless, there is a trick - Spree is distributed as a mounted engine, but this application. This means that not only Spree is mounted inside the application (which is not a problem, this is actually the behavior we were counting on), but depends on the fact that it controls the main application . Looking into the “why” for this behavior, it seems that it depends on two main functionalities. The first piece of functionality is some optimization of the crossbar in real time, which should go into middleware; we could hack things so that our main application includes this piece of code (even if it started to confuse the functionality of the store on our entire site, confusing the story "Spree as a mounted engine" ... more about this at the moment).
More complex is the use of Spree Deface for processing and customization. Although it is “smart” (quotation note), it does make Spree integration a nightmare; or you follow the path of least resistance, and make Spree the whole store for yourself (which completely violates our story that "the store is just one part of our site and works great with the rest of the site, including auth, theming, etc. d ..), or you have to crack the hell out of Spray.
Not only that, but Spree does not correspond to the standard Rails Engine routing paradigm, where routes are isolated under the root of the kernel (if you look in the lib routes.rb file, you will see that it uses Rails.Application routes instead of engine routes). This means that we would not have www.oursite.com/store/...all_the_spree_goodness, we would need to have www.oursite.com/spree_owns_the_sites_routes ...
So, has anyone else tried this? We LOVE Spree and would like to use it as our store. But he starts to look that there is no real way to “integrate” it with the rest of our site, except, perhaps, some proxy magic with nginx or something like that (which is a separate nightmare, since we hope to post on Heroku, and then we need to figure out how to integrate several disparate applications into one database - for authorization with a single input signal - and the front HTTP router).
Spree devs, we LOVE your code, but is there any work to make it real, real Rails Engine, as opposed to a standalone application that just happens to package all its functions in engines? Without the ability to integrate it into an existing site (including without "owning" the application, having the ability to disable all of its routes, etc.), we simply cannot use it: (
TIA.