presentatie headless drupal capgemini 2016

52
HEADLESS DRUPAL @ VRT Frederik Wouters 06/06/2016

Upload: frederik-wouters

Post on 16-Apr-2017

175 views

Category:

Internet


5 download

TRANSCRIPT

Page 1: Presentatie headless drupal capgemini 2016

HEADLESS DRUPAL @ VRT

Frederik Wouters 06/06/2016

Page 2: Presentatie headless drupal capgemini 2016

Table of contents

Who am I Customers

Projects Technologies

Headless @ vrt (from frontend to backend) Angular vs React Examples Zones - Frontpage Zones – detail Frontend data sources Frontend data sources – drupal

Recap

Page 3: Presentatie headless drupal capgemini 2016

Who am I?

Frederik Wouters 23 nov 1983 From Leuven

Page 4: Presentatie headless drupal capgemini 2016

Posterity

Page 5: Presentatie headless drupal capgemini 2016

Who am I

Page 6: Presentatie headless drupal capgemini 2016
Page 7: Presentatie headless drupal capgemini 2016

Actual action heroes

Discipline, dedication and friendship... Maar development first!

- Tom Rogie / Famous tester

Page 8: Presentatie headless drupal capgemini 2016

Customers’ Projects

Amplexor: Infrabel, Kinepolis, Base …

Wieni: tourmanager.be, Q-music

Medialaan: Joe, Q-music

VRT: stubru, mnm, radio1, radio2,

klara, campagnes

Page 9: Presentatie headless drupal capgemini 2016

Customers’ Technologies

Amplexor: D6 + solr + varnish ( + jenkins) Wieni: D7 + solr + varnish ( + jenkins) Medialaan: D7 + solr + varnish ( + jenkins) VRT: D5 –D6 – D7+ elasticsearch+ varnish ( +

jenkins) + Angular

Page 10: Presentatie headless drupal capgemini 2016

Drupal 5 in 2016

It’s not so bad but hey, It’s almost weekend (on Monday)

- Stephan Celis / previous D5 developer

Page 11: Presentatie headless drupal capgemini 2016

Headless @ VRT

Front end framework? Examples Zones - Frontpage Zones – detail Frontend data sources Frontend data sources – drupal Drupal – Json Api version Search Caching

Page 12: Presentatie headless drupal capgemini 2016

New technology - hooray

Page 13: Presentatie headless drupal capgemini 2016

The wieni situation

Wieni-X (digitaal productiehuis) Wieni + VRT = Strategic cooperation https://youtu.be/k9FhJYGtGHk Wieni.be

Page 14: Presentatie headless drupal capgemini 2016

Internal development team

Page 15: Presentatie headless drupal capgemini 2016

Angular & React

Vrt: Angular no more pageloads E.g. Radioplayer in page Heavy onetime pageload SEO (sadface)

Wieni: React Frontend/backend Nodejs SEO (happyface)

Page 16: Presentatie headless drupal capgemini 2016

VRT chose angular

Re-use of directives (html + JS) = react component

In site audioplayer (not in use yet) Hosting = static

Page 17: Presentatie headless drupal capgemini 2016

Wieni chose React

Re-use of react components SEO (server side html rendering) Node server

Page 18: Presentatie headless drupal capgemini 2016

Examples

Angular Stubru Mnm

React Klara radio1

Page 19: Presentatie headless drupal capgemini 2016

Examples = Stubru

Page 20: Presentatie headless drupal capgemini 2016

Examples - mnm

Page 21: Presentatie headless drupal capgemini 2016

Examples - klara

Page 22: Presentatie headless drupal capgemini 2016

Examples – radio1

Page 23: Presentatie headless drupal capgemini 2016

Zones - Front

Page 24: Presentatie headless drupal capgemini 2016

Examples - overview

Page 25: Presentatie headless drupal capgemini 2016

Examples – menu zone

MENU’s

Page 26: Presentatie headless drupal capgemini 2016

Examples – ndequeue zone

NodeQueues

Page 27: Presentatie headless drupal capgemini 2016

Examples – articles zone

