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

This workshop has been presented at React Summit 2023, check out the latest edition of this React Conference.

FAQ

The purpose of this workshop is to demonstrate how to build a visually readable Next.js website using the React Bricks library.

The workshop is led by Matteo Frana, the COO and lead Frontend developer at React Bricks.

React Bricks is a CMS with visual editing based on React components. It combines the benefits of visual editing and headless CMS.

The main components needed for React Bricks are a headless CMS, a visual editor, a frontend library to create code, and a product called Freedom.

To start a new React Bricks project, you can use the CLI command: `npx create-reactbricks-app@latest`. Follow the prompts to set up your project.

React Bricks offers features like inline editing, the ability to use React and any CSS framework, flexible design systems, and the freedom to host the website on any platform.

Yes, React Bricks allows you to use custom fields and metafields to store additional information and use them within your bricks.

React Bricks supports internationalization by allowing you to add multiple languages and create translations for your content.

In React Bricks, you can reuse content using stories (cookie cutter method), page embeds (single source of truth), and multiple page viewers for common elements like headers and footers.

The future roadmap for React Bricks includes features like a media library, padding system, multiple content branches, workflow for publishing, and a marketplace for bricks.

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

Rethinking Server State with React Query
React Summit 2020React Summit 2020
96 min
Rethinking Server State with React Query
Top Content
Featured Workshop
Tanner Linsley
Tanner Linsley
The distinction between server state and client state in our applications might be a new concept for some, but it is very important to understand when delivering a top-notch user experience. Server state comes with unique problems that often sneak into our applications surprise like:
- Sharing Data across apps- Caching & Persistence- Deduping Requests- Background Updates- Managing “Stale” Data- Pagination & Incremental fetching- Memory & Garbage Collection- Optimistic Updates
Traditional “Global State” managers pretend these challenges don’t exist and this ultimately results in developers building their own on-the-fly attempts to mitigate them.
In this workshop, we will build an application that exposes these issues, allows us to understand them better, and finally turn them from challenges into features using a library designed for managing server-state called React Query.
By the end of the workshop, you will have a better understanding of server state, client state, syncing asynchronous data (mouthful, I know), and React Query.
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.
From Todo App to B2B SaaS with Next.js and Clerk
React Summit US 2023React Summit US 2023
153 min
From Todo App to B2B SaaS with Next.js and Clerk
WorkshopFree
Dev Agrawal
Dev Agrawal
If you’re like me, you probably have a million side-project ideas, some that could even make you money as a micro SaaS, or could turn out to be the next billion dollar startup. But how do you know which ones? How do you go from an idea into a functioning product that can be put into the hands of paying customers without quitting your job and sinking all of your time and investment into it? How can your solo side-projects compete with applications built by enormous teams and large enterprise companies?
Building rich SaaS products comes with technical challenges like infrastructure, scaling, availability, security, and complicated subsystems like auth and payments. This is why it’s often the already established tech giants who can reasonably build and operate products like that. However, a new generation of devtools are enabling us developers to easily build complete solutions that take advantage of the best cloud infrastructure available, and offer an experience that allows you to rapidly iterate on your ideas for a low cost of $0. They take all the technical challenges of building and operating software products away from you so that you only have to spend your time building the features that your users want, giving you a reasonable chance to compete against the market by staying incredibly agile and responsive to the needs of users.
In this 3 hour workshop you will start with a simple task management application built with React and Next.js and turn it into a scalable and fully functioning SaaS product by integrating a scalable database (PlanetScale), multi-tenant authentication (Clerk), and subscription based payments (Stripe). You will also learn how the principles of agile software development and domain driven design can help you build products quickly and cost-efficiently, and compete with existing solutions.
Building Reusable Server Components in NextJS
React Summit US 2023React Summit US 2023
88 min
Building Reusable Server Components in NextJS
Workshop
Will Bishop
Mettin Parzinski
2 authors
React continues to evolve their beta capability, React Server Components, and they're continuing to further develop them in partnership with frameworks like NextJS.In this workshop, attendees will learn what React Server Components are, how to effectively build and use them in NextJS, and focus on one of the major advantages of React/NextJS: reusability through components.We will also cover related beta technologies enabled by the `app` directory, such as nested layouts and server actions (alpha/experimental capability).Join us for this hands-on, 120 minute workshop!Technologies:
React, JavaScript/Typescript, NextJS, Miro

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
Routing in React 18 brings a native app-like user experience and allows applications to transition between different environments. React Router and Next.js have different approaches to routing, with React Router using component-based routing and Next.js using file system-based routing. React server components provide the primitives to address the disadvantages of multipage applications while maintaining the same user experience. Improving navigation and routing in React involves including loading UI, pre-rendering parts of the screen, and using server components for more performant experiences. Next.js and Remix are moving towards a converging solution by combining component-based routing with file system routing.
React Query: It’s Time to Break up with your "Global State”!
React Summit Remote Edition 2020React Summit Remote Edition 2020
30 min
React Query: It’s Time to Break up with your "Global State”!
Top Content
Global state management and the challenges of placing server state in global state are discussed. React Query is introduced as a solution for handling asynchronous server state. The Talk demonstrates the process of extracting logic into custom hooks and fixing issues with state and fetching logic. Optimistic updates with mutation are showcased, along with the benefits of using React Query for data fetching and mutations. The future of global state management is discussed, along with user feedback on React Query. The Talk concludes with an invitation to explore React Query for server state management.
Managing React State: 10 Years of Lessons Learned
React Day Berlin 2023React Day Berlin 2023
16 min
Managing React State: 10 Years of Lessons Learned
Top Content
Watch video: Managing React State: 10 Years of Lessons Learned
This Talk focuses on effective React state management and lessons learned over the past 10 years. Key points include separating related state, utilizing UseReducer for protecting state and updating multiple pieces of state simultaneously, avoiding unnecessary state syncing with useEffect, using abstractions like React Query or SWR for fetching data, simplifying state management with custom hooks, and leveraging refs and third-party libraries for managing state. Additional resources and services are also provided for further learning and support.
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
Top Content
Watch video: A Practical Guide for Migrating to Server Components
React query version five is live and we'll be discussing the migration process to server components using Next.js and React Query. The process involves planning, preparing, and setting up server components, migrating pages, adding layouts, and moving components to the server. We'll also explore the benefits of server components such as reducing JavaScript shipping, enabling powerful caching, and leveraging the features of the app router. Additionally, we'll cover topics like handling authentication, rendering in server components, and the impact on server load and costs.
The New Next.js App Router
React Summit 2023React Summit 2023
27 min
The New Next.js App Router
Watch video: The New Next.js App Router
Today's Talk is about the Next.js App Router, which has evolved over the years and is now a core feature of Next.js. The Talk covers topics such as adding components, fetching remote data, and exploring layouts. It also discusses submitting form data, simplifying code, and reusing components. The App Router allows for coexistence with the existing pages router and enables data fetching at the layout level using React Server Components.
You Don’t Know How to SSR
DevOps.js Conf 2024DevOps.js Conf 2024
23 min
You Don’t Know How to SSR
The Talk covers the speaker's personal journey into server-side rendering (SSR) and the evolution of web development frameworks. It explores the use of jQuery for animations in SSR, the challenges faced in integrating React with Umbraco, and the creation of a custom SSR framework. The Talk also discusses the benefits of Next.js and the use of serverless artifacts for deployment. Finally, it highlights the features of Astro, including its function per route capability.