I'm Simon MacDonald the head of developer experience at begin. And this is my super out of date website. Yeah, a lot of these projects, I don't get a chance to contribute to anymore. And nowhere in here does it actually say who I work for now. So I figured this would be a good opportunity for me to update this website by using begin. So let's follow along. How am I going to do that? Well, I guess the first thing to do is to go over, to begin and do a login. Now I've already authorized Begin to use my git hub credentials to log me in. So. We'll go ahead and do that. And now I have a bunch of apps, but we're going to create a brand new one for this case. So let's just click on, create new app. What kind of runtime do we want? Well, I prefer node JS over Deno right now. And for framework specific, I don't really want a framework for this because it's really just a personal website. So this one here sounds like a good starter application. So let's choose that.
And when we get over to this next page, it's going to ask me what organization or user to put the website under. And I'm going to use macdonst , which is my GitHub user ID. And let's give it a name. Let's call it Simon. MacDonald. Dot com and you have just witnessed a Christmas miracle. As I have typed my own name without making a misspelling. That's pretty impressive. I'm going to give myself a plus one on that. All right. So next step we'll just go ahead and create this personal website. And what this is going to do is it's going to fork. That personal website template into my git hub organization and set up all of the things on AWS. That we need in order to be able to build our website. All right. So while the setup is happening, let's just check it out. They git repo.
Great. So everything over here is all set up. You can see, we have some files that we need in order to build things. It's based off of the personal website. And the stuff is going fairly well. Well while all of the CI/CD. Is happening in the background. Let's go ahead and set up things so that we can do local development. So I'm going to switch over to vs code here. And I'm going to start by doing a git clone of the repository.
And once I do that I CD into that directory. And do an NPM install. So. While the NPM install is happening locally. Let's go ahead and go back to the web interface and check out what's been going on there. Well over in the web interface, the CI/CD has finished. You can see that we've done. The verification and the install of node modules. We've skipped a bunch of steps here that are optional. And finally, we've done a deploy. So what's happened is that the website has been deployed to our staging, but we also have production set up as well. But let's go ahead and take a look at what a website looks like on staging currently.
And so right now we have a very generic site. We don't have a name or anything else that is associated with me set up on it, but you can see how easy it was to get this, you know, very simple site. Set up. Now let's go back to my local installation. And see how things are happening. Oh, great. So everything is already. Installed. So we're going to have to open that folder. So bear with me for a second. Yeah, I was. Going to my developer. It's macdonst and my website.
All right. So now everything is up and running. When I get the, got a terminal back here. And so we're able to run. Local commands and let's do let's actually start the local development. Process. So if we just run NPM start. It's going to start at the sandbox and, oh, well, we've run into a problem with Mac OS Monterrey. So we were using port 5,000 for one of our database setups and now, and that's a reserved port on Mac OS so what we need to do in order to fix that is just export this environment variable to tell us what port. To run our database on. All right. So let's go back to NPM start. And you can see now at local host. 3 33 and we have her local website up and running. So if we take a look at that,
Ah, all right. So basically we have exactly the same thing running on our local server as we do have in our staging site. So that's great. So I'll be able to do a lot of my development locally and then push it to staging in order to make sure that everything's all set up. So, how do we want to tackle things? Well, probably I should put my correct name in here. And so let's delve into the source code a bit. So under the source directory, there's two folders. One is HTTP, which is for all of the routes and views that is a shared folder that we use in order to put view code that is used in multiple routes. And in this situation, we only have the one route which is get index. And so if I take a look at index dot JS, it's very simple. We are passing in a bunch of basic bio information into our main template, which is contained in views in order to have that website get. Generated. So I'm going to start with, by typing in my name now let's see if I can actually type it in, oh, look at that twice in a row. I've typed in my website correctly. That is pretty wild. All right. Let's just make it Simon. MacDonald. Dot com. Get rid of that exclamation point. And what's my occupation. Well, Now it's head of developer experience. At begin. And location. I'm an Ottawa Ontario. Yes. I'm Canadian. I can prove it to all of the folks that aren't in the United States I can just say about. And I think that pretty much proves it. People in Canada, they're like, I didn't notice a difference. And everybody in the states is probably laughing right now. And for the bio. I'm just going to make it short and make it. Coffee. Lover. And human good reads. As I, do we love to read. For email, just going to leave it as your email at email.com right now. I put in my Twitter account, which is my Instagram account. And my LinkedIn. is Simon MacDonald. And for Facebook. Oh, I don't use it. So I'm just going to get rid of it completely. All right. So I've made some changes. To the bio here and let's go back over. To the website and we are running locally. And if I refresh this page, Yeah, you can see that things have changed. We have my name, I location. Other stuff is all set up. And in fact, if we go to Twitter, we'll go to my Twitter. Page so awesome. Local development is working just fine. But I had You know, I kinda actually like this. Photo that we have here. So I'm going to replace the photo that is currently deployed with the website, with a one that is like a bit more personal. So what am I going to do? Let's see, hang. I'm going to need to start. A new terminal here, and I'm just going to add a CD into the public directory.
And if I can.
There we go. Yeah. I can actually type a, I'm going to copy. From, I think I've got it. And downloads. This. Ah, Yes, you can access stuff. From my downloads folder. Yes, hero JPEG, and I'm going to drop it in here. So if we take a look in public you can see that there is now a hero dot JPEG. Basically anything that you put into the public folder, once we deploy it to staging or to production, they will get deployed to an S3 bucket for you. Now, what do I want to do? So down here for photographer? Well, you know, actually this is not the person who took the photo. My friend Michael Brooks. Took the photo. And if I remember correctly, his website is. Michael Brooks. Dot CA. And for the image. I'm going to make it hero. JPG. And so. You may notice something here as this little convenience methods called arc static. So when you deploy any of your assets to the S3 bucket, they get fingerprinted. So that way each asset has a different version so that when you upgrade your site, you don't. Serve people with a stale version of your asset. So arc static, all that asked you to refer to the file name that is currently on your desktop and not have to worry about all of that fingerprinted stuff. So that's all saved. Let's go back over to the website and refresh things. And yes, lo and behold, we've got my image. We've. We've got an updated. It's Michael Brooks on Unsplash. Now technically that's, that's not on, un splash. So let's delve into that a bit. Where is that code? So. Main is generating the view. So if we take a look at main. We can see that there is this component called splash, which is the hero image. And from there, there's a photo credit component. So if we dive into photo credit you can see that photo is by. And then on this service, It's like, I really want that service in there and someone's. Going to strip that out. Go back over and do a quick refresh. And yes, the photo is now just by Michael Brooks. Well, that's pretty good for right now. I think I'm just going to do a commit.
So let's commit everything.
And yeah, I forgot to do I git add. Because I am a dummy.
The ever so useful first commit message. And let's just go ahead and just. Push that up to origin main and see what happens. So. Going back over to our web interface and Begin you'll be able to see that the commit was picked up by Begin and it's building us a new version of the website. So really didn't have to do anything there. The CI CD processes taken over for us. And like most things in life, the installation of node modules is what takes the longest. All right. So. We're about to get into the deploy. Side of and we'll see how that goes.
All right. We have deployed. The new version of the site, it's up on staging now. So if I take a look. At our staging site. And if I do a refresh of it, Lo and behold my updates are all set up. So that's just a very quick way of getting the website up and running. You might've noticed, I skipped over the piece here where it was asking me for my email address. And we're going to address that in a future video where I'm going to actually show you how to accept. You know, comments from the web and have it relayed to your personal inbox. So we're going to save that for next time. Anyway. Let me know if you thought this was useful, have a great day.