Create a Visually Editable Next.js Website Using React Bricks, With Blog and E-commerce

Rate this content
Bookmark

- React Bricks: why we built it, what it is and how it works

- Create a free account

- Create a new project with Next.js and Tailwind

- Explore the directory structure

- Anatomy of a Brick

- Create a new Brick (Text-Image)

- Add a title and description with RichText visual editing

- Add an Image with visual editing

- Add Sidebar controls to edit props (padding and image side)

- Nesting Bricks using the Repeater component

- Create an Image gallery brick

- Publish on Netlify or Vercel

- Page Types and Custom fields

- Access Page meta values

- Internationalization

- How to reuse content across pages: Stories and Embeds

- How to create an E-commerce with Products’ data from an external database and landing pages created visually in React Bricks

- Advanced enterprise features: flexible permissions, locked structure, custom visual components

Matteo Frana
Matteo Frana
139 min
18 May, 2023

Comments

Sign in or register to post your comment.

Video Summary and Transcription

React Bricks is a CMS with visual editing based on React components that allows for visually editable content blocks called Brics. It offers flexibility for various media types and supports features like side edit props, validation, and collaboration. React Bricks also provides advanced features like data bindings, custom page types, and the ability to consume external data. It is compatible with any framework, offers enterprise-level features, and has future developments in progress.

1. Introduction to React Bricks Workshop

Short description:

Welcome to this workshop. Today we'll see how we can build a visually readable Next JS website using the React Bricks library. React Bricks is a CMS with visual editing based on React components. We created React Bricks to find a synthesis between visual editing and editing with forms. We need a headless CMS, a visual editor, a frontend library, and the freedom to choose. With React Bricks, you get all of these four products in one.

Welcome to this workshop. Today we'll see how we can build a visually readable Next JS website using the React Bricks library. I am Matteo Frana and I am the COO and lead Frontend developer at React Bricks. This will be a live coding workshop, but I suggest that you follow me and I would like that you are relaxed watching what I'm doing instead of having the stress of copying the code in a rush. I will give you the link to the repository at the end. And anyway, if you will follow me, you will understand the basics of React Bricks so well that you will be able to start from scratch without even the need to reach out for the repository. So please follow me, and we don't know how to copy the code. It's really easy. You will see that you will have a very clear method. And so I would start with just a couple of slides to give you some context on what is React Bricks. And so it's less than 10 minutes. And then we'll start coding.

So let's start with what is React Bricks? React Bricks is a CMS with visual editing based on React components. But the most important question is why? Why we created another CMS? And well, without spoiling too much of the talk that will be on June 6th, during the history of content management, we saw many times the alternating of visual editing and editing with forms. So something which is great for the developers and something which is great for content editors without finding a satisfying synthesis between the two. So when I started with the web development, it was 1996 and it was just writing HTML code, that you would send to a server BFTP. Then we had the visual tools like a front page where you could create the code visually, really the code that was created was a mess. And if you gave a front page to your customer, they could destroy the design. So we had CGI with Pearl where you could create the forms to edit content on a database and then get the content from the database to create the HTML and ESP and PHP. Which are the same things with the templating language. And then CMSs came, Joomla, WordPress, where you could edit in a visual way on a white canvas again. But we had the problem that we still could have our customers creating the red text over green background or something like that. And so we added advanced custom fields to WordPress and we were back to Ray Forms. So, and we come to today where we have these two words, we have the tools like Wix or Webflow, which are great for the editors, but they are a no-go for a corporate website because they are not flexible enough. For example, with Wix, you cannot have your pixel perfect design system. With Webflow, when your editor understand how to change things, adding margin, et cetera, they can get creative and change the design. And on the other end, we have the headless CMSs that we love, but where we are back to gray forms. Well, you saw, if you saw the next Conf, you see that also Vercel is thinking that this visual editing now is the time to find these a synthesis of a visual way of editing website, which is great also for the developers. And we'll talk about it later. But essentially this is why we created React Bricks. So essentially we need four products, a Headless CMS, a Visual Editor, a Frontend library to create our code and a product called Freedom. And now we see why.

