Ask HN: Should I use Wordpress to power the front end of my Rails web app?
My webapp (a loyalty app for ecommerce) is being built in Rails. Currently the marketing site/frontend is also built in rails. My partner who is a marketing expert, is suggesting that we move the frontend to wordpress since WP has a bunch of marketing plugins.
However, moving the frontend away from rails is going to require integrations between wordpress and the rails backend, which is creating a layer of complexity and management overhead.
Im interested in learning what others have done with their webapp's frontend/marketing site?
1. Is it in the same platform as your backend?
2. Did you move it to a different platform such as wordpress? What kind of challenges did you have?
EDIT: Here are some reasons that my mktg partner is suggesting wordpress for frontend:
1. Built in blogging
2. PLugins for Integration with email marketing
3. Plugins for Integration with sales-funnel and AB testing
4. Plugins for social media marketing
27 comments
[ 1.8 ms ] story [ 51.6 ms ] threadYou then decide what types of information needs to pass between the two systems. Instead of porting your entire frontend you simple build a few API calls and pull those in with WordPress.
For the frontend, I'd recommend either just having very thin pages in your Rails stack that are fully or at least heavily cached that then ping your API, or relying on something like Jekyll to generate static pages that then do the same.
Eventually, when the project becomes larger and/if you start feeling pain points, you can abstract this frontend layer away from the stack into its own little app. You could also make it its own little Rails or Sinatra app that just serves basically HTML (again, heavily cached, since the dynamic content will come from the backend). I keep recommending keeping it in Rails or Sinatra just so you can use some goodies like layouts, easy caching infrastructure, you're already hosting rails, the asset pipeline.
As for your marketing site, I'd go for something that's hosted elsewhere, like Tumblr if you need a blog, etc. Just try to minimize the things you need to host and support yourselves.
That's what I use for my laravel apps.
I understand the appeal of the plugins, but its usually quite easy to work around, what plugins in specific are you interested in?
i.e. Which email marketing and sales plugins are you referring to?
Social media and AB testing are easy to implement in rails or most frameworks for that matter.
What you should note is that most WP plugins that integrate with external services usually just insert code in the the views/themes. Also worth mentioning that there are a lot of features in WP that you will never use or need and a few features that you will integrate but may also need in your rails app(AB testing is the obvious one).
Like I mentioned earlier there are easy workaround's for most features that you would need:
1. Blogging -> I'd go static unless I was doing more than 8-10 posts a month. Other options include Jekyll, Octopress, Ghost or Rails/Sinatara.
2. AB Testing (You may want this for your rails app too) -> a gem[0], web apps[1] and see what other are doing[2][3].
3. Sales -> I am guessing this is mostly going to be lead generation forms and such, depending on what other services you use it is extremely simple to include these via html, js or iframes.
4. Social Media -> For users to share you could use something like www.sharethis.com there are a few alternatives too
5. Comments -> Disqus, take 30 secs to setup and install.
6. Permalinks -> Easy to do with config/routes.rb
[0] https://github.com/andrew/split [1] https://www.optimizely.com/ | http://visualwebsiteoptimizer.com/ [2] http://37signals.com/svn/posts/2977-behind-the-scenes-highri... [3] http://37signals.com/svn/posts/2983-behind-the-scenes-ab-tes...
1. built-in blogging ... everyone and their brother has built a blogging platform for Rails. WP's blogging platform is a one-size-fits-all approach which usually means you only use about 10% of what it's capable of, so having all the extra cruft is just unnecessary. You want a simple blog in Rails?
2. integration with email marketing – the plugin is only going to get you half-way there. On either platform, rails or wordpress or anything else, you still need to build the component that will take your specific business data and turn that into actionable emails. Example, email users who joined in the last 30 days who have not used our service. That is something you need to build yourself for your specific product no matter what back-end you are using.3. Sales-funnel and AB testing – Mixpanel or Google Analytics will give you the funneling. AB testing can be done with your own solution to solve your exact problems, or check out the variety of gems that help make it easy: https://www.ruby-toolbox.com/categories/A_B_Testing
4. Social media marketing ... again throwing the idea around that you can click "install plugin" and have all your bases covered here is not very realistic. What do you mean by this? Automatically tweet or post to fb based on certain events on the app? Auto tweet/post your blog posts?
Either way, I'd argue against doing anything with Wordpress other than a static blog.yourdomain.com. You can rebuild ANY feature or plugin in the WP domain very easily in Rails.
Exactly, that's a great example of why keeping everything in rails seems to make more sense.
EDIT: To clarify my app will remain in rails. Just trying to figure out whether my mktg site should be migrated away to wordpress.
WordPress is nice if you need a blog or at least a CMS for luser or if you need some framework to build on. Is that the case?
Maybe it's a useful abstraction (e.g. uptime, maintenance, development) and maybe it's good that someone without developer knowledge could work on it, but you told it would need a lot of integration work? Sounds like you should create an API then. If you need an API anyway, than this actually would be a great way to test it in a real environment. Otherwise likely unneeded effort.
To speak about WordPress plugins, please mind, that most of them are rather simple. Hook some button code and JavaScript somewhere and offer some simple configuration backend UI. Deep integration for any features the user might see often needs custom CSS work, editing the site template or even coding within the plugin. At least that's my experience with my personal requirements. Or to say it in different words: Integrating Facebook buttons isn't that hard anyway, but a professional newsletter would be a lot of work anyway. Also you could likely reuse the plugin code and transform it into Rails code.
There's plenty to be said for having a good admin UI (that non-developers can easily figure out). The flexibility and depth you get out of the box is not going to be matched by anything you can do yourself in a short amount of time.
> You can rebuild ANY feature or plugin in the WP domain very easily in Rails
This is just false - there's so many well matured products in the WP ecosystem that would take way too long to quickly develop no matter what language you're using. There's a lot of plugins built specifically in mind for a marketing / brochure type website that have had years of development that you can benefit from immediately (SEO plugins, contact forms, ecommerce..)
I'm not suggesting that WP as a frontend is the way to go, but I would not throw it out with the assumption that you will be able to rebuild it easily.
I would weight the decision entirely on how much integration will need to be done and what your marketing needs are. A couple of questions I'd ask are:
1) Is there going to be someone constantly tinkering with the site to tweak SEO as much as possible?
2) Will content be frequently updated, or will the site act more as a landing page with just occasional updates?
3) Do you ever need to authenticate a user on the marketing site? (I find cross-application authentication to be one of the harder integration problems to tackle and a good reason to not use a separate CMS system)
If it's just a landing page with only occasional updates, building it out as a simple view within your existing app framework may work just fine (or heck, just some static HTML files may fit the bill).
when user is not logged-in, domain.com redirects to www.domain.com.
this setup saves a lot of time on static pages management and adds quite a bit of marketing power.
The truth of the matter is that making a rails app that covers the flexibility that Wordpress allows (including things like Yoast's seo plugin, for instance) is just infeasible in Rails. The newest update to Wordpress is also quite beautiful.
I've been building on Rails and Wordpress for a while now, and have yet to see a full featured solution to flexible content management that equals or surpasses WP. I have yet to see something that makes data transformation and api creation as easy as rails does. (These are gross overstatements, but the point is that the two tools are very different in key ways, and can be used to complement each other if those differences are respected.)