Running the React sample app

In this guide, you'll get a brief introduction to website development practices with Kentico Kontent. We will start by running a React sample application on your machine and updating an article in the Sample Project. Then we will explore how the content of the article is structured.

New to Content as a Service?

If you are new to the world of Content as a Service (CaaS), you might want to start by building a Hello world application. It will only take you about 5 minutes!

After you grasp the core idea behind CaaS, everything in the sample application will make a lot more sense much faster.

Table of contents

    Accessing the Sample Project

    This tutorial requires access to the Sample Project that demonstrates our features and best practices. This full-featured project contains marketing content for Dancing Goat – an imaginary chain of coffee shops. This content is used in our sample applications.

    If you do not have access to the Sample Project, contact your subscription admin who can generate the project and invite you to it.

    Running the React sample app

    Before going any further, make sure you have the following:

    1. Download the app

    The source code of the sample application lives in a Github repository.

    If you are used to working with Git, you can clone the repository to your computer by typing the following into your console:

    • shell
    git clone
    git clone

    If you don't have Git installed, you can download the sample application directly as a ZIP file, extract it, and continue from there.

    2. Run and configure the app

    1. Navigate to the root folder of the application in the command line.
    2. Type npm install to install the required npm packages.
    3. Type npm start to start a development server.

    The application will open automatically in your browser at http://localhost:3000.

    First run of the sample app

    When you run the application for the first time, you will see a Configuration page. Use it to connect the app to your Sample Project in Kentico Kontent:

    1. Click Get project ID from Kentico Kontent. A new browser window will open.
    2. Sign in to your account or create a new one.
    3. From the list of your projects, select the Sample Project.
    4. Click Select project.

    The application now displays content from your Sample Project.

    Note: You can also set the project ID manually.

    Now, let's explore the Sample Project and update its content so that you can see the changes reflected in your locally running application.

    Making changes to your project

    After signing in to your Kentico Kontent account you will see your Sample Project to play around with.

    Your welcome screen is a list of all the pieces of content in your project (we call them content items).

    You can search for a content item by name or apply filters to quickly find what you are looking for:

    • In the filter panel on the left, select the Article content type to view only articles.

    Filtering content by content type

    • Click one of the articles to edit it. For example, try the Coffee processing techniques article. (Inside the running app, navigate to Articles -> Coffee processing techniques to see how the content is actually displayed.)

    Details of a published content item

    Updating a published article

    The article is currently published, meaning it's publicly accessible and, as such, cannot be updated directly.

    To edit the article:

    1. On the Details panel, click the Published workflow step.
    2. Click Create a new version. The old version stays up, while you edit the new version.
    3. Edit the text of the article or change its teaser image.

    Your changes will be saved automatically, but to make them visible in the application, you have to publish the new version of your article.

    To publish the article:

    1. On the Details panel, click the Draft workflow step.
    2. Select the Review workflow step
    3. Assign yourself as a contributor.
    4. Click Change workflow at the bottom of the side panel.
    5. On the Details panel, click the Review workflow step.
    6. Select the Publish workflow step.
    7. Click Publish at the bottom of the side panel.

    Note: You can later customize the content workflow according to your needs.

    Voila! You have successfully updated content in your Sample Project. Refresh the browser window with your application to see the changes on the website.

    Feel free to further explore the Sample Project and the sample application.

    The advantage of using Kentico Kontent lies in the freedom to define how your content is structured. Let's see an example inside the Sample Project itself.

    Exploring content structure

    The Details panel shows us that our Coffee processing techniques content item is based on the Article content type.

    1. From the app menu, choose Content models.
    2. Click the Article content type to open it.

    How the Article content type is modeled

    How content is structured in Kentico Kontent

    Content item is any piece of content in your project. It is made up of content elements, such as texts, images, files, etc.

    Each content item is based on a single Content type. A content type is a template that defines the structure of the content item – which content elements it contains, their names, restrictions, guidelines, and so on.

    You can mix and match the available content elements to define your own content types.

    Deploying the React sample app

    When using a headless CMS like Kentico Kontent to power a single page application, you don't necessarily have to write any server-side code. Because the application only requires static resources, you have many interesting deployment options available to you.

    Here, we are going to use Surge to deploy your React sample application:

    1. Navigate to the root folder of the application in the command line.
    2. Type npm install --global surge to install Surge on your computer.
    3. Type npm run build to build the application and make it production-ready.
    4. Type cd build to navigate to the build folder.
    5. Type surge to deploy your application. The first time you do this, Surge will prompt you to set up your account. Every other time it will confirm the build directory and generate a funny subdomain for your app.

    You can change the sub-domain if you like and can even use your own domain, all for free. After that, you’re done. The site is deployed and ready to be accessed on the domain specified during deployment.


    Kentico Kontent makes no assumptions about how your content is displayed. It simply delivers it via a RESTful Delivery API to any application that asks for it – be it a website, mobile appchatbot, electronic billboard, virtual voice assistant or an internet-enabled toaster.

    We deliver the content, you do whatever you want with it – using the technology of your choice.

    A traditional CMS would force you to put your content into neatly arranged boxes to fit inside a pre-defined template. The power of Kentico Kontent comes from not getting in your way. Content structure and content presentation are truly separated and you have the flexibility to define both according to the needs of your project.

    What's next?

    • Have a look at our available SDKs, sample applications, and tools for JavaScript.
    • Looking for inspiration? See what people are building with Kentico Kontent in our case studies and development blog.
    • For more information about the user interface and the content creation process, see articles in Write and collaborate.