As more and more smart devices like IoT devices, native mobile apps, Alexa, Google Home and smartwatches become part of our everyday lives. The idea of decouple applications as a way to serve information and digital assets across platform has solidify itself as one of the best solutions. Decouple applications provide organizations the ability to easily maintain and distribute digital content from a single location usually in the form of a CMS.
Since I work regularly with Drupal applications, I decided to take a look at Drupal as a decouple solution. Some of the great features that Drupal has are:
- Free open source project
- Very reliable
- Big active community
- Scalable
- Super customizable with tons of functionality
- REST and JSON APIs out of the box.
In essence, you can get a vanilla Drupal site to turn into a decouple solution with only turning on a few core modules and setting up some basic configurations.
We will not get into the details of how that initial setup looks on this article. But the easy routes are the REST and JSONAPI core modules that ship with drupal core. Once you activate and configure one of this modules, you can start consuming data from drupal into any other platform or application.
Although this sounds great at first, the basic out of the box APIs are not great and can make things complicated when you try do simple things like using human readable URLs.
There are a lot of modules and even a distribution that try to make drupal easier to work with but most of these solutions involve a lot of configuration and complex settings. Lullabot has a great article in the complexity behind decoupling drupal.
This makes Drupal a bit of an annoyance for front end developers.
However, after looking an reading through some of the solutions and projects that try to solve this issue. I realize that one of the main issues fall on the fact that paths are store as an object with various attributes.
In order, to solve this problem I found that creating an alias within the content type would solve this problem while maintaining the project very minimal. Which in my opinion is very critical for small teams and freelancers.
By adding this simple alias string field, I can now query and load data using a more human path instead of complex and long IDs. This is probably not the best solution but it is definitely the simplest I have seen so far. As Drupal strives for simplicity, I hope the core team takes a hard look at making decouple even simpler to configure for most developers.
As always, thanks for reading and hope this helps someone explore the option of drupal as a decouple CMS.
Comments