Deploying your NextJS Application on Laravel Forge

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
alright guys let's start today with another framework deployment on laravel Forge I'll be deploying next yes on laravel Forge I've created a brand new server on Amazon so let's get started all right guys so what I've done here is I've added a package that JSON file with a couple scripts from dev build and start let's go ahead and do yarn install once that's done let's go ahead and create a folder called pages and then create another folder indexed another file index yes and I've just pasted the code just says it works and let's go ahead and test this out so the site is up I just did yarn run dev and you see it works and the next step would be to try to get that on a github repo and once it's on github repo then we're gonna start deploying to a level forge alright guys so I finally deployed that repo on next year's - demo I know it's private right now but I'll make it public so y'all can check it out it has a pages and the same thing with the zero there's nothing in there but I would like to host it on laravel forged just so it's easier and I don't have to go through the whole process of creating a brand new droplet arm and putting everything together so this is easier let me go ahead and show you how we're gonna deploy this on level Forge so here I'm just gonna go back to my domain 12 v comm and I'm gonna remove this keep it a static add site while this is going on let me go ahead and secure the with the certificate just so it works and once it's done I will be back alright guys so as you can see my server is ready to go let's go ahead and fold that repo I'm just gonna go copy that from here this is that's my repo I'm gonna need master and just check off the composer dependencies and this is gonna run for a second and I'll be up and running but let's go ahead and check to see so you will see this 403 error and now in order to resolve this I found a couple ways but I really think p.m. - it shines really bright on the droplet so once this is done I'm gonna show you how to fix this error in a little bit so let me get the code for the proxy and set up p.m. - on my terminal and then I'll show you how exactly that's done hi guys I'm back on my terminal let's see if I have p.m. to running that is correct so we do have p.m. - now let's go ahead and set that up from beginning and I will try to explain as much as I can on how to set up proxy because that was the most difficult thing for me to understand but now that I have a good grasp of it I will be able to explain you guys how to fix that so let's go ahead and go into 12 v comm see right now if we do yarn install it's gonna go ahead and start installing the project once this is done I'm gonna go ahead and copy all the files onto my main project and show you how exactly p.m. - we'll have this up and running alright guys so I have added two new scripts or two new files one is this ecosystem that config GS which will tell your engine X server to look NPM - to look into that application and then what port and what local host is going to be running on and the script which is our star J as they start yes is basically which looks in to your process and if to explain you properly it just takes everything from your code and have p.m. to running in the background instead of running it so that it can run it it's processes okay so back in our engine X we need to add the following information in order to see everything so in here in location section I'm just gonna add this proxy file that I've copied from here so location and I will use the same next yes website for proxy you can check out my Knox Jas video for more details I will link in the description here is the exact address we're gonna put everything on which is your local host 3000 and now let's go ahead and go on a terminal let me try to save this and see if it goes successful so as you can see it failed I need to go ahead and fix the error for expires and all right and let's go ahead and try to do that and now if you see it's successful and I'm gonna see if I if my error changed so it did change the arrow to 502 now let me go ahead and start the PM 2 from the terminal and I will show you the the site working alright so back in my terminal if I do p.m. to start like in type ecosystem that config digests and as you can see it is online now let's go ahead and check on the browser if everything is working all right let's go ahead and refresh our page and see it is working a few things that I want to let you know one is you can add yarn install on the scripts so every time you push anything any new added scripts it's gonna in stole everything and the next one would be yarn run start actually I have a custom script yarn run prod so once that's run it's gonna do everything it's gonna install run and and make sure everything is running on the back end and you will see the site live so no matter how many times I'm gonna go ahead and refresh it's still working and this is all done through level Forge if you guys have any question comments and would like to discuss your projects feel free to comment below I hope you have a awesome new year thank you very much for watching my videos
Info
Channel: Himanshu Batra
Views: 1,083
Rating: 5 out of 5
Keywords: reactjs, laravel forge, laravel
Id: JJmbPQSgx4U
Channel Id: undefined
Length: 7min 44sec (464 seconds)
Published: Sun Dec 29 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.