Why Strapi CMS is a perfect choice for headless application?

Strapi is a headless CMS application written in NodeJs. It provides a stunning CMS admin panel to create contents. Strapi is working well with REST API and GraphQL. We can use NoSQL databases or RDBMS to connect with Strapi.

In this blog I am explaining how the Strapi is a perfect choice for headless application. 

Strapi is a simple NodeJs framework. The Strapi admin panel is designed to use by anyone. So customers can straight away work with the Strapi admin panel without much effort. This would be the real problem of most of the headless CMS. But Strapi has an edge over this. I can say anyone can tie-up with Strapi within a day.

Strapi not only gives advantage to costumes but also developers can easily pick this simple framework within a week. I took only three days to cover all topics of Strapi. All functionalities are well documented on https://docs.strapi.io/

Strapi can connect to any front end frameworks. Personally I am using react framework Next.Js. I will share more details about this on another blog.

I am giving some useful tips to check why Strapi is a good choice for headless CMS

  1. Easy of use
  2. API Endpoints
  3. Content Types
  4. Components
  5. Roles and permissions
  6. Config Synchronization
  7. Content Synchronization
  8. Translation
  9. Multisite
  10. Security
  11. Performance
  12. SEO

1. Easy of use

Strapi admin panel built in emphasized to headless architecture. You can’t see anything more than that there. So customers can easily tie up with the admin panel and create contents without much training. In other words, the Strapi admin panel is simple and powerful with no doubts.

2. API Endpoints

Strapi provides all endpoints we need by default. We just need to publish endpoints from the admin panel.

Strapi has built-in support for REST and GraphQL. By default Strapi supports a wide range of queries from the end points. This will cover most of our use cases. It is also not very difficult to do customization.

3. Content Types

Strapi will deliver contents as collections. Developers coming from other backgrounds can rectify this as content types. Content types can be two types. Single type or collection type. 

Single type will deliver only one entity. This is a good choice to add common content which is needed for all pages. 

Collection types can have multiple entities. We can add fields on content type to deliver contents as per our needs. Strapi has a lot of built in field types available. We can create custom field types also if needed.

4. Components

Components are field types in Strapi. It is a collection of fields that can be used to define a portion of a website. For example, a page on your website has a section with title, image and description. We can create a component with text, image, and rich text fields. The Starpi will deliver JSON to the front end so the front end can render this content to the end user.

In general components denote a section of a website in headless architecture. Both CMS and front end should have the component implementation. CMS will add actual content through components. The front end will render it to the browser with the respective layout.

The component data should be split into different fields for ease of use.

The term component is the heart of headless website architecture concept. I will explain the importance of components in another blog.

5. Roles and Permissions

Roles and permission are one of core features of Strapi headless CMS. Based on the roles and permissions, we can decide the API visibility. For example, if we have a collection type that can add contents from a specific role, then it is possible to add create content permission to that role only. This way we can assign different collection types for different roles. It is very useful when creating a single CMS to deliver contents for multiple front end portals.

6. Configuration Synchronization

It is important to manage configurations effectively. Deploy configuration changes across all environments in an efficient manner is the big challenge of CMS applications. If multiple developers are working on the same project they should get configuration changes continuously from each other.

I can demonstrate the importance of this concept using an example. Consider developer1 is working on component1 and developer 2 is working on component2.

The components are fields which are added to the database. This can be only available on the developer local database. How can all these work together to deploy in a production environment? This time config synchronization makes sense. It is possible if we can export all configuration for each developer and push it to the git repository.

In Strapi configuration synchronization can be achieved by config-sync plugin.Please check https://www.npmjs.com/package/strapi-plugin-config-sync for more details. This plugin gives commands to import and export configurations.

7. Content synchronization

Content synchronization is the process of migrating content from one environment to another environment.
Content synchronization in Strapi can be achieved by import-export entities plugin. For more details please check https://strapi.io/blog/migrating-content-between-environments-using-import-export-entries-plugin

8. Translation

Strapi is offering an internationalization(i18n) plugin to create contents in multiple languages. So a multilingual CMS is not a big deal in Strapi. The multilingual contents can be easily delivered by API endpoints.

9. Multisite in Strapi

As we know Strapi is a headless CMS to deliver content to the front end through its APIs. Multisite means to handle different websites in a single code base. In the case of Strapi it should have a single CMS panel to deliver contents of different front end websites. The best practice is to create separate collection types and components for each website. The CMS panel can be decorated by roles and permissions so that we can assign different bundles to different stakeholders with the use of a single CMS. Strapi can do this effectively and efficiently.

10. Security

Strapi is written in Node.js. Most of the customers have concerns  about the security of Strapi. The doubts are coming from its Javascript ancestry. No doubt, It is a secure CMS that can compete with any other rivals in the market.

Strapi is mostly using postgre SQL for storing contents. Also Strapi provides token based authentication for all API endpoints. Its roles and permission can be used to give API access only for the trusted users.

So Strapi is a better CMS than others for a content driven website. Even Though I am not recommending Strapi for  websites that need to receive too much data from the end users. In this case we can use Strapi for pure content management and another interface for user data interactions.

11. Performance

Performance is an inevitable concept of any application. We can divide performance into two in case of Strapi. One is CMS panel performance and other is API performance. 

Strapi CMS panel performance depends on the way we are configuring Node.Js application. We can build Strapi applications in different ways. The better way is to use a reverse proxy approach with Nginx. This way the Strapi CMS panel can deliver better performance to the end users. Also I recommend using a caching mechanism like Redis for CMS.
Strapi API can use REST Cache plugin https://market.strapi.io/plugins/strapi-plugin-rest-cache to cache API response. This plugin can be attached with different caching providers such as Redis.

12. SEO

Search Engine Optimization is the heart of any content driven website. Without good SEO practices we can’t deliver our business goals to the public. 
Strapi is providing an SEO plugin https://market.strapi.io/plugins/@strapi-plugin-seo which can deliver all SEO contents through APIs. This will create a component in Starpi collection types that has built in fields suitable for all kinds of meta tags. We can also extend this plugin if we have more use cases.