After reviewing the requirements for the new site together with the client, we quickly decided that Drupal would be the platform of choice to build upon. However, this is not just developing yet another Drupal 8 website: we are using Drupal 8 strictly for the content management part this time. For the front-end we are using Angular 2. This approach is known as “decoupling” Drupal. The front-end is no longer handled via a Drupal theme. It is completely separated, or ‘decoupled’ from the Drupal back-end. Angular uses the Drupal-managed content and presents it to the end user. The advantage: more flexibility in serving content to different types of apps. And I say ‘apps’ because we are also developing an Android and an iOS app which are both using the content that comes from the Drupal CMS.
The site’s content will be solely maintained in Drupal and is exposed to the apps via API endpoints. Angular also provides custom views in some cases which we utilize in the mobile apps. While 99% of the screens in the mobile app will be native, we will use Angular to expose individual forms such as the account signup form as a web view for mobile. This approach turns out to be particularly useful for forms that interact with 3rd party APIs. Drupal will do the API negotiations on behalf of the app that is requesting the data. In other words: API integration only needs to be done once since the incorporated form fields that Angular offers to Android or iOS are already connected to the main API.
Decoupling Drupal in order to use it solely to manage content and nothing else also allows individual developers to concentrate more on their own field of expertise. We have four individual types of resources working on this project (Drupal backend, Angular, Android and iOS) which allows them to focus on what they do best without worrying too much about the Drupal platform itself (since all interactions happen via the API). Since there is a clear separation duties there is also a clear separation of responsibilities during the development process. We use this to our advantage by testing a particular API endpoint first for one app, iron out issues if there are any, and then have the other two apps implement that particular feature.
Thus far decoupling Drupal has been a very smooth and positive experience. We are eager to release these shiny new products to the public very soon!