Installing Typesense Server0:03
All right, let's get started. I hope you're excited. So we're gonna start by of course, installing typesense. I'll click on guide and install. Now of course, depending upon your OS you will install this uh, in a different way. And of course if you're following along with a course like this, you already know what you need to do here. So option one is typesense cloud, which is sort...
know what you need to do here. So option one is type since cloud, which is sort of their turnkey surface that you should take a look at. We will review that later in the course. So for now, we will install it locally on our machine. And yeah, if you prefer Docker, here you go. If you want to use Mac with Homebrew or the Binary or Linux or Windows, just find the one you like. Uh, and you'll get started. So I'm on a Mac and I actually like to keep it simple.
Uh, and you'll get started. So I'm on a Mac and I actually like to keep it simple. I'm gonna use Homebrew here. So these are our commands we wanna install typesense-server, and then we will, uh, start the service so that it's always available to us. All right, let's get going. I'll switch to my terminal, paste that in and give it just a minute to do its thing. Alright, so of course I already have typesense and salt on my machine,
Verifying Server Health1:01
Alright, so of course I already have typeSense and salt on my machine, but on your end you'll see something along the lines of binding to port 8108, which of course is the port that you will connect to from your Laravel app in the future. Alright, so now I just wanna verify that everything is up and running. So here's what I'll do. I'm gonna make a curl request to localhost and like we discussed,
Creating Laravel App1:19
So here's what I'll do. I'm gonna make a curl request to localhost and like we discussed, 8108 is what it binds to. And we'll go to the health endpoint and sure enough, I get, okay, true or I'll set to go. Alright, let's get started. I'm excited. So we're gonna create a generic Laravel app and I'm just gonna call it, I dunno, supercharged search. All right, no starter kit. It's gonna be pretty bare bones. Laravel SQLite is fine. We can install our dependencies.
Configuring Typesense Environment1:44
All right, no starter kit. It's gonna be pretty bare bones. Laravel SQLite is fine. We can install our dependencies. Very good. So now we can view this in the browser. Uhhuh, we have our basic Laravel splash page. Great. Next, let's cd in there and open this in my editor. Alright, so now while we're thinking of it, let's open up our .env file and set some initial values. So I will scroll down to the bottom and yeah, we know
So I will scroll down to the bottom and yeah, we know that our typesenseHost is localhost, right? And the port is 8108. So let's do this typesenseHost equals of course, localhost and typesensePort is 8108. And then also we're gonna need an APIKey, right? So let's do APIKey equals and what should this be locally? Well, if we switch back to the documentation, let's scroll back to my Homebrew installation method.
Well, if we switch back to the documentation, let's scroll back to my home brew installation method. And yeah, right here you'll see the default API key is X, Y, Z. And again, the port is 8108, okay, so let's set that here. X, Y, Z. Alright, so now if we need to reference any of these values in our project and hint we are going to, uh,
Installing PHP Client2:51
of these values in our project and hint we are going to, uh, now we have those available to us. Very cool. Okay, so the next step is to set up our php client. So once again, back to arc. Let's go into install a client. And of course they have client libraries for PHP. So let's take a look at that. All right, so let's scroll down and let's copy the composer require, I will paste that in.
All right, so let's scroll down and let's copy the composer require, I will paste that in. Alright. And believe it or not, we're all set to go. So yeah, think about what we did in this video. We installed type sense server, we started it, we verified that it was up and running by making that curl request, right? Then we set up a fresh Laravel app and we assigned some initial type sense specific environment variables.
and we assigned some initial typesense specific environment variables. And then finally we finished up by pulling in the typesense PHP client that we're gonna make use of in the next episode. I'll see you then.
