Strapi is a headless content management system, it’s a piece of software used in web development that enables users to generate, update, and publish information.
When we read this definition the first thing that comes to our mind is the famous WordPress, the drag, and drop, one of the fastest framework to build a website, but here we have a different case, it’s the term “headless”.
Meaning, we have a CMS without the frontend (the head), we have only an API that provides content and it doesn’t care about displaying it, and that’s why the name is a play on the name Bootstrap API.
Here is a figure that illustrates the difference:
In order to make content accessible via a RESTful API or GraphQL API, a headless CMS is a backend-only content management system (CMS) that was created for that reason.
The idea of cutting the "head" (the frontend) of the "body" (the backend) is where the name "headless" originates. A headless CMS doesn't care how or where your data is displayed, its sole objective is to enable accessing data with an API.
Use cases of a headless CMS
Strapi was made by students, one of them the CEO Pierre Burgy, they wanted only to make some money for their studies, but one day the traditional CMS wasn’t compatible with their needs.
They wanted to build a mobile application with modern frameworks, so they decided to create an API framework, and the product that came out was Strapi.
Until 2020 Strapi wasn’t profitable, in that year the decision was to lunch an Enterprise Edition that had additional features.
A headless CMS eradicates the difficulty of starting and developing new projects quickly, for some types of websites the front-end developers have no more need for coding the backend project, getting the front project done is enough.
Here we will go through some of the main benefits and justifications for utilizing Strapi:
Strapi may be used with several database architectures. With PostgreSQL, MySQL, MongoDB, and SQLite, it is possible to set it up and configure it to function.
Strapi was created using open-source code and is based on Koa, a Node.js framework. This source code is easily accessible and extensible.
Strapi may be easily customized to meet the unique needs of each project. Through the admin panel, each data type is built from the ground up.
Furthermore, the Strapi plugin system makes it simple to add other features.
Strapi offers a REST API that can be consumed from different types of client web and mobile frameworks such as VueJS or Angular.
Strapi can also manage authorization, we can give a user access on some endpoints and not others.
It’s a framework that was prepared to cover all cases, not only that but we can also make use of OAuth to be capable to authenticate from a third party tool like Google or Github.
To scale Strapi is not a big deal, making use of Docker, Kubernetes, and a cloud provider, it’s really easy to scale our Headless CMS, and with that it can handle important traffic.
Strapi of course is not a perfect framework, it has also some cons, and here is a brief list of them:
Walmart created Hapi, which they continue to utilize. Being supported by such a large corporation ensures that it will not quickly lose support and, more significantly, that it is being created by experts so that you will always be able to obtain help for it. For Hapi, the configuration is more significant than coding; this is particularly helpful for extremely big teams.
Because Netlify CMS interacts with so many static site generators, we have the benefit of being able to develop projects that are quick, adaptable, and secure. Working with Netlify CMS has the primary benefit of storing all content and source code in the Git repository. It has also easy to use, we have a real-time preview, drag-and-drop media uploads, and rich text editing.
Prismic provides us with a very user-friendly way of processing, managing, and publishing online content. In addition, the CMS provides us with a great deal of technical flexibility, because it is well-suited to headless configurations.
Before the setup of our project, we should ensure that we have the Node.js and NPM installed in our machine, and we should be careful with the versions Node.js ≥10.x and NPM ≥6.x.
To create our project we need to start with the following command:
npx create-strapi-app@latest adservio-project
After the creation of the project, we can run it with the following command:
The terminal will redirect us to the following link: http://localhost:1337/admin/auth/register-admin
After filling in the fields we can click on “Let’s start”:
The simple setup process of Strapi and their clear guidelines, followed with the great integration possibility's, turns Strapi into a great tool for those who plan to build modern and quick APIs with the ability to update in real-time.
Remember that Strapi, with all of its fantastic features, is open source and free to use.