MagMutual.com: On the JAMStack with Gatsby and Drupal 8

A presentation at DrupalCon Global 2020 in July 2020 in by Ben Robertson

Slide 1

Slide 1

MagMutual On the JAMStack with Gatsby and Drupal 8 July 16, 2020

Slide 2

Slide 2

Today’s Team Ben Robertson Customer Success Gatsby Bob Kepford Director of Development Mediacurrent

Slide 3

Slide 3

Mediacurrent: Open Source Expansion Partner

Slide 4

Slide 4

Who We Are We are drupal pioneers, digital strategy experts, open source advocates, researchers, designers, and innovators who solve technology challenges .

Slide 5

Slide 5

Our Mission To bring together the most talented team members to improve technology for our clients

Slide 6

Slide 6

The way to build the web for everyone

Slide 7

Slide 7

Our Mission To create a better web for everyone, where security, performance, accessibility, and modern tooling are defaults, not afterthoughts.

Slide 8

Slide 8

Decoupled architectures can be a great approach for sites that require functionality beyond what Drupal normally supports. When you decouple, you have the opportunity to choose the best tool for individual technical requirements. This session will be an inside look at our decoupled approach for MagMutual.com: combining open-source frameworks like Gatsby, Drupal 8, and Serverless, as well as third-party services for user management, a learning management system, and private APIs to build a robust custom platform. |8

Slide 9

Slide 9

This Session is For Developers Developers interested in decoupled Drupal, static sites, & the JAM Stack. Marketer Marketers looking for more flexibility in UX and branding. Separating their vision for the web from the CMS lifecycle IT Professional IT pros interested in building flexible resilient systems that give their teams security and flexibility |9

Slide 10

Slide 10

Learning Objectives Objective 1 Objective 2 Objective 3 Breaking complex problems into smaller more discrete components Drupal 8 as your content hub using JSON API and search API with Elasticsearch GatsbyJS with authentication, search, and a mix of static and dynamic content | 10

Slide 11

Slide 11

MagMutual For nearly four decades, MagMutual has been a leading provider of medical professional liability insurance. | 11

Slide 12

Slide 12

MagMutual MagMutual Over 30,000 physicians and healthcare organizations rely on MagMutual.com for learning resources, products, and services covering all aspects of healthcare liability | 12

Slide 13

Slide 13

| 13

Slide 14

Slide 14

We Listened to Their Needs ● ● ● ● Rebrand Future proof Improve UX for policyholders Speed gains for authenticated and anon users | 14

Slide 15

Slide 15

We Listened to Their Needs ● ● ● ● Single source of truth for user data Online learning integration Progressive learning tracks Maintainable and reliable SSO | 15

Slide 16

Slide 16

MagMutual The Challenge ● Complex Drupal 7 codebase ● Technical debt ● Extensive business logic ● AJAX (Asynchronous JavaScript And XML) based UX ● Data sync between Drupal other systems ● Difficult to understand code base ● Brittle and error prone custom D7 modules ● Drupal as authentication provider The Solution ● Reviewing Architecture ● Volatility based decomposition ● Separation of concerns ● Using the right tools for each component of the system Drupal & Gatsby | 16

Slide 17

Slide 17

Legacy Architecture CMS / Drupal User Data / Drupal Website / Drupal Search / Apache Solr Business Logic / Drupal Integrations / Drupal IAM (Identity and Access Management) / Drupal SimpleSAML | 17

Slide 18

Slide 18

The Components CMS User Data Website Search Business Logic Integrations IAM (Identity and Access Management) | 18

Slide 19

Slide 19

New Architecture CMS / Drupal Website / Gatsby User Data / Apollo GraphQL AWS Deployment / Serverless Search / Elasticsearch Business Logic, Integrations / Lambda IAM (Identity and Access Management) / Auth0 | 19

Slide 20

Slide 20

Before After | 20

Slide 21

Slide 21

| 21

Slide 22

Slide 22

| 22

Slide 23

Slide 23

| 23

Slide 24

Slide 24

| 24

Slide 25

Slide 25

| 25

Slide 26

Slide 26

Insert account dashboard screenshot here | 26

Slide 27

Slide 27

Website: Gatsby Why Gatsby? ● ● ● ● ● Speed + performance was a big concern on the old site Security Open Source advantage Developer efficiency The content mesh! | 27

Slide 28

Slide 28

CMS: A Boring Drupal 8 site Drupal 8 is full featured ● ● ● ● ● JSON API JSON API Extras Build Hooks (Netlify) Search API Paragraphs | 28

Slide 29

Slide 29

Rain Admin Wins ● ● ● Improved editor UX Paragraph previews Clean look | 29

Slide 30

Slide 30

Rain Admin | 30

Slide 31

Slide 31

Authentication: Auth0 Features ● ● ● ● ● SSO Universal login Integrations Protocols Extensibility | 31

Slide 32

Slide 32

Server-Side Logic: AWS Lambda Use cases ● ● ● ● Form handlers Creating users in Auth0 API Access callbacks Launching third party services | 32

Slide 33

Slide 33

Apollo GraphQL Features ● ● ● ● ● Abstract REST API’s away from the front end Unify your APIs Normalize data with schemas Adapt to changing needs Built in documentation | 33

Slide 34

Slide 34

Search: Elasticsearch Features & Integrations ● ● ● ● Drupal Elasticsearch AWS Connector AWS Elasticsearch AWS Lambda rate limiting Gatsby SearchKit plugin | 34

Slide 35

Slide 35

Serverless Framework Features ● ● ● ● ● ● Deployment Mocking Testing Logging Local development Project structure | 35

Slide 36

Slide 36

Living with it - Support

Slide 37

Slide 37

Living with it - Support The Cons ● More things to support ● More to know ● Harder to debug integration points ● Onboarding The Pros ● Less bugs ● Focus on new features ● Drupal and Gatsby are simple to maintain ● Apollo GraphQL is a huge win ● Improved performance ● Less time to market with new features ● Added another authentication provider with little effort ● Adding new design assets is faster and easier | 37

Slide 38

Slide 38

Questions Does something resonate with you today? Get in touch with us. mediacurrent.com/contact-us mediacurrent.com/resources

Slide 39

Slide 39

Your Feedback is Valuable! | 39

Slide 40

Slide 40

Thank you! Mediacurrent.com Mediacurrent @Mediacurrent @Mediacurrent @Mediacurrent MediacurrentDrupal