Wordpress as the backend, Spine JS as the front
I use Wordpress alot as a CMS. Not just for simple blog projects but also for more complex projects with custom fields and such, often to achieve this I use Magic Fields.Â
I'm currently in the process of developing quite a complex single page site for my friend Magnus Deuling - he's a UX / Designer, so wants all the nice features he can cram in.
We're going to use WP to power the site, just because it's user friendly and he can easily add work to it (his work pieces are essentially title, content, loads of images and some tags) - however, I'm going to take a different approach to just skinning a WP theme as I would normally do and that's what I wanted to outline here.Â
Launched yesterday as FOWA Spine JS looks like a brilliant MVC JS framework. I've used Backbone in the past, which I have really enjoyed but I like the appeal of Spine and especially the integration with Node and it's mobile features. (I wrote a piece of the Dare tech feed)
On my usual stumbles around the internet I came across the WP JSON-API plugin from Dan Phiffer. It basically opens up WP to be used as a data layer (you can see where I'm going here yeah?) The plugin is available here;Â http://wordpress.org/extend/plugins/json-api/Â
So, my idea is to create a front end built entirely on the Spine framework (it's a SPA app after all) and use Spine's routing etc to allow deep links. Then I want to hook the model up to the Wordpress backend, exposed via the JSON-API.
This may all seem a bit odd, after all it is quite a bit of effort however I believe it has the following rewards;
All the nice Spine features are exposed (routing, processing data in the Model, Mobile etc)
The application could be distributed, serving the backend from a different server etc.Â
I don't have to spend hours getting custom AJAX functions in WP working
The CMS could be (in theory) swapped out with relative ease
One thing that the JSON-API is missing is a cache. Lots of the data that will be retrieved is pretty static, so I'm thinking of employing DB Cache Reloaded (http://wordpress.org/extend/plugins/db-cache-reloaded/) but time will tell how this goes.Â
I'll aim to write another post detailing progress here (I think it's interesting)