Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Headless Drupal

Headless Drupal

Presentation on headless Drupal given to Drupal414 meetup in Milwaukee on August 21, 2014 and the Madison Drupal Meetup on Nov. 12, 2014.

Daniel Stout

August 21, 2014
Tweet

More Decks by Daniel Stout

Other Decks in Technology

Transcript

  1. Daniel Stout • Madison, WI • Web developer at Great

    Wolf Resorts, Inc. • https://danielstout.com • @danielrstout
  2. What is Headless Drupal? • Front-end: JavaScript application • Backend:

    Drupal as data engine • Bypasses Drupal theme layer • Uses web services to get data • Possible w/ Drupal 6 & 7, built-in capabilities with Drupal 8
  3. Benefits • Needed when using data, not just HTML •

    Allows for modern MVC JavaScript apps • Easier to maintain, easier to debug • Browser is the dev environment • Easy to deploy • Hiring for front-end? Drupal not required?
  4. Client-side explosion • Many frameworks • Too much choice? •

    # is trending downward • Consolidation around fewer frameworks
  5. Evaluating Frameworks • Community support • Organization support ◦ ex:

    AngularJS & Google • Documentation • API • Performance
  6. AngularJS • Single-page applications • Widely used • Actively developed

    • Brings the backend to the client-side ◦ Lightweight applications
  7. Spine • Great Wolf Resorts’ choice for MVC • A

    lighter-weight, opinionated Backbone • Single-page apps • Written in CoffeeScript ◦ Syntax similar to Ruby • Popular with Ruby developers • Also: Express framework with Node.js ◦ Minimal framework ◦ Unopinionated / Flexible
  8. RESTful JSON • Use web service to pull from Drupal

    • JSON returned and ingested by JavaScript • Great Wolf’s architecture: ◦ JavaScript app makes AJAX calls ◦ Room rates pulled via Aperture (Java) to Opera Web Services (OWS) ◦ Use .tpl.php only to make Views calls directly to assemble Drupal data
  9. Implement it now! • Drupal 8 ◦ Provides core REST

    module ◦ Web services built-in ◦ Views supports REST export • Drupal 7 ◦ Services module (Kyle Browning @ Acquia) https://www.drupal.org/project/services ◦ RESTWS module (entity-driven, basis for D8) https://www.drupal.org/project/restws
  10. Future & Drupal • Data needs will increase • Drupal

    8 is well positioned • Hybrid sites work • Static sites still supported • So, more data, less static