Drupal as an API: Going full Decoupled

zrpnr
asherry

Drupal is a versatile platform for managing content with robust tools for delivering content to any number of services and connected applications. While there are many options for simply exposing Drupal’s content entities, such as the jsonapi and GraphQL modules, Drupal can take on much more responsibility in the back-end while hiding this complexity from the front-end.

With a robust user management system extended with OAuth, modules like Commerce to connect to 3rd party payment services and a routing system for creating custom endpoints it can be transformed into a powerful and flexible API. When Drupal connects to other services such as a merchant account, it can do the heavy lifting of creating a user, a profile, a customer account and payment methods - all this while exposing a single endpoint to your web application.

In this session we will present a fully decoupled application from front- and back-end perspectives. We’ll share motivations behind our decision to use Drupal as an admin-only site and how leveraging its server side APIs allowed us to take full advantage of the speed and user experience of an independent web application. Collaborative planning allowed the two teams to work independently. Architecting the API connections upfront provided a common goal that could be worked toward from opposing directions.

Drupal gives you so much of what you need for a web application. It’s not limited to being an expensive way to serve JSON or simply serving content to build a static site. You’ll see how to push Drupal as an application, how to design an API so the front-end can be lightweight and un-opinionated and provide a sleek, app-like experience.

Level of knowledge:

  • Intermediate Drupal and Javascript
  • Interest in decoupled sites

 

What you will learn:

  • Example of hosting 2 applications on one service
  • Making your own endpoints to provide exactly the data your webapp needs, without needing to process it further in javascript
  • Working with Gatsby to build pages and dynamic routes
  • Displaying content to authenticated users and role-based UI changes

Program tags

apis, decoupled, javascript

Experience Level

Intermediate

Drupal Version