Release Day: Decoupled Drupal

Image
Decoupled Drupal

Today we released a new series, Decoupled Drupal. This series walks through the basic considerations and planning that goes into deciding whether or not a decoupled approach is right for you.

Assuming you've decided to decouple, we'll then talk about what considerations should go into building your API. We'll also cover what exactly we mean when we say REST. Having undertaken the work of designing our API, we'll dig into the API Blueprint specification to see how easy it is to document and test our API.

We will then take a look at multiple options for creating this Drupal-powered API. We'll write some custom code, as well as the Views Datasource and Services modules. The next lesson covers the RESTful module, my preferred method of exposing data in Drupal 7. With Drupal 8's recent release, we'll also take a look at the REST server included in core.

Having built an API for our sample application, we'll turn our attention to working on a simple decoupled front-end. Using backbone.js and a Javascript Twig implementation (twig.js) we'll set up the basic structure of a single page application (SPA). We'll replace the static HTML files from our example application with dynamic templates, pulling data from our Drupal API. Since we're not able to rely on a Drupal theme, we'll then work on creating a pager and simple archive page for our blog.

With a client side single page application mostly functional, we'll take a look at the SEO implications of this approach. Using Node.js (specifically the Express.js package) we can write a server to render our templates before they're sent to the client's browser. Using this approach, we can send HTML and Javascript to the client, and then rely on our single page application behavior after the initial page load.

Introducing this Node.js server impacts how you go about hosting your site. The final tutorial in this series takes a look at some of those implications and considerations.

Tutorials in this series

While this series takes a look at what it takes to get started decoupling your Drupal site, using Backbone.js and a Javascript implementation of the Twig templating system, we hope to add additional tutorials to cover other Javascript frameworks (perhaps Angular.js, Ember.js or React) in more detail. If there are particular topics you'd like to hear about, drop a note in our suggestion box.

Our next series, coming out in December, will take a look at the Configuration Management System in Drupal 8. We're also hard at work on a comprehensive series about Theming in Drupal 8.

Add new comment

Filtered HTML

  • Web page addresses and email addresses turn into links automatically.
  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <code class> <ul type> <ol start type> <li> <dl> <dt> <dd><h3 id> <p>
  • Lines and paragraphs break automatically.

About us

Drupalize.Me is the best resource for learning Drupal online. We have an extensive library covering multiple versions of Drupal and we are the most accurate and up-to-date Drupal resource. Learn more