Let's go! Let's start with the workshop. First of all, let me greet you all here. It's a great pleasure for me to be here to show you some things TypeScript-related. I'm joining you from Czech Republic, Brno, where we have our headquarters. I'm Andrey, I'm a developer evangelist for content. We are a vendor of Headless CMS. I'm sure you know the company. I will show you a bit of the CMS as we work on the content and as we go through the workshop, but today is not a product pitch, I want to show you how to work with content in TypeScript and React components, right?
So, first of all, a little bit of housekeeping. The workshop is being recorded, so you can get to anything back in time, if you miss something, or if you get stuck on something. I'll try to go slow. But you can always get back or you can just ask me directly if something's not clear.
What we're going to do, and, oh, I hope you see my screen. Yeah, I think you do. So, what is the timeline of the workshop today? I know it's designed for three hours. I always try to be a bit quicker because it's really hard to keep your concentration for that long. What we're going to do in this workshop is first we're going to import content into a new project. So, we're going to create a new project in the CMS. We are going to import some content in there. If you're signed up for content, that's great. I'll show you how to import it. If you're not signed up and if you don't want to sign up, that's also fine. I'll give you the project ID of my project and you can work with the content that way anyway. So, you don't have to sign up anywhere. We're probably going to work a bit on the content. But not so much. We're going to spend most of our time in code. So, that should be fine. Then I'm going to show you the implementation in Next.js. I'm going to use Next.js because it's, to be honest, the closest to my heart currently. We have our whole website built with Next.js. I really like its flexibility and ease of use. So, I'm going to use Next.js, but the principles can be used in any framework if you're using Vue.js or if you're using Gatsby. Gatsby depends, but I think they support TypeScript as well now, so it should be good as well. So, I'll show you how the code looks like. I'll show you how the website looks like. And then we're going to move on to actually generating TypeScript models from content types. So, I'll show you how to bring the content from the headless CMS into your project and generate not only the TypeScript models, but also the project structure. That means code names and all the other things. Then I'll show you how to fetch the content in Next.js. That's quite straightforward as we have an SDK in TypeScript. And then I'll show you how to resolve rich texts into React components. That's what it's all about. To tie the React components to their respective content models. So, it's easy to maintain everything. And at the end, there is a little place for discussion how to implement deployment pipelines in a way that the content changes on the headless CMS side don't cause any production errors. So, we've implemented a way to check the content model with every build so that you can avoid the production errors in terms of missing content or misconfigured content to a minimum. So, that's about the workshop timeline. Yeah. And yeah, let's get to it.
First, we're going to import the stuff in the CMS. Then we're gonna open Visual Studio Code and stay there for the rest of the workshop. So, first of all, I'm gonna do that, too. The first step for you is to clone the project repository. Now, I don't want to give you any blank spots where you would be working on your own. I prefer actually going rather slowly and let you work on the tasks as I'm speaking. So, feel free to just do the steps as I'm doing them. And if you get stuck on something, then let me know directly in the chat window or just jump into the workshop and tell me. I'll repeat anything if something is not clear, yeah?
So, first of all, we're gonna clone the project repository. I hope that you have the link, but if you don't, I'm gonna put it in the chat window, right? So, there we go. So, this is the repository. It's a nice JS boilerplate that has a few pages in it. So, let me do the same thing. I'm actually gonna switch to Visual Studio. Can you still see my screen? Can you see the Visual Studio now? Perfect. Yes. Because I lost the green border, all right, perfect. So, I'm gonna put here a new terminal, and I'm gonna just git clone the URL. And let's go, CD Workshop. Now, first of all, I'm gonna do npm i. So, I'm gonna use NPMI to install the dependencies, because I have a bad experience from one of the previous workshops where NPMI took 25 minutes.
Comments