
Ask HN: Should I use Wordpress to power the front end of my Rails web app? - raheemm
My webapp (a loyalty app for ecommerce) is being built in Rails. Currently the marketing site&#x2F;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.<p>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.<p>Im interested in learning what others have done with their webapp&#x27;s frontend&#x2F;marketing site?<p>1. Is it in the same platform as your backend?<p>2. Did you move it to a different platform such as wordpress? What kind of challenges did you have?<p>EDIT: Here are some reasons that my mktg partner is suggesting wordpress for frontend:<p>1. Built in blogging<p>2. PLugins for Integration with email marketing<p>3. Plugins for Integration with sales-funnel and AB testing<p>4. Plugins for social media marketing
======
deathspin
I'd put the marketing site at whatever.com and the app and app.whatever.com.

You 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.

~~~
DanHulton
Absolutely needs to be rated higher. I've done this for a few sites and it
works wonderfully, not to mention having an API exposed like this gives you
opportunities for integration with other people's services, if you choose to
go that way.

~~~
raheemm
The API exposure is a good benefit

------
whalesalad
The marketing tools you gain in WP are not worth building your product-core in
WP. Anything that you get as a WP plugin is something you could build really
easily as your own component in Rails.

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?

    
    
        rails g model Post author_id:integer title:string body:text 
    

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](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.

~~~
raheemm
_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._

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.

~~~
somesay
I'm still not sure what exactly your plan is. Just moving your
landing/marketing page or the whole ecommerce frontend?

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.

~~~
raheemm
Im looking into moving the marketing page to wordpress. The app is most
certainly not moving to wordpress. It's staying in rails.

------
davidjairala
Generally speaking, installing and having an installation of Wordpress is
pretty simple. However, my advice would be to keep things as simple as
possible, especially since it seems you guys are starting out.

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.

------
Vitaly
We actually recommend exactly this to many of our customers. Unless the
marketing homepage needs a lot of dynamic app-database driven content we
usually recommend installing wordpress on www.domain.com and rails app on
domain.com.

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.

------
gremlinsinc
I'd say go w/ wordpress as a subdomain of the main app, and use the Json
plugin to pull in data to your existing design, you can still linkout to the
blog, but the main site will be easier to design using the data from the blog.
ie. blog.yourappp.com and anywhere you want on the front page you could pull
in recent posts or comments using the json api.

That's what I use for my laravel apps.

------
bushido
There is a good amount of complexity that gets added when you try integrating
rails and wordpress, as you already mentioned.

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.

~~~
raheemm
I dont have any specific plugins. But the initial thought was that instead of
coding up integrations with rails for various 3rd party marketing stuff, lets
just use wordpress and save ourselves time.

~~~
bushido
Wordpress is definitely easy to setup and has a ton of plugins. But in my
experience when integrating it with other services/frameworks/etc. it doesn't
really save on time; it's more like the time spent will gradually creep up, to
the point that it may not have been the right choice to begin with.

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](https://github.com/andrew/split) [1]
[https://www.optimizely.com/](https://www.optimizely.com/) |
[http://visualwebsiteoptimizer.com/](http://visualwebsiteoptimizer.com/) [2]
[http://37signals.com/svn/posts/2977-behind-the-scenes-
highri...](http://37signals.com/svn/posts/2977-behind-the-scenes-highrise-
marketing-site-ab-testing-part-1) [3]
[http://37signals.com/svn/posts/2983-behind-the-scenes-ab-
tes...](http://37signals.com/svn/posts/2983-behind-the-scenes-ab-testing-
part-2-how-we-test)

~~~
raheemm
Hey, this is v. helpful! Thanks!

------
jcutrell
I'm currently working on a project that employs this concept; we use Rails for
the heavy lifting, registration, payments, etc (lots of complex stuff), and we
use Wordpress to allow our client to easily create beautiful things.

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.)

~~~
jcutrell
Note: WordPress (sp)

------
tedchs
It's important to realize that "marketing site" and "frontend" are totally
different things. If it's truly just a informational site, WP is probably
fine. But, I would not build your app's UI, or even purchase workflow, in
Wordpress and then your real "app" in Rails.

------
artellectual
I've found the best approach is to use something like middleman to build the
front end / marketing site. Good ol static pages and the rails app is isolated
from the static page. Middleman also has a blogging plugin which makes I easy
to keep it updated. Doing SEO is also straight forward since they are just
static pages