And let's think we have a Content Editor also a CMO, a Developer, a Designer and a CTO. It seems like the start and the beginning of a joke. An Editor, Developer, Designer, and the CTO walking to a bar. But let's see what are the needs for these personas. The Editor wants to have a tool which is easy to use. It doesn't want to cope with abstract entities and relationships. We as Developer, we need something which is flexible that allows us to use the tool that we love, React frameworks and any CSS framework where we and we need the editor to be autonomous because we don't want to explain editors how to use the CMS. They need to be autonomous in using it. We want to be productive, of course, while designers want to be able to express the perfect corporate image with the design system and be sure that the editor have no way to break it. The CTO wants the team to be productive and wants to choose a solution which is flexible and future-proof. So what we need is a visual editor for the editor and a true visual editor where we have the inline editing like Word or Pages. For the flexibility, we want the coupled headless CMS and ability to use React as it happens with a headless. For readers to be autonomous, we just need a new visual editor, so it solves also the problem for us. To be productive, we need a method. So an opinionated method that helps us creating the front-end. For design system, we need blocks. We need good constraints so that the design system cannot be broken. And if we have all these things, we have a high-productive team because the editor is happy, the developer is happy, and the designer is happy too. So, a great team, great design, good code. Good code, and in the end, great content. So, to have flexibility and to have a system which is future-proof, we need the freedom. The freedom to choose today and the freedom to change ideas tomorrow about the framework for example. So we want a system which is framework-agnostic that works with SDS, with Gatsby, with Remix, that will work with Astro very soon. And we want the freedom to be able to host the website wherever we want, that is Recel, Netlify, or anything else. So, let me reorganize these things. We need a headless CMS, a visual editor. React and Blocks are just the React components. And we need a method with constraints and freedom. The headless CMS is provided by the React Brics APIs. So you have now an enterprise grade headless CMS. With the React Brics library, you have a method to create visually editable content blocks that are React components, and to set good constraints for the editors. And you get for free the freedom to choose and to change idea. So with one product with React Brics, you get all of these four products. With other solution that we are seeing today, like for example, what we saw at the VersaConf, you need a headless CMS, which is something like sanity or contentful. Then you have the visual editor, which is really not in line with visual editing like the one that you will see in a moment, and it will work on the collaboration that you have on VerCel. So you are bound to that platform. You don't have a good method to create the front end blocks, and you are bound to use next JS as a framework. So in the end, you lose some part of the freedom.

2. Creating React Brics

Short description:

React Brics is based on visually editable content blocks called Brics. It allows you to directly edit text, images, and more using visual components. The React Brics schema enables you to define side edit props that map to your component props.

So how React Brics is created? Well, everything is based on this concept of visually editable content blocks that are just react components augmented with the React Brics Library. And we call these content blocks Brics. So it's very easy. It's like using Word or Pages for some of the content you directly edit. For example, for the text, you directly click on it, edit. For images, you click and edit them. And this is enabled by the visual components of React Brics like text, rich text, image, repeater, file, et cetera. And for the props that are not directly editable like a background color, it's just like what you would do in Word. You reach out for a cyber control. And so the React Brics have a schema where you can define side edit props that are just controls that map to your component props so that you will receive these values as props of your component.

Watch more workshops on topic

Build a Headless WordPress App with Next.js and WPGraphQL
React Summit 2022React Summit 2022
173 min
Build a Headless WordPress App with Next.js and WPGraphQL
Top Content
WorkshopFree
Kellen Mace
Kellen Mace
In this workshop, you’ll learn how to build a Next.js app that uses Apollo Client to fetch data from a headless WordPress backend and use it to render the pages of your app. You’ll learn when you should consider a headless WordPress architecture, how to turn a WordPress backend into a GraphQL server, how to compose queries using the GraphiQL IDE, how to colocate GraphQL fragments with your components, and more.
Next.js 13: Data Fetching Strategies
React Day Berlin 2022React Day Berlin 2022
53 min
Next.js 13: Data Fetching Strategies
Top Content
WorkshopFree
Alice De Mauro
Alice De Mauro
- Introduction- Prerequisites for the workshop- Fetching strategies: fundamentals- Fetching strategies – hands-on: fetch API, cache (static VS dynamic), revalidate, suspense (parallel data fetching)- Test your build and serve it on Vercel- Future: Server components VS Client components- Workshop easter egg (unrelated to the topic, calling out accessibility)- Wrapping up
Building a Shopify App with React & Node
React Summit Remote Edition 2021React Summit Remote Edition 2021
87 min
Building a Shopify App with React & Node
Top Content
WorkshopFree
Jennifer Gray
Hanna Chen
2 authors
Shopify merchants have a diverse set of needs, and developers have a unique opportunity to meet those needs building apps. Building an app can be tough work but Shopify has created a set of tools and resources to help you build out a seamless app experience as quickly as possible. Get hands on experience building an embedded Shopify app using the Shopify App CLI, Polaris and Shopify App Bridge.We’ll show you how to create an app that accesses information from a development store and can run in your local environment.
Building Blazing-Fast Websites with Next.js and Sanity.io
React Summit 2023React Summit 2023
71 min
Building Blazing-Fast Websites with Next.js and Sanity.io
WorkshopFree
Nancy Du
Nataliya Ioffe
2 authors
Join us for a hands-on workshop where we'll show you how to level up your React skills to build a high-performance headless website using Next.js, Sanity, and the JAMstack architecture. No prior knowledge of Next.js or Sanity is required, making this workshop ideal for anyone familiar with React who wants to learn more about building dynamic, responsive websites.
In this workshop, we'll explore how Next.js, a React-based framework, can be used to build a static website with server-side rendering and dynamic routing. You'll learn how to use Sanity as a headless CMS to manage your website’s content, create custom page templates with Next.js, use APIs to integrate with the CMS, and deploy your website to production with Vercel.
By the end of this workshop, you will have a solid understanding of how Next.js and Sanity.io can be used together to create a high-performance, scalable, and flexible website.
Building High-Performance Online Stores with Shopify Hydrogen and Remix
React Advanced Conference 2023React Advanced Conference 2023
104 min
Building High-Performance Online Stores with Shopify Hydrogen and Remix
WorkshopFree
Alexandra Spalato
Alexandra Spalato
I. Introduction- Overview of Shopify Hydrogen and Remix- Importance of headless e-commerce and its impact on the industry
II. Setting up Shopify Hydrogen- Installing and setting up Hydrogen with Remix- Setting up the project structure and components
III. Creating Collections and Products- Creating collections and products using Hydrogen’s React components- Implementing a Shopping Cart- Building a shopping cart using Hydrogen’s built-in components
VI. Building the home page with Storyblok- Cloning the space and explaining how it works- Implementing Storyblok in the repo- Creating the Blok components- Creating the Shopify components- Implementing personalisation
Full Stack GraphQL In The Cloud With Neo4j Aura, Next.js, & Vercel
GraphQL Galaxy 2021GraphQL Galaxy 2021
161 min
Full Stack GraphQL In The Cloud With Neo4j Aura, Next.js, & Vercel
WorkshopFree
William Lyon
William Lyon
In this workshop we will build and deploy a full stack GraphQL application using Next.js, Neo4j, and Vercel. Using a knowledge graph of news articles we will first build a GraphQL API using Next.js API routes and the Neo4j GraphQL Library. Next, we focus on the front-end, exploring how to use GraphQL for data fetching with a Next.js application. Lastly, we explore how to add personalization and content recommendation in our GraphQL API to serve relevant articles to our users, then deploy our application to the cloud using Vercel and Neo4j Aura.