Articles

Page 28: Presentatie headless drupal capgemini 2016

Examples – flagged zone

Flagged articles

Page 29: Presentatie headless drupal capgemini 2016

Zones - Artikel detail

Page 30: Presentatie headless drupal capgemini 2016

Artikel detail - zones

Artikel afbeelding Nodequeue (banner) Most_read (GA) Paragraphs Elastic Search

Page 31: Presentatie headless drupal capgemini 2016

mnmdetail

Artikel afbeelding Elastic Search Nodequeue (banner) Most_read (GA) Paragraphs

Page 32: Presentatie headless drupal capgemini 2016

radio1detail

Artikel afbeelding Programma

(entity_rel) Nodequeue (banner) Most_read (GA) Paragraphs Elastic Search Discus (flag)

Page 33: Presentatie headless drupal capgemini 2016

Klara detail

Artikel afbeelding Programma

(entity_rel) Nodequeue (banner) Most_read (GA) Paragraphs Elastic Search Discus (flag)

Page 34: Presentatie headless drupal capgemini 2016

Services.vrt.be Hitlijst.vrt.be

Page 35: Presentatie headless drupal capgemini 2016

Frontend data sources

Sources Drupal (backend) Services Hitlist

Drupal Articles Article_detail Paragraphs

Page 36: Presentatie headless drupal capgemini 2016

data

Page 37: Presentatie headless drupal capgemini 2016

Article detail

Page 38: Presentatie headless drupal capgemini 2016
Page 39: Presentatie headless drupal capgemini 2016

Article detail paragraphs

Page 40: Presentatie headless drupal capgemini 2016

Drupal : Json

We did not use services. Api versioning Custom json representation of every node and its fields.

(these are classes). Add different cache-control header on each path.

Would do different:no

Page 41: Presentatie headless drupal capgemini 2016

API versions

Our api is versioned.

Original Stubru : 1.1Original MNM : 1.2 Breaking changes for klara : 1.3More Breaking changes for klara: 1.4Radio 1 added to 1.4

Every new version we updated other sites to this newer version too.

It seems that 1.1 still works , we should deprecate this.

Page 42: Presentatie headless drupal capgemini 2016

Search

Module “Elasticsearch connection” and submodules

Search api Open to frontend via light bootstrap search.php

(faster).

Would do different:Use “search api”

Page 43: Presentatie headless drupal capgemini 2016

Caching

Opcode cache (APC) object caching (Memcache) Reverse proxy caching (Varnish)

Is controlled by headers. Cache-Control:public, max-age=0, s-maxage=86400

Load problems:not really

Page 44: Presentatie headless drupal capgemini 2016

Cache invalidations - events

node alterations (purge path per type) Nodequeue alterations Settings form save Deploy …

Page 45: Presentatie headless drupal capgemini 2016

Cache invalidations – sync/async

We have both sync and async invalidations Purges take time. Editors dont like waiting

E.g. On node_save Sync invalidate node detail json path Async invalidate nodequeues (this node bolongs to)

Page 46: Presentatie headless drupal capgemini 2016

Recap

Do you really want headless Are there multiple api consumers? What is the breakdown of these users (html <> json) Do you really want to re-implement drupal specifix?

Should you do headless?

Depends on what you’re doing.

Page 47: Presentatie headless drupal capgemini 2016

Headless - advantages

Outsource design + frontend website

Stay owner of your content & data structure

Implementation of new site without dataloss

Implementation of new client Develop

Page 48: Presentatie headless drupal capgemini 2016

Headless - Limitations

Slowness of new features (change in backend + frontend)

Re-usable features in backend and frontendframeworks

So much work webforms in angular Routing in angular (and coupling

with drupal) 404 handling , … Develop

Page 49: Presentatie headless drupal capgemini 2016

Thanks for listening

Mail: [email protected] Cell: +32 498 53 55 76 Linkedin

Page 50: Presentatie headless drupal capgemini 2016

Questions? - Shoot!

Page 51: Presentatie headless drupal capgemini 2016

Want to join?

Point your accountmanager to [email protected]