Embracing the modern web using Drupal as Headless CMS with GatsbyJS by Jesus Manuel Olivas / weKnow #DecoupledDays #DecoupledDays2019
$ whoami Jesus Manuel Olivas jmolivas@weknowinc.com twitter.com/jmolivas github.com/jmolivas drupal.org/u/jmolivas jmolivas.weknowinc.com
Mexicali
 Mexico + California Calexico
 California + Mexico $ ifconfig
weAre
weKnow
weGive 4,567,311
Drupal … Drupal … Drupal
When all you have is a hammer, everything looks like a nail.
Traditional Monolithic CMS
The Traditional Headless +
Challenges Performance Reliability Security Hosting
Performance Visitor Server CMS Database
Reliability - The Traditional Stack
Reliability - The Traditional Stack + Cache
Reliability - The Headless Stack
Reliability - A more advanced Stack
Security > Stack dependencies > Platform dependencies core > Custom modules dependencies > Third party libraries
Hosting > Managing a complex stack is not easy. > Requires knowledge of managing servers, databases, cache, DNS, backups, automation, and much more. > The more complex your stack is to support your production site, the more expensive it becomes.
Is there anything else we can use?
Static Site Generators
Back to the flat-files
JavaScript Any dynamic programming during the request/response cycle is handled by JavaScript, running entirely on the client. This could be any frontend framework, library, or even vanilla JavaScript. APIs All server-side processes or database actions are abstracted into reusable APIs, accessed over HTTPS with JavaScript. These can be custom-built or leverage third-party services. Markup Templated markup should be prebuilt at deploy time, usually using a site generator for content sites, or a build tool for web apps.
Visitor CDN The JAMStack Stack
Challenges • Web Forms (CRM Integration , Serverless Function, Form submission PaaS) • E-Commerce (Shopify, Salsify, PXM, Headless Commerce, Stripe, Paypal, Recurly) • Comments (Disqus, Serverless functions) • GUI (WYSIWYG for user to manage content)
Decoupling the "Content Management System" from the “Production Environment".
● Git Based / Headless CMS ● CloudCannon NetlifyCMS Forestry Blaze Sanity GraphCMS Contentful
How about the Drop?
Drupal CMS + Tome to export as Flat Files + ● Build
Gatsby is a free and open source framework based on React that helps developers build blazing fast websites and apps
The Content Mesh ● https://www.gatsbyjs.org/blog/2018-10-18-creating-compelling-content-experiences/
https://github.com/weknowinc/drupal-boina # Clone repository git clone git@github.com:weknowinc/drupal-boina.git # Copy .env file cp .env.dist .env # Start containers ahoy up # Install Composer dependencies ahoy composer install # Install Boina distribution ahoy drupal boina:install
https://github.com/weknowinc/gatsby-starter-drupal-boina # Download Starter 
 gatsby new boina https://github.com/weknowinc/gatsby-starter-drupal-boina cd boina # Copy environment file cp .env.dist .env.development # Update environment variables DRUPAL_HOST=http://drupal-boina.develop/ # Start Gatsby in development mode gatsby develop
Use theme # Download Starter 
 gatsby new boina https://github.com/weknowinc/gatsby-starter-drupal-boina cd boina # Copy environment file cp .env.dist .env.development # Update environment variables DRUPAL_HOST=http://drupal-boina.develop/ # Start Gatsby in development mode gatsby develop
Must have plugins • gatsby-source-drupal • gatsby-transformer-remark • gatsby-remark-drupal (support drupal images) • gatsby-remark-images • gatsby-remark-external-links • gatsby-plugin-sharp • gatsby-plugin-react-helmet
TUI Editor (WYSIWYG for markdown)
Build Hooks (Trigger a external build hook)
What is Gone • Twig • Render array • Theme layer • Theme preprocessing • *Views (use GraphQL instead) • Data modeling. • Content editor capabilities, revisions, moderation and scheduling. • Pathauto • Site Settings What to keep using
● Build● API / GraphQL
Feel free to turn off your Drupal after build ●https://twitter.com/ckaotik/status/647020262001614848
Live Demo
Choose the right tool for the job
Thank you … Questions? Feel free ask here and via twitter @jmolivas #DecoupledDays #DecoupledDays2019

Embracing the modern web using Drupal as Headless CMS with GatsbyJS NYC