This slide deck describes an application that we built for a major UK media company. It uses a decoupled Drupal 8 server with an Angular app served by node.js.
2. Who ‘We’ Are
I-Next Ltd.
We work with digital, marketing and design agencies to deliver digital
projects (mainly websites) for their clients. We are deep tech specialists
and have created a managed digital platform based on Drupal 8.
Effectively, hassle-free Drupal 8 delivered as a service, backed up by an
on-demand set of expert tech resources.
3. The Right Problem
Decoupling Drupal 8 is a decision that really needs the right problem to justify it. Here’s the basic
parameters of the problem we chose for a major UK organisation working with our partners, Chester
based, Edenred:
● 22K employees choosing a corporate gift in restricted timescale from a 400 item catalogue
● Over 60% of users access in first 4 hours
● 50% of ‘orders’ placed in first 4 days
● Accesses from highly restricted IP list through corporate firewall
● SSO from corporate intranet
● Significant number of shared device users
● The client is an ISP and so has superb internal network bandwidth
● The client and our partner spend 90% of their time fussing over the gift selection, not the tech!
6. IA and API First
The key to the process of design was to spend time on the IA and from there on the API. Peak usage is
very demanding so we need to constantly consider the API calls to Drupal.
● Session management
● User data and state
● Gift selection
● Support request journalling
7. Keep It Core
One of our design goals was to use as few third party contrib modules as possible. The production system
only uses:
● RESTUI - https://www.drupal.org/project/restui
This is for convenience in setting up our REST environment.
No Commerce?
No, in the IA we decided to create/manage products as a content type and the access them via REST
views. The catalogue structure is built as a standard taxonomy, again on a REST export. Gift selections
are recorded in custom fields using REST PATCH methods.
8. Custom Modules
We only needed to create two tiny modules for the entire project. The main reason is to enable additional
logging and user communication.
Gift Reset Form: This is done via a request from the RT web GUI which only supports a GET request.
Session Log: We decided to track SSOs and needed to log some state information. A REST PATCH did not
support what we required.
Total code, including module set up, is under 500 lines.
9. Angular and Node.js Considerations
1. Minimise module requirements
a. ngRoute
b. ngCookies
c. ngAnimate
d. ngSantize
e. ndMarkdownIt
f. ngScrollBar
g. DeviceDetector
2. Base routing handled by Express
3. Application business logic creates additional layer of routing and user verification
4. Bootstrap and jQuery for UX
10. Load Balancing Considerations
Whilst there are few specific considerations in using a load balanced environment, the following were on
our list:
1. Easy git deploy from single repository onto base OS cloud server (Ubuntu 18.04)
2. Server commissioning test for farm release process
3. Non sticky sessions: Requires that node.js on server X can handle and validate a request generated
on server Y. This requires a session validation request through to Drupal. A side effect of this is
that multi-device sessions are also supported!
12. Conclusions
Drupal 8 is a superb choice for decoupled application development:
1. Highly customisable content types help in creating an elegant, minimal IA
2. Elegant and minimal IA lends itself to a tight API specification
3. Standard security models are easy to apply on a tight API
4. Core REST functionality is highly capable
5. Drupal admin functionality is intuitive
13. Contact Me
Feel free to contact me about any thing you’ve heard or seen in this presentation. We’re always looking
for new people to work with!
● John Hannawin
● john@i-next.co.uk
● Twitter: @intarsia_mdsp
● LinkedIn: https://www.linkedin.com/in/johnhannawin/
● https://www.drupal.org/u/johnhannawin