Strapi v3.6

The course was recorded when the latest Strapi version was 3.6. In the next lecture you'll find a downloadable ZIP file containing a Strapi project that already includes some data. I strongly recommend you stick to the Strapi version provided. If you try upgrading it you'll find that some things don't work as shown in the videos and it will be difficult for you to follow along.

Strapi v4

Strapi v4 was released some time after the course was recorded. Conceptually, v3 and v4 work in the same way. However there are some differences e.g. in the JSON responses returned by the Strapi API.

The differences are small enough that it's not worth re-recording all the videos. But, for the Next Shop example, it's not possible to simply upgrade Strapi without also changing the code in the Next.js app that makes calls to the Strapi API.

That's why I recommend sticking to Strapi v3.6 while following the course. If you then want to use Strapi for your own projects, it should be simple enough to adapt what you learned for v4.0.

What's different exactly?

In the previous video we saw that with Strapi v3.6 we can fetch the data for a Product by requesting

GET http://localhost:1337/products/1

and we get the following JSON response

{
  "id": 1,
  "title": "First Product",
  "description": "This is the first product",
  "price": 10,
  // ...
}

With Strapi 4.0, the same request must be made to the /api path

GET http://localhost:1337/api/products/1

and will return a slightly different JSON object, with a data property where the id is separate from the other fields (called attributes):

{
  "data": {
    "id": 1,
    "attributes": {
      "title": "First Product",
      "description": "This is the first product",
      "price": 10,
      // ...
    }
  }
}

Therefore, any code that makes requests to the Strapi API needs to be adjusted accordingly.