Part 51: Understanding Strapi Version Differences & Preloaded CMS instance
[App] Headless CMS

Now that we've explored the basics of setting up our content management system (CMS), let's dive into configuring a prebuilt CMS project that we'll use to power our application. This guide will help you get started with necessary setup and provide an overview of the data available for your project.
As with any evolving technology, software updates bring new features, improvements, and sometimes changes that can affect existing projects. Strapi, a popular headless CMS, recently released version 5 on September 23rd, 2024. If you are following along with educational content or tutorials that were recorded using Strapi v4, it's important to be aware of the differences and how they might impact your learning experience.
Key Differences Between Strapi v4 and v5
While the core concepts and workflows remain consistent between versions, there are some changes in Strapi v5 that you should be aware of, particularly regarding the REST API response format.
REST API Changes
One of the most notable changes in Strapi v5 is the modification in the REST API response format. This means that if you upgrade to the latest version, the way you fetch and handle data in your frontend application, such as a Next.js project, may need adjustments.
Why Stick with Strapi v4 for the Course?
Given these changes, it's recommended to continue using the Strapi v4 project provided in your course materials. Here's why:
Consistency with Course Material: The videos and tutorials you're following are based on Strapi v4. Using the same version ensures that your experience aligns with the demonstrations, reducing potential confusion.
Avoiding Unnecessary Complexity: Upgrading to Strapi v5 would require you to modify all the fetch requests in your Next.js project. This divergence from the course content could lead to additional challenges, especially if you're new to Strapi or web development.
Access to Support: If you stick with the provided Strapi v4 setup, you'll be able to follow along with the provided code and examples. This consistency allows you to seek help and guidance more effectively, as your setup will match the reference material.
Considerations for Upgrading
If you're considering upgrading to Strapi v5 after completing the course, here are a few steps to keep in mind:
Review the Release Notes: Familiarize yourself with the changes in Strapi v5 by reading the official release notes. This will help you understand the new features and any breaking changes.
Test in a Separate Environment: Before upgrading your main project, test Strapi v5 in a separate development environment. This allows you to experiment with the new version without affecting your current setup.
Update Fetch Requests: If you decide to upgrade, be prepared to update your fetch requests and handle the new REST API response format in your Next.js project.
Seek Updated Resources: Look for updated tutorials or documentation that reflect the changes in Strapi v5. This will provide you with the necessary guidance to make the transition smoothly.
Getting Started with the Preconfigured CMS
To begin, you'll need to download a file named "next-reviews-cms.zip" from the resources section of this guide. Save this file on your computer in the same as your main project folder, but keep it as a separate application. Once downloaded, unzip the file using your file manager. This folder contains all the necessary code and data for the CMS.
Installing Dependencies
The first step in setting up your CMS is to install the required dependencies. Open a terminal window and navigate to the "next-reviews-cms" directory. Run the command npm install to install the dependencies. This process may take a minute.
Building and Starting the Application
Once the dependencies are installed, build the application by running npm run build. The CMS project comes with preconfigured collection types, so you can skip the development build and directly start the server with npm start. This command will initiate the server, which runs on port 1337 by default.
Connecting to the Server
When connecting to the server, use "localhost" in the URL, not the "::" address shown in the terminal, which indicates listening on all available interfaces. Access the server's admin page by navigating to http://localhost:1337 in your web browser.
Logging into the CMS Dashboard
Log into the CMS dashboard using the preconfigured credentials: email "[email protected]" and password "Admin123". You can select the "Remember me" option to avoid entering these details each time you log in.
Exploring the Content
In the CMS dashboard, navigate to theContent-Type Builder" section, where you'll find a preconfigured "Review" collection type. This collection includes fields like "slug", "title", "image", "body", and "subtitle", tailored to suit our website's needs. The "Content Manager" section contains 25 reviews, providing ample data for implementing features like pagination.
Each review includes an image sourced from a video game database and a detailed review body generated using AI, ensuring a realistic amount of text for display.
Accessing the API
The CMS automatically exposes content as an API. By visiting http://localhost:1337/api/reviews, you'll receive a JSON response containing all review data. You might want to use a browser extension to format the JSON for better readability, but it's not essential.
Ready to Use
With the CMS set up and filled with data, you're ready to integrate it into your Next.js application. We'll explore how to interact with this API and incorporate its data into your project in the next steps.
This setup provides a robust foundation for a dynamic application, allowing you to manage content efficiently and scale your project with ease.
Last updated