Why I'm using Railway to deploy my nextjs side project

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
so for those who've been kind of watching my channel and been subscribed you've seen I've been building this like online classroom application and I finally decided to try to get deployed somewhere so that people can actually try to like log in and use it what I've been kind of using before my deployment process so far is railway.app I haven't used this before and I wanted to give it a shot and it's actually pretty easy to like get everything deployed they also give you like a free tier where you get like up to 500 hours a month which ends up being like 21 days of your app being runnable or deployed and I think it's like I don't know I don't think it costs too much to have your application ran in Railway I want to give a quick little overview of Railway and just kind of like why I'm using it and why I think it's a good solution for someone who's trying to build a side project or a small startup when it comes to deployments and devops like you don't want to waste a bunch of time trying to get your stuff configured and deployed right so I do a lot of Amazon work at my current job and there's a lot of overhead with doing things the Enterprise Way of like bringing in terraform to set up all your resources have them automatically deployed and it's a lot of man hours to get all that stuff kind of orchestrated and set up and have everything automatically deploy with your CI CD pipeline so it's good to try to find something like versel or Railway or whatever to host your application so this is what I'm doing here I have an actual like domain that was given to me when I deployed this and I have like all the functionality currently working and this is the next app so Railways supports deploying your next JS applications which is pretty cool you're not just kind of like stuck with using versl you can deploy your next app onto many different types of I guess it's uh infrastructure as a service platforms I don't know really what this platform's even considered but so you can deploy your application and the way they get this going is you literally just like go to your dashboard you create a a project or a service and you point it to your GitHub repo and then from that point forward it just basically figures out what it needs to do to get your application built and deployed all right so I just pointed it to my online classroom repo and it just looked at it and saw that I'm using next and now every time I push a change to my repo it'll just kick off a deployment so let me just do that real quick I have this like Bell icon that I don't even have functionality for so if I were to just go ahead and like Commit This real quick and push it up you'll see that after about a couple of seconds a GitHub hook will probably fire and invoke this and now you see that it's building my Railway application here so this is going to run through dual full deploy do a full build I think it also uses Docker containers for running your stuff so I think it like encapsulates the next step in a Docker container pushes that somewhere and has that refresher live service I don't know how it all works behind the scenes I don't know if they have like a bunch of Auto scaling set up for you or what happens if your application has a bunch of traffic do they scale up your Docker container what are the what would be potential issues with like having websockets set up inside your containers or not these are questions I still want to figure out but for the most part for a small application um it seems to work pretty well we'll come back and see if this finishes in a bit but the cool thing is they also provide you a way to post a database right so this application I'm using the T3 stack with Prisma and I'm connected to a local postgres database but when I wanted to deploy this all I had to do was create a postgres database inside of Railway app and you get this basically this URL if you click connect to give you your url that you can actually connect your database with a password and stuff I'm not going to click that because I don't have to change my passwords although I think they're hidden but once you've set that up you can actually migrate your changes run your migration scripts on your postgres database and they give you this cool way to kind of look through your data this isn't the best database browser like I would probably use some type of like postgres browser over here like if I go over here and I can actually connect to my Railway database and I can look at that same column so classroom right click on this and say select top 100 or something half a thousand that should give us back the results of that table so you can connect your database with whatever type of postgres tool that you want to use um I'm not sure how much I like this tool I'm using because I can't figure out how to write the query for it let's see if the show tables does that run something anyway yeah I'm not really sure what this this table name is because I can't select from it select star from classroom run the query doesn't seem like it does anything for some reason so I need to go and look up like what is a proper way to query a postgres database because I haven't really done that in a while and I've forgotten already but yeah so I have a database running they set that up and they charge you by the minute I believe with how much data you use and all this other stuff and while I was kind of explaining that this thing fully finished running and deploying you can kind of look through logs and see what happened when it was building your application you can see here it's making a Docker container and pushing that somewhere I don't know where pushes it but once it's done pushing that container it kind of restarts your application with your latest version you can also look at some metrics here um kind of useful I don't know I haven't really seen a use for it yet and then you can do some settings as well but let's actually look at our application now and the change we added was like to remove this Bell icon so if I refresh the page it will delete that Bell icon I also did a bunch of styling changes so the the point I'm getting at is like it's really easy to deploy your application using a lot of these services like versel netlify Railway and I wanted to pick a service that also had like a database bundled into it because you could use something like Planet scale and have like a login to Planet scale and then a log into Railway app but honestly it's like I don't want to have to worry about logging into two different places to manage my resources it's much easier in terms of like development friction to like not have to log into all the different places in my opinion so I've been using that so far it's been pretty smooth experience no no concerns about it yet it seems like it's pretty cheap so if you're looking for a quick way to like host something check out Railway app um create an account and like log log in look at your GitHub repo and see how seamless it is to get stuff deployed you can also set up environment variables too so this is how I'm connecting my Railway app to my database I just have like a database URL here and then some additional stuff here yeah hope you guys enjoyed this little overview I know I didn't really show much about how to get it set up but I mean it's pretty easy it's so intuitive to like create an account and get something deployed so check it out if you're ever looking for a cheap or kind of a free tier way to deploy your application um yeah go on my Discord if you want to ask me questions Direct
Info
Channel: Web Dev Cody
Views: 23,248
Rating: undefined out of 5
Keywords: web development, programming, coding, code, learn to code, tutorial, software engineering
Id: fOhw2Yt7yk4
Channel Id: undefined
Length: 7min 0sec (420 seconds)
Published: Mon Oct 03 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.