Table of contents:
- Next.js overview and getting started with Next.js
- API Routes with Next.js & building a GraphQL API
- Using the Neo4j GraphQL Library
- Working with Apollo Client and GraphQL data fetching in Next.js
- Deploying with Vercel and Neo4j Aura

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

Routing in React 18 and Beyond
React Summit 2022React Summit 2022
20 min
Routing in React 18 and Beyond
Top Content
Concurrent React and Server Components are changing the way we think about routing, rendering, and fetching in web applications. Next.js recently shared part of its vision to help developers adopt these new React features and take advantage of the benefits they unlock.In this talk, we’ll explore the past, present and future of routing in front-end applications and discuss how new features in React and Next.js can help us architect more performant and feature-rich applications.
The New Next.js App Router
React Summit 2023React Summit 2023
27 min
The New Next.js App Router
Next.js 13.4 recently released the stable version of the "App Router" – a transformative shift for the core of the framework. In this talk, I'll share why we made this change, the key concepts to know, and why I'm excited about the future of React.
A Practical Guide for Migrating to Server Components
React Advanced Conference 2023React Advanced Conference 2023
28 min
A Practical Guide for Migrating to Server Components
Server Components are the hot new thing, but so far much of the discourse around them has been abstract. Let's change that. This talk will focus on the practical side of things, providing a roadmap to navigate the migration journey. Starting from an app using the older Next.js pages router and React Query, we’ll break this journey down into a set of actionable, incremental steps, stopping only when we have something shippable that’s clearly superior to what we began with. We’ll also discuss next steps and strategies for gradually embracing more aspects of this transformative paradigm.
You Don’t Know How to SSR
DevOps.js Conf 2024DevOps.js Conf 2024
23 min
You Don’t Know How to SSR
A walk-through of the evolution of SSR in the last twelve years. We will cover how techniques changed, typical problems, tools you can use and various solutions, all from the point of view of my personal experience as a consumer and maintainer.
How to properly handle URL slug changes in Next.js
TypeScript Congress 2022TypeScript Congress 2022
10 min
How to properly handle URL slug changes in Next.js
Top Content
If you're using a headless CMS for storing content, you also work with URL slugs, the last parts of any URL. The problem is, content editors are able to freely change the slugs which can cause 404 errors, lost page ranks, broken links, and in the end confused visitors on your site. In this talk, I will present a solution for keeping a history of URL slugs in the CMS and explain how to implement a proper redirect mechanism (using TypeScript!) for dynamically generated pages on a Next.js website.

Add to the talk notes: https://github.com/ondrabus/kontent-boilerplate-next-js-ts-congress-2022 
Killing BFFs with GraphQL and Next.js
React Advanced Conference 2021React Advanced Conference 2021
21 min
Killing BFFs with GraphQL and Next.js
Top Content
Frontend applications are getting more and more complicated, often delivering far more than just a UI. With this growing complexity comes a growing need for knowledge from the developers creating it, as they have to deal with matters like state-management, authorization, routing and more. In this talk, I'll show you how to use GraphQL in your Next.js application to create a data layer for your application, that exists between your frontend and your backend. In this data layer, you can handle complex matters to help you to keep your frontend application clean and "stupid".