It has a scenario which has two apps, a blog app where admins can fill in blog articles and have those blogs be read by both guests and new hires alike, and a portal app where admins populate the content management system with rentals in the area. And new hires can then use the portal to browse available rentals, save them to their profile, and reserve them for the payment. But most importantly, we knew that we had to design an architecture that could be extended to new scenarios.
So as we get started, what you need to do if you want to follow along is to go ahead and create a copy of this, fork the repo and use the URL that I've given in the text below. That's because this reference implementation is actively under development, so I want to make sure you have a stable branch, so look for aka.ms slash Contoso hyphen real estate, hyphen react, hyphen summit, hyphen 2023. Uncheck the main branch box so that it's actually copying over all the branches, and then look for the react summit branch in your fork. At this point, we are ready to start deconstructing.
The very first thing you want to do is understand or answer the question of development environment, how should we set up our development environment? In our reference implementation, we advocate for GitHub codespaces or rather for a devcontainer environment. So let me quickly show you what that looks like. So when you fork the repo and switched to that particular branch, you want to go look at the code dropdown and start a new codespace. In my case, I already have one running, so I dropped it, and you can see that I have one running, and when you launch it, it takes a little bit of time, but when you're done, you're actually going to see something like this.
So as you can see, you have what looks like a Visual Studio code experience right in your browser, but it's connected to a runtime environment that can actually run this application for you. So let's take a look at what a devcontainer is. So in this particular case, you're gonna learn two things. First, a devcontainer is a Docker container that runs in the cloud in the case of GitHub codespaces, but the pattern that you're going to understand is that it uses configuration as code. That environment is defined by a devcontainer.json file that you can check in along with your code base. You can version control it, you can modify it, you can share it with others. And what it does is ensures that anyone who uses this project is set up with the exact same environment in which they can build, debug, and deploy.
Once you've done that, this is optional, but I encourage you to install GitHub Copilot Chat, and I'm sure you're going to show you really quickly why that's useful. So what GitHub Copilot Chat does is it provides an AI assistant, but that AI assistant is sitting right in VS Code. So in my case, I've already installed it, and when I click on this, I get a chat assistant right in my VS Code experience. And what that means is when I'm stuck with a particular question, so for instance, I can ask it, what is GitHub Codespaces? And instead of going out from this to Google and then coming back and context switching, I ask it right here and it gives me a response in context, but it can do more. I can ask it, so I can use things like commands, like explain and say explain what this does, right? But now what it's doing is it's actually taking this and looking at the file that you've got open here, which is devcontainer.json and saying, oh, let me explain what this does, which is it's a dev container. And now you can actually, and it combines the two and follows the software, but you want to understand the benefits of code spaces. So what you've got is an AI assistant that stays in line with your flow, but also has the context for what you're working on in your development environment and can customize its responses to help you. And as you can see over here, you can not only get it to explain things, you can get it to generate code, you could get it to fix code, simplify it, create notebooks, create workspaces, and also just freeform queries or instructions. So now you have your development environment. You know that your code is already there. What can you do? Next, we want to build and preview the app right there in the browser to validate the fact that that reference implementation actually works for our needs. In my case, I already have that running and you'll notice that in the instructions, it tells us how to get started building and previewing it.
Comments