Build a SaaS With Cursor AI & Self-Host App + Database on One Server (Coolify) — Transcript
Full transcript
- 0:00All right. So today in this video, I'm
- 0:02going to show you how we can build an
- 0:04app or a web app using AI. And not only
- 0:07that, but also self-host and deploy it
- 0:10on a VPS. And now now that we have a lot
- 0:12of these AI coding tools floating
- 0:14around, creating an app is pretty simple
- 0:16and straightforward, right? You just go
- 0:18ahead and give a couple of prompts, hit
- 0:20enter, and follow the instructions given
- 0:22by AI. And in about 30 minutes or let's
- 0:24say 1 hour you will have like a basic
- 0:26MVP already ready with the database you
- 0:29know uh authentication front end back
- 0:30end API all that but the real problem
- 0:33begins when you want to deploy it make
- 0:35it live on the internet and make it
- 0:37production ready and again one more
- 0:39problem here is that if you go ahead and
- 0:41rely on hosted services like let's say
- 0:44superbase or cell for deployment the
- 0:46bills can quickly add up and the free
- 0:48plans have certain limitations as well.
- 0:50So the primary focus of this video is
- 0:52not going to be building the app but
- 0:55instead after building the app, how do
- 0:56we go about deploying and making it live
- 0:59on a VPS. So basically we'll use coolify
- 1:02to not only host your application but
- 1:04also the database as well. That means
- 1:06you don't have to pay for superbase or
- 1:08use any other provider. So pretty much
- 1:10all the services that we use for our app
- 1:12stays within our own VPS and we can
- 1:14manage it and again it will be pretty
- 1:16cheap and affordable too. And if that
- 1:18sounds interesting, without wasting any
- 1:19more time, let's simply get started. So
- 1:21here I have opened up the websites of
- 1:23apps and services that we will be using
- 1:25in today's video. So first of all, I'm
- 1:27planning to create the app using cursor
- 1:30AI. So if you don't already have cursor
- 1:32installed, you can head over to
- 1:33cursor.com and download it for your
- 1:35computer and install the same. And next
- 1:37step for database, we'll be using
- 1:39superbase. But no, we won't be directly
- 1:41using it via superbase.com. But I mean a
- 1:44lot of you might already know that
- 1:45Superbase is actually a open source
- 1:47project and you have the option to
- 1:49self-host it on your own VPS and then
- 1:51use it right and that is the exact
- 1:53method that we will be following in this
- 1:54video. So basically we'll get a VPS and
- 1:57then also self-host superbase and I'll
- 1:59show you how to do that later in this
- 2:01video. And next up we'll also use Kify
- 2:03for deployment right. So for deploying
- 2:05our app and also to deploy uh superbase
- 2:08we'll be using Koolify and Koolifi is
- 2:11like you know an alternative to Versel
- 2:13but the good thing is that if you own a
- 2:14VPS you can first add Kify and you can
- 2:17get a interface and functionality
- 2:19similar to Versel but for a fraction of
- 2:21the cost and that is the reason we are
- 2:23going to use Koolify and next up we
- 2:25obviously need a VPS to let's say deploy
- 2:28both our app and the database and also
- 2:31to install Kify and for that we'll be
- 2:33using Hostinger But you can use any
- 2:35cloud provider. But I felt Hostinger is
- 2:37pretty simple, straightforward and they
- 2:39even have one-click option to set up
- 2:41Koolify. So that's the cool thing. So if
- 2:43you manually want to install let's say
- 2:44Kify on a VPS, you can totally do that.
- 2:47But if you're about to use Hostinger in
- 2:49just a single click, you can install
- 2:50Koolify and then within just a single
- 2:52click right within Kify, we can install
- 2:54Superbase as well. And again, this is
- 2:56going to be a NextJS based project.
- 2:58Okay. So here I have the NextJS uh
- 3:01website opened up as well. And if you go
- 3:02ahead and copy this command right here
- 3:04and if you open terminal and run this
- 3:06particular command, you'll be able to
- 3:07set up a new nex.js project. So here I
- 3:10have already opened up cursor and I
- 3:12opened up a folder called as habit and
- 3:15then I ran that particular uh command.
- 3:17Okay, there you go. pnpx create next app
- 3:20at latest. So I just created a blank
- 3:22folder, opened it up in cursor and I ran
- 3:24that particular command and here we have
- 3:26next.js setup. And if I run pnpm rundev
- 3:29and hit enter. Okay, it's in localhost
- 3:333001 because I already have a dub server
- 3:35running in 3000. But this right here is
- 3:37the boilerplate page of Nex.js and the
- 3:39nextjs project is already set up. So
- 3:41basically if you want to create a react
- 3:43based project or view or swelt whatever
- 3:45that is you can follow along but in this
- 3:47case I plan to use nextjs and I just
- 3:49installed nextjs as well. And now here
- 3:51we have the app ready right. And again
- 3:54as I mentioned in the beginning of the
- 3:56video this video is focused more on the
- 3:58deployment part like setting up the
- 3:59database and also you know uh deploying
- 4:02the actual app on the internet like in
- 4:04Koolifi on a VPS. And for the same
- 4:06reason I'll be only creating like a very
- 4:08simple and basic app. I am planning to
- 4:10create a habit tracker by the way. But
- 4:12in your case you can build whatever app
- 4:14that you want to and include all the
- 4:16features that you want to. It's totally
- 4:18okay. But just for demonstration purpose
- 4:19and also to make it quick, I'll just
- 4:21create a habit tracker app. And now that
- 4:23we have the project opened up in cursor,
- 4:25I'll open the agent panel and give a
- 4:27simple prompt. So in this case, I'll say
- 4:30I want to build a habit tracker app. So
- 4:33I have already set up a blank next.js
- 4:35project and you can take it up from
- 4:36here.
- 4:38Okay. So I'll just say I want to build a
- 4:40habit tracker app and let's see how far
- 4:42cursor will take it. And now I'll hit
- 4:44enter. And again we'll actually want to
- 4:46use superbase. But after the initial
- 4:48version of the app is ready, we can go
- 4:50ahead and get a VPS install qualify
- 4:52setup superbase. And then after that, we
- 4:55can configure our app to use a database.
- 4:57And once all of that is done, after the
- 4:59fully working version of the app is
- 5:00ready, I'll also show you how we can
- 5:02deploy the app to the same uh cooly
- 5:05instance. Okay. In which ways, as you
- 5:06can see, the AI has started working on
- 5:08the same and it has like okay planned
- 5:11like seven to-do items. Build
- 5:13authentication system. Okay. create
- 5:15protected dashboard. All right. So I'll
- 5:18click on run.
- 5:20Okay. In which it will take some time.
- 5:22So I'll wait for the AI to complete uh
- 5:24in implementing the initial version and
- 5:26I'll see you afterwards. Okay. It seems
- 5:27like the initial version is ready but we
- 5:29have some errors. So I'll just copy the
- 5:31error. Maybe I can stop it for now and I
- 5:34can simply enter that in here. Please
- 5:36fix the following error.
- 5:40Okay. Let's wait for cursor to fix the
- 5:42error first. All right. So the error is
- 5:44now fixed and this right here is the
- 5:45simple version of the habit tracker app
- 5:47that cursor has created and it has
- 5:50actually even added login I believe.
- 5:52Okay.
- 5:54So I believe it must be using let's say
- 5:57uh local storage for the time being in
- 5:59which let me try to sign up for a dummy
- 6:02account. Sign up. Okay.
- 6:08All right. So that is like a dummy
- 6:10login. We'll fix that later. But this
- 6:12writer is the simple version of the
- 6:13habit tracker the AI has created. And I
- 6:16can add a habit. Okay. So we have some
- 6:19bugs in here as well. So let me quickly
- 6:21go ahead and fix it. I can drag and drop
- 6:23the screenshot. When I click on the add
- 6:26habit button, a pop-up opens up. But I
- 6:29believe it has a transparent background
- 6:30and the content are not made visible
- 6:32properly. So please fix it. So yeah,
- 6:35I'll wait for the AI to fix all of this
- 6:36and you afterwards. All right. So seems
- 6:38like that's fixed. I can click on add
- 6:40habit. Okay. Maybe let's say workout
- 6:4530 minutes. Let's choose green. Why not,
- 6:48right? I can click on create habit. And
- 6:51there you go. The habit is added in
- 6:53here. So I can check it out. Okay. I can
- 6:56complete it. And if I want to, I can add
- 6:57a new habit. And here we have the basic
- 7:00version of the habit tracker ready.
- 7:01Right? And if I refresh. Okay. So right
- 7:04now this data is not getting discarded
- 7:06or let's say uh deleted because it's
- 7:08actually using local storage. Right? So
- 7:10all these data that we store in here
- 7:11like all the workload information, the
- 7:14name and all other details are being
- 7:16stored in the browser's local storage.
- 7:18But next up, this is where things get
- 7:20very interesting. So we want to add
- 7:21superbase so that we can store all these
- 7:23data into a database and also on a VPS.
- 7:26So the next important step is getting a
- 7:28VPS installing cooly then setting up uh
- 7:31superbase and then we'll go ahead and
- 7:33link that particular superbase instance
- 7:35to this app such that our app has a
- 7:37proper database and that to a
- 7:39self-hosted one. So for this the first
- 7:41thing that you have to do is to click
- 7:43the link in the description below and
- 7:44head over to hostinger.com and after
- 7:47that if you go to the services section
- 7:49here you can find an option that says
- 7:51VPS hosting. So I'll select the same and
- 7:53if I scroll down as you can see here we
- 7:55have a couple of plans. So in this case
- 7:57I'll go with the KVM2 plan but depending
- 7:59on how much let's say resources you need
- 8:01you can go ahead and select any of these
- 8:03plans. So for the time being I'll select
- 8:04the KVM2 plan. And by the way right now
- 8:07they have like Black Friday sales going
- 8:09on. So you can make use of that as well.
- 8:11So I'll get it for like 12 months. And
- 8:13now if you're about to use my coupon
- 8:15that is Astro you will get additional
- 8:1710% discount. So you can enter the
- 8:19coupon in here and apply the same. And
- 8:21there you go, instant 10% discount. Or
- 8:23if you're about to, let's say, purchase
- 8:25the VPS for 24 months. If you use the
- 8:28coupon that is Astro 15, you'll get
- 8:30additional 15% discount. So if you're
- 8:32planning to get a VPS from Hostinger,
- 8:34make sure you use these coupons. And now
- 8:36that we have Okay, I'll select it for 12
- 8:38months. I can enter my coupon. And the
- 8:42next thing that you have to do is to
- 8:43select the data center location. So it
- 8:45is the best if you could select a
- 8:47location that is closest to your target
- 8:49audience or let's say the people who
- 8:50like the most amount of people who visit
- 8:52your website. It would be best to keep
- 8:54the data center close to that particular
- 8:55region. But in this case I'll keep it as
- 8:57India. So in your case if it is
- 8:59different just select that from here.
- 9:00And this is the very important part. In
- 9:02the select operating system section if
- 9:04you move over to applications okay maybe
- 9:06I can search for it. You should search
- 9:08for something called as codify and
- 9:10you'll find something called as codify
- 9:11that is OS with panel. And you can click
- 9:13on the same and now click on confirm.
- 9:16Now the interesting thing about using
- 9:17hostinger is that in just a single click
- 9:19right now I selected cooly right and
- 9:21after I complete this purchase coolify
- 9:23will be automatically and already set up
- 9:25on my VPS and I can instantly start
- 9:27using it. If you were to let's say
- 9:28manually get a VPS and then try to
- 9:30install it. Then you'll have to go to
- 9:32the Koolifi documentations and you need
- 9:34to click on this get started button
- 9:35right here and then you'll have to
- 9:37follow all these documentations to
- 9:38install Koolify. But if you get a VPS
- 9:41from Hostinger in just a single click,
- 9:43you can get a VPS with Koolifi already
- 9:45configured. And all I have to do is to
- 9:47click on continue and complete the
- 9:49purchase. So here I'm now logged into my
- 9:51Hostinger HP panel account. And I can
- 9:53already find the uh VPS that I got. And
- 9:55I'll click on this manage button right
- 9:57here. And if this is your first time
- 9:59when you open this particular interface,
- 10:01the first thing that you have to do is
- 10:02to click on this particular option that
- 10:04says manage panel. And as soon as you
- 10:06click on the same, it will open up this
- 10:08qualify setup page. And the first thing
- 10:10that you have to do is to add a username
- 10:12and password for the administrator
- 10:14account. And after that, you'll be taken
- 10:16to a dashboard like this. Okay. So, make
- 10:18sure you are the first one to click on
- 10:20this particular manage panel button and
- 10:22reach the sign up page because the first
- 10:24user gets to create the administrator
- 10:26account. And now once that part is
- 10:27completed, this is going to be the kind
- 10:29of interface that you will see. And we
- 10:31already have like qualify part setup
- 10:32complete, right? So that's the
- 10:34interesting thing about using hostinger.
- 10:35And the next thing that you have to do
- 10:36is to click on this particular option to
- 10:38create a new project. You can give it a
- 10:40name description and click on continue.
- 10:42And in my case here I have already
- 10:44created a project and it is called my
- 10:45first project. So I'll open the same.
- 10:48And since we want to set up superbase
- 10:50the next thing that you have to do is to
- 10:52click on this particular button right
- 10:53here that says new. And now it will open
- 10:55up this particular page that says new
- 10:57resource. And you'll be able to
- 10:59self-host like a bunch of different
- 11:01stuff. So first of all if you want to
- 11:03let's say deploy your app you can select
- 11:05one of these option that is private
- 11:06repository connect your GitHub repo and
- 11:09then you can directly deploy your app
- 11:11which I'll show later in this video but
- 11:12right now we are planning to uh
- 11:15self-host superbase so I can search for
- 11:17superbase okay there you go here we have
- 11:20superbase I'll select the same
- 11:23and next step okay if you want to uh
- 11:25modify the service name the admin
- 11:27username or password you can just go
- 11:29ahead and configure all that details
- 11:31from this particular page and all you
- 11:33have to do is to click on this deploy
- 11:34button and in about 5 to 10 minutes the
- 11:37deployment process will be complete
- 11:38right so right now I'm not doing this
- 11:40because it will take like 10 minutes but
- 11:41if you want to customize any of these
- 11:43details like username or password you
- 11:45can do all that and click on this deploy
- 11:47button and your superbase will be
- 11:48deployed and once that's done if you
- 11:50head over to your project you'll find
- 11:53something like this so this one right
- 11:54here is a superbase project that I
- 11:56already set up so I can open it up and
- 11:59right now as you can see the deployment
- 12:00process process is now complete and here
- 12:02I have like superbase running. So pretty
- 12:04much everything works and now after
- 12:06superbase is deployed the next thing
- 12:08that you have to do is to obviously
- 12:10configure the same and again this right
- 12:12here is my dashboard username and
- 12:14password. So what I'll do is I'll click
- 12:15on this link option right here and click
- 12:17on this particular option and all I have
- 12:19to do is to enter my username and
- 12:21password. So I can copy this password I
- 12:24mean username and paste it in here and I
- 12:26can get my password and paste it in here
- 12:30and click on sign in. And there you go.
- 12:33We now have our superbase instance live
- 12:35already. And again this particular
- 12:37instance I used it for a different
- 12:39tutorial. So I will already have like a
- 12:41table but no issues. I'll delete it
- 12:43right away.
- 12:45Okay let me delete it. And
- 12:47authentication I can delete that as
- 12:49well. Okay. So once the deployment
- 12:52process is done, this is the state you
- 12:54will be in. Right? So we have zero
- 12:56users, zero tables, nothing whatsoever.
- 12:58And next thing that you have to do is to
- 13:00you need to connect this particular
- 13:01superbase instance to your app that
- 13:04you're building. Right? So right now we
- 13:06don't really have any authentication or
- 13:07database added to this particular
- 13:09project. Right? So this writer is our
- 13:11app. So next up we need to link this
- 13:13particular superbase project that is our
- 13:14self-hosted superbase project to the uh
- 13:17app that we're building. So what I'll do
- 13:18is I'll go ahead and say next step I
- 13:20want to add superbase for authentication
- 13:23and database and the thing here is that
- 13:25I'm using a self-hosted version of
- 13:27superbase. So I basically self-hosted uh
- 13:30superbase on a VPS and I'm planning to
- 13:32use the same. So can you please set up
- 13:34superbase on this application for
- 13:35authentication and database and also
- 13:37give me the SQL query to run to create
- 13:40all the required tables indexes and RLS
- 13:42policies as well.
- 13:44Okay. And now I'll click on this send
- 13:46button. And now what happens is that
- 13:48cursor will go ahead and set up and
- 13:50install the SuperbaseJS and you know SSR
- 13:53packages. So yeah, let's just wait for
- 13:56it. So it says I'll help you set up
- 13:58superbase for authentication and
- 13:59database in your habit tracking
- 14:01application. Okay, let's set up uh okay,
- 14:04it is right now installing the
- 14:06SuperbaseJS package. I'll click on run.
- 14:08And while cursor is implementing
- 14:10superbase, we need to link our superbase
- 14:12project that is this particular project
- 14:13to this particular app. So obviously
- 14:15I'll have to create a new env.local
- 14:18file. Okay, I can create the file in
- 14:20here and we need to get our superbase
- 14:22API key and also the URL and getting
- 14:25them is pretty simple. So towards the
- 14:27top you will find an option that says
- 14:29connect. So I can click on the same and
- 14:30now if I move over to app frameworks
- 14:33there you go. Here we already have all
- 14:34this content filled in for us. So here
- 14:36we have the next public superbase URL
- 14:38and also next public superbase anon key
- 14:41and these two are the things that we
- 14:43will need. So I'll simply copy the same
- 14:45just like that and now I can paste it in
- 14:48here and here we have added both of them
- 14:50and again if you're using an OM like
- 14:52let's say Prisma or DEL and if you want
- 14:54to connect directly you can get your
- 14:56connection string from here and add it
- 14:58as well. So make sure you replace your
- 14:59password in here. But in this case,
- 15:01we'll be using the SuperbaseJS client.
- 15:03And yeah, that is how we are planning.
- 15:05And yeah, that is how we are planning to
- 15:07do this. So let's just wait for it. All
- 15:10right. So there you go. So cursor is
- 15:12done implementing uh superbase for
- 15:15authentication and database. And it has
- 15:16even created a setup uh MD file and as
- 15:19you can see it is asking us to add the
- 15:22next public superbase URL and next
- 15:23public superbase anode key into.local
- 15:26local file which we have already done.
- 15:28So here we have both of them added and
- 15:30next step okay project ID got it and
- 15:33next up we need to run the SQL to create
- 15:36all the required tables. So as you can
- 15:38see here we have an SQL that uh cursor
- 15:41has created and it's called superbase
- 15:43schema.sql and now all I have to do is
- 15:46to just copy the entire content from
- 15:47here. And now I'll head back to
- 15:49Superbase. And here I can find an option
- 15:51that says SQL editor. And by the way, if
- 15:53I go to table editor right now, as you
- 15:55can see here, we don't have any tables
- 15:57yet. But as soon as I run this
- 15:59particular uh SQL that cursor has
- 16:01created, it will create a
- 16:03public.profiles table, then
- 16:05public.habits, habit completions, a
- 16:08couple of indexes, rls, okay, a policies
- 16:11and a bunch of stuff. And now all I have
- 16:13to do is to click on this run button
- 16:14right here. Run this query. And there
- 16:17you go. Success. No rows returned. And
- 16:19if I head back to table ed right now,
- 16:21I'll be able to find all these tables in
- 16:23here. So, habit completion, habit
- 16:25profiles, all of that is in here. And we
- 16:27don't really have any data yet. And if I
- 16:29go to let's say authentication, we don't
- 16:31really have any users either. And yeah,
- 16:34now what I'll do is I'll head back to
- 16:35our app. And there you go. It is now uh
- 16:38I mean right now if we only login, we'll
- 16:40be allowed to access our app. And it is
- 16:43taking us to the login page. But since
- 16:45we don't have an account, I'll try to
- 16:46sign up for an account. Let's give my
- 16:48name as Astro. Astroastro.com.
- 16:52Since we don't have email verification
- 16:53enabled, we can get away by giving like
- 16:55a dummy email and then a random
- 16:58password. And now I'll click on sign up.
- 17:01And there you go. I'm now logged in and
- 17:03it says welcome as true log out. So
- 17:05everything is in here. And now if I head
- 17:07back to Superbase and if I go to the
- 17:09authentication section here, I can
- 17:11already find the email that we used to
- 17:13sign up just now. And if I go to
- 17:15database, I mean as table editor here,
- 17:17we don't have anything yet. So the
- 17:19profile is created, but we don't have
- 17:20any habits or habits completion, right?
- 17:22So I'll just go ahead and try to create
- 17:24a new habit. Let's say drink water.
- 17:29Okay, no need of any descriptions. I can
- 17:31select a color pink maybe. Create habit.
- 17:34And there you go. Maybe another one.
- 17:37Let's say workout
- 17:4030 minutes workout.
- 17:44I'll give it let's say red create habit
- 17:46and that's also added. And now if I head
- 17:49back to our self-hosted version of
- 17:51superbase and if I refresh there you go
- 17:55both of them are in here and currently
- 17:57we haven't really completed any habits
- 17:59yet. So habit completions is empty. I
- 18:01can head back. I can mark it as
- 18:03completed the workout one. I'll just
- 18:06refresh it right away. And there you go.
- 18:08The same is updated in here. And if I
- 18:11complete this one too and if I refresh
- 18:14that's also done. So yeah that's how
- 18:16simple it is. So first of all we went
- 18:18ahead and created a nextjs project in
- 18:20cursor and then we got a VPS from
- 18:23hostinger set up qualify and installed
- 18:25superbase in that particular qualify
- 18:27instance. We got all the credentials and
- 18:29we set up authentication and database on
- 18:32our app and we linked everything
- 18:33together and right now our app has a
- 18:36proper database and authentication and
- 18:37pretty much everything works. And if you
- 18:39want to let's say make any sort of
- 18:40changes, add new let's say tables or any
- 18:43new features like uh enable or disable
- 18:46authentication methods. I mean if you
- 18:47want to do any of this like file storage
- 18:49etc. you'll be able to do all of that in
- 18:51here. And yeah this is the basic setup
- 18:53right and next step depending on exactly
- 18:55what you're looking for you can go ahead
- 18:57and add new features and just for
- 18:59demonstration purpose I created a simple
- 19:01habit tracker app and the next thing is
- 19:03obviously deploying the same and making
- 19:05it live on the internet. And again the
- 19:07interesting thing here is that we are
- 19:08planning to self-host and let's say
- 19:10deploy this particular app in the same
- 19:12VPS where we have configured superbase.
- 19:14And yes you heard it correct and for
- 19:16that the first thing that you have to do
- 19:18is to head over to github.com. And if
- 19:20you don't already have an account I
- 19:22don't know why you don't already have an
- 19:23account but just go ahead and sign up
- 19:25for a new account and click on this new
- 19:27option to create a new repository. And I
- 19:29will give it a name. Let's say habit
- 19:31tracker. I'll keep it as private for the
- 19:34time being. I can click on create
- 19:36repository.
- 19:39All right. And after that I can simply
- 19:40copy all of this. Right. So every single
- 19:43one of these lines I can copy the same
- 19:44open cursor. And if I can Okay. I'll
- 19:48open a new terminal instance. Paste all
- 19:50of that in here. Hit enter. All right.
- 19:54Okay. It's completed. And if I refresh,
- 19:57there you go. Our initial commit is in
- 19:59here. And by the way, none of the
- 20:01changes that we made is committed in
- 20:02here. Only the blank NexJS project. And
- 20:04next what I'll do is I'll just go ahead
- 20:06and create our commit. App implemented
- 20:10fully. Okay. And I'll click on commit.
- 20:13I'll click on sync changes. Click on
- 20:15okay.
- 20:17Let's wait for it. Okay. That's done.
- 20:19And if I refresh.
- 20:21There you go. App implemented fully. And
- 20:24here we have all the files. And we
- 20:26pretty much pushed everything. And again
- 20:28here we have a file called asenb.
- 20:31But the same is not pushed into our
- 20:33GitHub repo. That's because we have
- 20:34added and excluded that in our git
- 20:37ignore file. There you go. So that won't
- 20:38be uh pushed. And right now what we did
- 20:40is that we had the project locally in
- 20:42our computer. Right now we just went
- 20:44ahead and created a GitHub repo and
- 20:46pushed all the changes that we made to
- 20:48this particular point to this GitHub
- 20:49repo right here. And if you want to make
- 20:52your life a whole lot easier, you should
- 20:54definitely do this. Just make sure you
- 20:55regularly push all your changes. And
- 20:57next step to deploy it, all I have to do
- 20:59is to head back to my Koolify account.
- 21:01And after that, I'll click on projects.
- 21:03So I can leave my superbase project as
- 21:05it is and okay maybe I can create my
- 21:07project inside of this particular uh
- 21:09project itself. In which choice I'll go
- 21:10ahead and select the project and this
- 21:12right here is our active superbase. And
- 21:14now I'll click on new to create a
- 21:16deployment for our app. And now in this
- 21:19case all you have to do is to select
- 21:20this particular option that says private
- 21:22repository with GitHub app. So I'll
- 21:24click on the same
- 21:26and I'll click on this particular option
- 21:28that says add GitHub app. So if this is
- 21:30your first time, this is going to be the
- 21:32kind of interface that you will see. So
- 21:33I'll click on add GitHub app. Can name
- 21:36doesn't matter. I'll click on continue.
- 21:39And now I'll click on this particular
- 21:41option that says register now.
- 21:44And just log to your GitHub account.
- 21:47I'll click on confirm.
- 21:49I'll create app.
- 21:54Okay. So that part is done. And now I'll
- 21:56click on install repositories on GitHub
- 21:58button right here.
- 22:00It will take me to this page right here.
- 22:02And you have two options. If you want to
- 22:04give access to all the repos within your
- 22:06GitHub account, you can select the first
- 22:07option that says all repositories. But
- 22:09in this case, I'm only giving access to
- 22:11the particular repo that I want to use.
- 22:13So if you're comfortable giving access
- 22:14to all the repo, you can do that. But in
- 22:16this case, I'll just go ahead and select
- 22:18the one that we created just now, which
- 22:20is the habit uh tracker one. So let me
- 22:23select that real quick. Habit tracker.
- 22:26I'll click on install.
- 22:29Okay. So that part is now complete. And
- 22:32now, okay, there you go. I can click on
- 22:34save. And if I go to projects again,
- 22:37select the project, click on new,
- 22:40click on private repository. Now I'll be
- 22:43able to find the GitHub app that we
- 22:45added. So I'll click on the same. Since
- 22:46we only gave access to this particular
- 22:48repo, I can find it in here. But if you
- 22:50have like a lot of repos and you gave
- 22:52access to all of them, then if you click
- 22:53on this dropown menu, you'll be able to
- 22:55find all of that in here and select the
- 22:56one that you want to deploy. So I'll
- 22:58select this one right here and I'll
- 22:59click on this particular option that
- 23:00says load repository. So branch I'll
- 23:03keep it as main base directory port. All
- 23:05of this looks good. And if you have
- 23:06multiple branch make sure to select the
- 23:08one. So in this case we only have like
- 23:09one. This is a basic and simple app. And
- 23:11no this is not a static site. So do not
- 23:14uh enable this option. And now I'll
- 23:16click on continue.
- 23:19And there you go. Here you can find
- 23:21further details. For example configuring
- 23:23the domain name. Okay name description
- 23:25and all that. But if you right away go
- 23:27ahead and try to deploy it just like
- 23:28this and if you deploy it your app won't
- 23:31work. That's because we haven't really
- 23:33added this environment variables. So as
- 23:35you can see here we have two of them
- 23:36that is uh okay maybe I can make it a
- 23:39bit bigger.
- 23:41Next up we need to add the next public
- 23:43superbase URL and superbase anon key. So
- 23:45what I'll do is I'll just go ahead and
- 23:47copy the first line and I'll click on
- 23:50this particular option that says
- 23:51environment variables.
- 23:54And now I can click on add.
- 23:57I'll paste the same in here.
- 24:01Okay.
- 24:03So the superbase URL is added and I'll
- 24:05click on save. And next step I'll repeat
- 24:08the same for the second one as well
- 24:10which is our superbase anon key. I'll
- 24:13paste it in here.
- 24:18Copy the value. Paste it in here. There
- 24:21you go. And now I'll click on save.
- 24:24All right. So both of them are added
- 24:25that is next public superbase addon key
- 24:27and next public superbase URL. So that
- 24:29is configured and again if you want to
- 24:31let's say change any of these like okay
- 24:33we can later change the domain but for
- 24:35now that looks good. So all of this
- 24:37looks good and now okay just making sure
- 24:39we have the envy main variables added
- 24:43superb key superb URL okay and now what
- 24:46I'll do is I'll click on this particular
- 24:47option towards the top that says deploy
- 24:51and the deployment process has started
- 24:53and it will take some time so all you
- 24:55have to do is to sit back and wait and
- 24:57after the deployment is complete you'll
- 24:59be able to access your app so I'll wait
- 25:01for some time and I'll see you
- 25:02afterwards so there you go the
- 25:04deployment is finished and pretty pretty
- 25:06much everything should work I believe so
- 25:08let's see so right now this right here
- 25:10is the domain of our app by the way and
- 25:12if I visited this particular domain and
- 25:14if I hit enter there you go here we have
- 25:17our app and this right here is our app
- 25:19running in local host and this right
- 25:21here is on our deployed version don't
- 25:23worry I'll also show you how we can
- 25:24change the domain name and next up I'll
- 25:26click on this get started button and try
- 25:28to create a new account let's give it a
- 25:31name Astro 2 astro2
- 25:33at the rateastro.com
- 25:36the password
- 25:39confirm password click on sign up okay
- 25:43there you go I'm now logged in and if I
- 25:45head back authentication here we have
- 25:48the newly created account
- 25:50I can create a dummy item in here create
- 25:54habit that's added maybe I can check
- 25:56this for nowad back to database I mean
- 25:59table editor
- 26:01uh refresh there you go So pretty much
- 26:05everything works. Okay. So yeah the
- 26:08deployment that is our superbase project
- 26:09is even working on the deployed version
- 26:11of the app. So just like that we have
- 26:13set up and deployed our app on the same
- 26:15server where we have our database as
- 26:18well. Yeah. And again your app is going
- 26:20to be lightning fast because both your
- 26:22database and your app is on the same
- 26:23server. And I don't believe it is
- 26:25necessarily a good thing to have both of
- 26:27them in the same server. But again if
- 26:29you want to do it this way you have the
- 26:30option. And right now this right here is
- 26:32the URL of our app and it doesn't look
- 26:35good right now. If you already have a
- 26:37domain, you have the option to connect
- 26:39your own custom domain and add a custom
- 26:41domain in here. So for that, first of
- 26:43all, I'll log into my Cloudflare
- 26:45account. So here I have opened up my
- 26:46Cloudflare account and opened up the DNS
- 26:49settings for one of the domains that I
- 26:50own. So if you're not using Cloudflare,
- 26:52just log into your domain register or
- 26:54wherever you manage your DNS for your
- 26:56domain. And the next thing that you have
- 26:58to do is to head back to Coolify. And
- 27:00first of all, you need to get your
- 27:02server IP address. So if you head back
- 27:04to Hostinger, there you go. This right
- 27:06here is our server IP address. So I can
- 27:08simply copy the same. I can head back
- 27:11and then all I have to do is to create a
- 27:13new error code. So I can simply enter
- 27:15the name that is the root and then add
- 27:18my IP address in here. So in this case,
- 27:20I already have that and make sure it is
- 27:21an error code and I'll save it. So
- 27:24basically all you have to do is that you
- 27:25have to put the address symbol or let's
- 27:27say the root of your domain in here. it
- 27:28has to be error code and copy the IP
- 27:30address and paste it in here and we have
- 27:33saved the same and next step I'll head
- 27:35back to uh codify and I'll open our app
- 27:38deployment project and here in the
- 27:40domain section this right here is our
- 27:41domain and now what I'll do is I'll
- 27:44change that to https and in my case
- 27:46astrokj.com
- 27:49and I'll select this particular option
- 27:50that says redirect to nonwww
- 27:54and okay looks good and now I'll click
- 27:56on this save button right
- 27:58And after that you'll have to click on
- 28:00this redeploy option and then redeploy
- 28:02the project for the domain changes to
- 28:04take place. And once this redeployment
- 28:06is complete you'll be able to access
- 28:08your app on the domain that we just
- 28:10entered. So right now we are planning to
- 28:12use the main domain itself. But if you
- 28:13want to let's say u access it on a
- 28:16subdomain like something.youdomain.com
- 28:19well you can just set up a CN record and
- 28:21take it that way as well. In which case,
- 28:22let's wait for this deployment to
- 28:24complete and let's try to access our app
- 28:26from the domain that we just added. So
- 28:28there you go. The redeployment is now
- 28:30finished. And if I come back to
- 28:32configuration,
- 28:34uh let's see. So there you go. Right now
- 28:36our app address is our custom domain.
- 28:39And if I try to visit astrokj.com and
- 28:42hit enter, there you go. Our habit
- 28:44tracker is active under our own custom
- 28:46domain. And yeah, pretty much everything
- 28:48works. So I can click on login to log to
- 28:50my account or sign up for a new account.
- 28:53So pretty much everything works. So
- 28:54that's how simple it is. So we just
- 28:56basically went ahead and created an app
- 28:58using AI. And more importantly we
- 29:00installed Kify on a VPS and then we
- 29:02self-hosted both superbase and also
- 29:04deployed our app and that two on a
- 29:06custom domain. And now this is the
- 29:08overall flow if you want to build an app
- 29:10and also deploy the same. But depending
- 29:12on your use case now you can go ahead
- 29:13and make any sort of changes to the app
- 29:15and then deploy or let's say push all
- 29:16these changes to GitHub and Kify will
- 29:19pick up all those changes and do a
- 29:20redeployment for you such that whatever
- 29:22change that you push to GitHub will be
- 29:24automatically applied to your production
- 29:27deployment as well. So exact same
- 29:29feature that you get in versel. So
- 29:30that's pretty much all I wanted to show
- 29:32you in today's video. And again the
- 29:34whole idea or the whole point of this
- 29:35video was to show you this workflow and
- 29:37not necessarily about the app that I
- 29:39built. I know it's a basic and very
- 29:41simple app but the flow is that once you
- 29:43create your app you have the option to
- 29:45deploy it and not just the app you can
- 29:47also uh deploy the database that is
- 29:49superbase and also your app in the same
- 29:51VPS using coolify and this is the
- 29:53overall flow that you'll have to follow
- 29:55and that's pretty much all I wanted to
- 29:56show you in today's video I hope you
- 29:58guys found this video useful if yes make
- 30:00sure to subscribe and I'll see you in
- 30:01the next One.
About this transcript
This page contains the full transcript of Build a SaaS With Cursor AI & Self-Host App + Database on One Server (Coolify) by Astro K Joseph, generated from the public captions YouTube serves with the video. The transcript has 6,315 words across 856 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to choose a caption track available on the video.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, caption language selection, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.