
Lesson Description
The "Log In with Google" Lesson is part of the full, Cloud Infrastructure: Startup to Scale course featured in this preview video. Here's what you'd learn in this lesson:
Erik reviews the Google Cloud, Supabase, and AWS accounts that must be created. Google Cloud will manage application authentication with OAuth. The repo is cloned, and an initial branch is created for developing the start-up deployment workflow.
Transcript from the "Log In with Google" Lesson
[00:00:00]
>> Erik Reinert: So like I said before, if you go to the repo, you will see a stage 01 startup branch that is the result of what we're gonna be doing, right? If you want to be able to copy things or reference things or whatever, that is the result. The only caveat I want to put in there is that in these branches I named the service Preview.
[00:00:24]
So if you see anywhere in there where it says preview, you can either just use that or you can just replace it to FEM FD Service. I did Preview because I can't have the non existent and the existent at the same time. So I had to create something separate so I could show you guys right now and then I can work through it together on the workshop.
[00:00:45]
But yeah, so all the code exists in this branch. If you want to take a look at that. As I said before, we are going to be going into Google Cloud, although we're only going to be going this far into it, like, that's it. This is the only page we're going to look at.
[00:01:01]
So this is where we're going to set up our OAuth2 client ID and credentials. So make sure that you can at least get to that page. Also, as I said before, we're going to be using Supabase and so we will eventually be able to log into your database on Supabase.
[00:01:19]
You will be able to have all of your tables here on the left, right? So, yeah, also parameter store, if you've never seen parameter store before, this is where we keep all of our values, all of our configuration values. Like I said before, you'll notice that each one of them is their own value.
[00:01:39]
This would be that key value approach that I told you, where it's like, okay, well, I just want the client id, I just want the secret, I just want the postgres URL. Another nice thing about this, in comparison to Secrets Manager, if you put all of your secrets into one thing in Secrets Manager, then that means that you only have the ability to set up permissions for that one secret, which makes it hard when it grows and grows and grows.
[00:02:04]
And you're like, parameter store is nice because I could even individually set up permissions per each parameter and say, okay, you can see this, you can see this. So it's just more granular. It's a lot easier to work with. And then the last thing is, I do want to show you this really quickly.
[00:02:21]
This is what we're actually going to be deploying. So this is the service actually running up on App Runner. You can See that? We got like a random URL at the top. If you're curious about domains, we are not going to be provisioning any kind of custom domains because I hate DNS.
[00:02:36]
So we're not going to be doing any kind of domains today. Don't worry about purchasing a domain. I would challenge you after this course to add your own domain to it. You know what I mean? Set it up and take this course and grow off of it. But yeah, no, at the end of the day it's just going to be random domains on Amazon.
[00:02:56]
So that was, don't worry about SSLs or anything like that. Okay, cool! So let's go ahead and get started. The first thing we're going to do is we're going to go to the repo itself. So I want everyone to go to the Frontend Math or the FEM/FD service repo right here.
[00:03:18]
Then what I want you to do is in another tab I want you to open up your. Let's see here. I think for users you would go to. Yeah. So you go to your users and then repositories and we want to create a new repo. So basically in one tab I want you to have the source code open on the main branch.
[00:03:40]
Then in another tab I want you to create a new repo. So you click New, and then you'll give it the name, femfd-service. I would go ahead and make this private just because there's really no need to make this public right now. And then, you don't really need anything else.
[00:04:06]
If you want to add a license or anything else like that, you can. But once you're done with that, go ahead and click New Repository or Create Repository. So again, you're basically creating a new repo called Fem FDService inside of your GitHub. You're going to notice that what's kind of nice is it gives you some commands to run and stuff like that.
[00:04:32]
What we really want to do is we want to take the existing code base, clone it and then push that to our new repo. That's what we want to do. What I'm going to do first is I'm going to go to the FEM FD service. Let me go to code, and then I'm going to click my option of cloning.
[00:04:51]
In this case, I like to use the GitHub CLI. So I'm gonna copy that. Then I'm going to go to my terminal. For me, I'm just going to put it on My desktop. You guys are welcome to put it wherever you want. So I'm going to do paste this in and then I'm going to hit enter.
[00:05:11]
So then I'm going to go into my repo right now again, this is the base repo. We haven't done anything yet. We were just given it. We have no idea what's in this repo or anything. We just, we want to make sure it's stored in the right place.
[00:05:27]
So then what I'm going to do is I'm going to do git remote origin or I'm sorry, git remote add origin new. Again. I'm in the base repo that I just cloned. Then I'm going to go back to the repo that I just created and I'm going to copy this right here.
[00:05:47]
Does anyone know what I'm doing before I go further? Does anyone know what this does? Yeah,
>> Speaker 2: you're connecting your new repo on GitHub to this code base so you can push it.
>> Erik Reinert: Yep, exactly. Yeah, so if you've not worked with Git much, Git uses some fundamentals in how it works.
[00:06:09]
You've got commit, you've got push, you've got checkout, whatever. But underneath the hood, Git uses something called origins. Origins are where Git pushes and pulls data from. So if you've ever been curious of how can I take an entire repo and then move it, what you can do is you can go to that existing repo, configure it to point to the new repo, and then just simply push to that new repo and you're good to go.
[00:06:36]
That's exactly what we're going to do. After I do Git remote add origin new, I can just do git push origin new main and then you will see that. Now if I refresh this page, I have my entire code base. So that's all I want you to do.
[00:06:56]
That's all I want you to do is I just want you to clone this repo from the main branch and simply push it to your repo by adding an origin.
>> Speaker 3: Could you do that by forking it on GitHub and then checking that one out?
>> Erik Reinert: Yeah, you could.
[00:07:14]
Forks are meant to be merged in.
>> Speaker 3: Sure.
>> Erik Reinert: Right. So you'll always have like an open fork, so that you could. I did think about telling you guys to just fork it, but I was like, eh, you wouldn't technically do it that way. You'd do something more like this.
[00:07:29]
All right, so now what I'm going to do is, I'm actually going to delete this repository. So I'm gonna just delete the repo I just cloned off of my desktop and here I'll. Sorry, I'll not use my hop commands. So I'm just going to do RM, that's rf, not backup.
[00:07:49]
There we go. So I'm just gonna remove that repo. Now the reason why I'm removing that repo is because that repo is set up with the one that we cloned from. But I want to make it so that I'm using my actual repo. So then what I'm going to do is I'm going to go back and I'm going to do exactly what I did with the main repo, but now with mine.
[00:08:10]
So I'm going to go to code GitHub CLI clone, and then I'm just going to enter that in, and now I have my repo. If you type in that command, thank you. You should be able to see that we are referencing the right repo. Just make sure that you're not referencing my repo because when you go to push, you will try pushing to mine.
[00:08:33]
That's really the only reason why I'm telling you that if you are in your main repo, the next thing you're going to want to do is create a new branch for your changes. I don't recommend pushing to main. You can if you want, but I don't recommend it.
[00:08:49]
Get used to using PRs. Get comfortable with waiting for status checks because that's going to be your life moving forward. Let's go ahead and create a new branch. If you want to create a new branch, you can just do git checkout B and then call it whatever you want.
[00:09:05]
I'm going to call mine or actually we'll call it stage zero one Startup. Yeah, just run that command and then you should get a brand new branch created. Cool, then I don't remember, does that? I've already got that branch. So what I'm going to do is I'm going to call mine Workshop because that's the branch I'm going to be working in.
[00:09:35]
Then, you'll see that my branch has now changed to workshop. If you want to make sure you should be able to do git status and then it'll say on branch workshop or I'm sorry, on branch stage 01. So it should say on branch stage 01 for you guys.
[00:09:50]
For me it'll say workshop just so that you guys can keep up. You might be Like, Eric, why are you like, what is wt? So I use something called Work Trees. Git Work Trees. I'm not going to go into detail on what that is because it's its own world.
[00:10:07]
But the easiest way to describe it, if you are curious, is it basically makes it. You'll notice that I have three directories here. With normal git, you would have your repo and then you'd be the branch that you're in, and then you'd switch between branches. Work Trees make it so that you can actually have branches in individual directories.
[00:10:27]
In this case, I actually have stage 01, 02 and 03 all checked out. Then if I want to, I can just jump into that, or I can jump into this, or I can jump into this. If you've ever been curious about how can I up my git game, what are some cool things that are really helpful?
[00:10:43]
This is massive. I really love git Work trees. Again, they're a big part of my workflow. If I just do Workshop, then you'll see I get a directory called Workshop now created. Even though I created the branch now I actually created a directory for it. So now I'm in Workshop Workshop.
[00:11:04]
So it's just a really nice way to be able to have multiple projects open and stuff like that simultaneously if you need to. So what have we done so far? So again, we got our source code, we cloned that, we then created a new repo of our own.
[00:11:18]
We push that up, and now we have basically, a working version control. So if we were talking about like goals and the things that we've accomplished, we just accomplish the very first thing, which is getting our code somewhere so that people can contribute to it. So if you want to, you know, if you want to look at it from this perspective, this is your first step in the line of what we're doing.
[00:11:39]
We have to put our source code somewhere, right? So this is how we did it.
Learn Straight from the Experts Who Shape the Modern Web
- In-depth Courses
- Industry Leading Experts
- Learning Paths
- Live Interactive Workshops