Headless Drupal Generator - The missing tool is here

-enzo-

Headless Drupal is new term for a old idea of use Drupal as backend server for our Date, the Drupal community have been working in this implementation since Drupal 6, but then why we use a new term like Decoupled Drupal, well this term apply for the standarazation of process and tool to provide this kind of services.

Nowadays this term is gain more and more traction, specially related with Drupal 8 which has a native integration with REST in core.

Decoupled Drupal is promoted first and foremost with the term flexibility becuase now you can do all crazy stuff that are possible with hundrend of frontend tools available, but that means Drupal do less stuff and that means Drupal do less stuff and you have to resolve by yourself a lot of the basic operations provided by Drupal as CMS.

So in summary we have a powerfull tool to easy maintain our Backend with Drupal, but we have to build or the basic are boring operation of CRUD in our frontend.

Taking in count this problem I create a project named Yeoman Marionette Drupal Generator, using this tool you are able to create a Front End HTML 5 Application in 5 minutes or less integrated with Drupal 7 or 8 as Backend Server using a MVC pattern where  the M stands for Drupal Model using the project Backbone Drupal (This project works isolate,  Marionette is not required).

This project provide commands to generate the basic CRUD operations with Drupal entities or you can create your own interations with custom REST Services.

Some features available:

  • HTML5 Boilerplate
  • jQuery
  • Backbone.js
  • Backbone.Drupal
  • Backform
  • Marionette.js
  • Underscore.js
  • Twig.js
  • RequireJS
  • Bootstrap
  • Jasmine - Behavior-Driven Unit Test

After use the generation to create the HTML 5 project, I will give you an introduction and walk through of some the patterns and practices that allow you to write JavaScript Applications prepared to be scalable using the following scaffold commands.

  • Model: Generate a Backbone model, custom endpoint optional
  • Collection: Generate a Backbone Collection with custom Endpoint
  • Template: Generate a template view for a Model or Collection
  • View: Generate a MarionetteJS ItemView
  • Form: Generate a form based in Drupal Content Type (Drupal 8 Only) (Submit pending)
  • Action: Generate a Route and Controller to render a View related with a model, collection or form
  • Region: Generate a new region to render views or forms inside.
  • Settings: Command to enable overwrite application main settings

Session Track

Coding and Development

Experience Level

Intermediate

Drupal Version