So, let's open up our VS Code. This is cheat sheet, sorry. This is the same screen I had to share with you. So, here at the package.json you can have a look at if the astro SDK from Storyblok is on depth dependencies, but it's on actually the depth dependencies. And in fact, the rest of them are also in the depth dependencies. What I want you to do is actually to update this depth dependencies to dependencies, and then hit the npm install, then it should be fine. So, here is actually the instructions. So, let's do that together in your VS Code. And then here I'm actually going to update this depth dependencies to just dependencies, and then I'm going to hit the save button. Sorry, I need to quit while I was running it. And before you're going to execute npm install, I want you to make sure if the Storyblok Astro SDK's version is 3.0.1 minimum, because if you have 3.0.0 or something lower, then you might run into a minor issue, and I don't want you to experience that. So, make sure that you have 3.0.1, and I guess everyone should have that as we follow the same steps together. So, after you make sure with that, you can run npm install or npm i, and then hit the enter to execute, and now the dependencies are updated into the correct dependencies, I would say. So, we are done in here. We also configured already the preview URL, we also solved this issue, we have the content being rendered, and this is actually a quick note for 4.04 when you see that. Yes, we need to configure the preview API key token to be stored at the environment variable. But again, if you want to just quickly discover how Astro and Storyblok would work, you can actually skip this part. This is more for optional, if you want to start working on for the production-ready application. So, if so, then you need to use the environment variable. With Astro, I would say it's not that difficult, but you can configure that actually from the astroconfig.mjs, and I'm actually going to show you, and this is where actually you see your preview API key token is being, you know, stored. So, if you don't use the environment variable, then that's the way you're going to do that. This is not going to be production-ready, obviously, but if you want to store the environment variable, I would say, like, here, this key would be the, I would say, the place where you need to set the correct environment variable name. But I'm not going to go too deeper, but the point is, like, as you used already our CLI to generate the Storyblok, I would say, application with Astro, then you already have everything configured, and if you go down, here are the components, dynamic components, I would say. So, these are all dynamic. That's why, like, when I made the change of the content on the teaser, let me go back here, teaser, like, from Hello World to 1, 2, 3, 4, then you saw the change is dynamic when I hit the save button. So, that's how it's already configured in here, and you just need to, you know, like, have a look at how things are being configured, how the components are being called, and you know, like, fetching the data, et cetera, then the rest of the part should be pretty much easy. So, quick explanation to that, and I would say, let's go back to the Notion cheat sheet, and I see that some people join, like, from the middle of the call, so I would say, oh, thank you. Yes, yes, yes, thank you so much. Is that correct to pronounce your name, KL? I hope so. Thank you so much for helping me. Yes. Next up, we are going to import the component schema, because we only have two hours, and time is really precious, and time is money, so I wanted to have exactly the same component schema as mine with more accurate way, and in a shortcut way. So, the thing is, we are going to use the Storyblok CLI, which we used already, but it's more going to be the real CLI. Actually, the command we executed to generate the new Storyblok app is something called createStoryBlock. It's part of the CLI, too, but this is going to be, like, a more official one. So, that, if you haven't yet executed before from this Storyblok CLI, then you can actually, like, follow what you see on my screen right now. So, we are going to install the Storyblok CLI. I have already installed, so I'm not going to see the same, let's say, screen with yours, but you can execute, first, like, in your terminal or any command line tools by saying, at the most root of your local machine, you can execute npm install Storyblok-G to install globally, and then after that, you can execute Storyblok login. You need to log in, actually. If you already have used the Storyblok CLI, I would recommend you to log out first because you might see some error, because after a certain time, it's going to log out, you know, like, for a data security reason, and it would ask you to log in again. So, if you remember that in the past that you might have used a Storyblok CLI, I would say, like, Storyblok log out, and then Storyblok login again, but for most of all of you, I would say, like, if you're first time using Storyblok CLI, just execute this Storyblok, sorry, npm install, and then execute Storyblok login. Then you should be able to see this same screen. I'm going to actually, like, make it full screen so you can see better. So, you can, you know, like, select a way to log in. Mostly, I would say, like, email would be quite convenient because you can, you know, get the authentication code, and then you can, you know, like, log in through the terminal. And then let me check the chat. I got the message. Login successfully. Token has been added. Yes, yes, I would say it seems like you succeeded, Ricardo. So, we can keep moving on for the next step. I think everyone can follow, like, what I'm going to explain the next steps. So, after you install the Storyblok CLI, let me check the time, after you install the Storyblok CLI, and then login to use the Storyblok CLI, then I want you to download this JSON file, which I already created the JSON file for you to have the exact same component schema, so that you do not need to watch me, you know, like, telling you that, okay, you need to create this component with exactly the same name, and then configure that, that, that, that some kind of, that is going to be, like, yeah, very long process to do that, and I'm quite sure that even me, myself including, I'm going to make a mistake. So, to avoid having some issues for now seeing exactly the same, I would say, the workshop content, you can go to this Notion page, for those of you who just joined right now, and then you can come down to, you know, like, this part to install the Storyblok CLI, and then click this, oh, sorry, click this file, and then I'm going to maximise it. Then you can actually, like, download this component file. And the point we are going to use this Storyblok CLI is that, not export, actually, like, importing, you know, like, this component schema JSON file into your Storyblok so that you would have every necessary components ready, because right now I can quickly show you don't need to go and see it, but I can quickly show you. So, at the block library, this is where you can see all the necessary components, but we only have four components, which is not enough for this workshop. I want you to have more than just four, you know, components, and all the configurations are already listed up in this component schema file. So, what we are going to do is, you can just copy and paste from the Notion page, and here I'm going to actually copy that, and then there is the command called push components. That is actually the important command we are going to use that. And then here at this, you know, how should I call this? At this kind of variable name, you can swap this into your JSON file path. So, if you installed or downloaded this JSON file into the most root, then that would be your path of the JSON file, and after that you can add this hyphen, hyphen space and then your target space ID, which I'm going to tell you where you can get it. So, let's first of all, like, copy and paste, and while I do that, then I can show you. Actually, I'm going to make my screen a little bit cleaner and let me go back to the root. So, I went back to the root directory, because that would work better and easier. So, what I'm going to do is paste what I have copied from the Notion node for this workshop, and what I'm going to swap first is here, the component schema JSON file path. So, what I'm going to do is that let me, let me, okay, I'm actually at the, I actually have this at the desktop. So, I am going to drag that. You can also use the same trick. If you downloaded, no, after you downloaded this component schema file into wherever in your local machine, then you can drag and drop of this file, JSON file on the terminal, and then it's going to fill out the path, and then here at the space, we would need a target space ID, so this is something we can get from the story block, you know, like a screen.
Comments