WTF is Strapi, why is it awesome?

Louis Knight-Webb
4 min readJun 30, 2018

--

Ten years ago, i’m sure somebody wrote an article titled ‘WTF is Wordpress, why is it awesome?’. And to be fair, it was pretty awesome at the time.

But then Node happened, and React happened, and then people were talking about ways to mix Wordpress and React, and then all the drama around whether React was open source enough happened, and now Wordpress has an official API.

Tractor run, Broughshane (2) cc-by-sa/2.0 — © Albert Bridgegeograph.org.uk/p/1485256

Using Wordpress solely as an API is like using tractor to commute to work…

…you can do it, and it will get the job done slowly, and reliably — but should you?

Without slamming Wordpress too much (It’s still the go to for many of the sites we build), my rationale can be explained in fairly simple terms — Without pretty extensive customisations to Wordpress core, each API request to a Wordpress site is still loading the templating engine and registering every plugin. Both of these features are largely redundant to developers consuming Wordpress as an API. And beyond that, anyone consuming an API is probably fairly technical and comfortable writing a bit of code to get things working, and can consider the other options out there.

Generally I don’t like to complain about things unless I have a solution. I’m a full stack guy — into the team that speaks one language. The majority of projects in our pipeline right now are using React and React Native, and so naturally i’ve been on the hunt for the ultimate headless CMS for quite some time. My dream spec looks something like:

  • Open Source
  • Built with Javascript (Because full stack)
  • Speaks SQL (MongoDB / NoSQL DBs are great with the right configuration, but out of the box Postgres is my all time favourite)
  • Good community, lots of stars, not too many issues
  • Extra points for anything that speaks GraphQL

Enter Strapi

Earlier this year, after yet another hour spent googling ‘headless CMS javascript’ I came across Strapi. The project has a very clear proposition —As an admin you define your application’s models (Content Types) visually or using the CLI, and Strapi will automatically update the database schema and flat file models to reflect the new structure. Content can then be created and manipulated from the admin panel.

Strapi’s out of the box Content Type builder

Consuming the API was available through REST and the project is built upon two great frameworks: BookshelfJS (If you’re using a SQL database) and Koa (Built by the team behind Express.JS).

ES6(ESSexy)

Creating a new Content Type automatically creates logic to handle CRUD operations, including filtering and permissions. Basic CRUD operations must make up at least 50% of the code we write, and the other 50% is easily implemented by extending Strapi.

The way I see it, the alternative is starting a project from scratch with Express.JS or Koa — So anything Strapi can give the team is just extra. Why wouldn’t you use it!

Make no mistake, Strapi is very much in alpha. However the team behind Strapi have been incredibly quick to respond to developer feedback and roll out new functionality. The last few months alone have seen the introduction of a partial GraphQL implementation, file uploading and extended support for SQL databases (Strapi supports and recommends using MongoDB).

It’s fast, easily extendable, and fits entirely with the philosophy that developers should be able to focus on the important things. With Strapi you can truly build an app a day.

Try it out here!

On a side note — this is my first attempt at writing an article for the Vitamin D blog. In a nutshell, Vitamin D is a development heavy offshoot of Vitamin London. We’re based in Kiev, Ukraine and spend a huge amount of our time working on React and CMS heavy websites. We live and breathe things like Strapi.

This space on Medium is an opportunity to tell the story of our cracking development team; what we’re working on, opinions on the state of technology and regular updates when we find cool stuff. If this is your world too — feel free to hit the ‘follow’ button to join us on our adventures.

--

--