YouTube2Text

Build a SaaS With Cursor AI & Self-Host App + Database on One Server (Coolify) — Transcript

by Astro K Joseph · 6,315 words · 856 segments · language en · Watch on YouTube

Full transcript

  1. 0:00All right. So today in this video, I'm
  2. 0:02going to show you how we can build an
  3. 0:04app or a web app using AI. And not only
  4. 0:07that, but also self-host and deploy it
  5. 0:10on a VPS. And now now that we have a lot
  6. 0:12of these AI coding tools floating
  7. 0:14around, creating an app is pretty simple
  8. 0:16and straightforward, right? You just go
  9. 0:18ahead and give a couple of prompts, hit
  10. 0:20enter, and follow the instructions given
  11. 0:22by AI. And in about 30 minutes or let's
  12. 0:24say 1 hour you will have like a basic
  13. 0:26MVP already ready with the database you
  14. 0:29know uh authentication front end back
  15. 0:30end API all that but the real problem
  16. 0:33begins when you want to deploy it make
  17. 0:35it live on the internet and make it
  18. 0:37production ready and again one more
  19. 0:39problem here is that if you go ahead and
  20. 0:41rely on hosted services like let's say
  21. 0:44superbase or cell for deployment the
  22. 0:46bills can quickly add up and the free
  23. 0:48plans have certain limitations as well.
  24. 0:50So the primary focus of this video is
  25. 0:52not going to be building the app but
  26. 0:55instead after building the app, how do
  27. 0:56we go about deploying and making it live
  28. 0:59on a VPS. So basically we'll use coolify
  29. 1:02to not only host your application but
  30. 1:04also the database as well. That means
  31. 1:06you don't have to pay for superbase or
  32. 1:08use any other provider. So pretty much
  33. 1:10all the services that we use for our app
  34. 1:12stays within our own VPS and we can
  35. 1:14manage it and again it will be pretty
  36. 1:16cheap and affordable too. And if that
  37. 1:18sounds interesting, without wasting any
  38. 1:19more time, let's simply get started. So
  39. 1:21here I have opened up the websites of
  40. 1:23apps and services that we will be using
  41. 1:25in today's video. So first of all, I'm
  42. 1:27planning to create the app using cursor
  43. 1:30AI. So if you don't already have cursor
  44. 1:32installed, you can head over to
  45. 1:33cursor.com and download it for your
  46. 1:35computer and install the same. And next
  47. 1:37step for database, we'll be using
  48. 1:39superbase. But no, we won't be directly
  49. 1:41using it via superbase.com. But I mean a
  50. 1:44lot of you might already know that
  51. 1:45Superbase is actually a open source
  52. 1:47project and you have the option to
  53. 1:49self-host it on your own VPS and then
  54. 1:51use it right and that is the exact
  55. 1:53method that we will be following in this
  56. 1:54video. So basically we'll get a VPS and
  57. 1:57then also self-host superbase and I'll
  58. 1:59show you how to do that later in this
  59. 2:01video. And next up we'll also use Kify
  60. 2:03for deployment right. So for deploying
  61. 2:05our app and also to deploy uh superbase
  62. 2:08we'll be using Koolify and Koolifi is
  63. 2:11like you know an alternative to Versel
  64. 2:13but the good thing is that if you own a
  65. 2:14VPS you can first add Kify and you can
  66. 2:17get a interface and functionality
  67. 2:19similar to Versel but for a fraction of
  68. 2:21the cost and that is the reason we are
  69. 2:23going to use Koolify and next up we
  70. 2:25obviously need a VPS to let's say deploy
  71. 2:28both our app and the database and also
  72. 2:31to install Kify and for that we'll be
  73. 2:33using Hostinger But you can use any
  74. 2:35cloud provider. But I felt Hostinger is
  75. 2:37pretty simple, straightforward and they
  76. 2:39even have one-click option to set up
  77. 2:41Koolify. So that's the cool thing. So if
  78. 2:43you manually want to install let's say
  79. 2:44Kify on a VPS, you can totally do that.
  80. 2:47But if you're about to use Hostinger in
  81. 2:49just a single click, you can install
  82. 2:50Koolify and then within just a single
  83. 2:52click right within Kify, we can install
  84. 2:54Superbase as well. And again, this is
  85. 2:56going to be a NextJS based project.
  86. 2:58Okay. So here I have the NextJS uh
  87. 3:01website opened up as well. And if you go
  88. 3:02ahead and copy this command right here
  89. 3:04and if you open terminal and run this
  90. 3:06particular command, you'll be able to
  91. 3:07set up a new nex.js project. So here I
  92. 3:10have already opened up cursor and I
  93. 3:12opened up a folder called as habit and
  94. 3:15then I ran that particular uh command.
  95. 3:17Okay, there you go. pnpx create next app
  96. 3:20at latest. So I just created a blank
  97. 3:22folder, opened it up in cursor and I ran
  98. 3:24that particular command and here we have
  99. 3:26next.js setup. And if I run pnpm rundev
  100. 3:29and hit enter. Okay, it's in localhost
  101. 3:333001 because I already have a dub server
  102. 3:35running in 3000. But this right here is
  103. 3:37the boilerplate page of Nex.js and the
  104. 3:39nextjs project is already set up. So
  105. 3:41basically if you want to create a react
  106. 3:43based project or view or swelt whatever
  107. 3:45that is you can follow along but in this
  108. 3:47case I plan to use nextjs and I just
  109. 3:49installed nextjs as well. And now here
  110. 3:51we have the app ready right. And again
  111. 3:54as I mentioned in the beginning of the
  112. 3:56video this video is focused more on the
  113. 3:58deployment part like setting up the
  114. 3:59database and also you know uh deploying
  115. 4:02the actual app on the internet like in
  116. 4:04Koolifi on a VPS. And for the same
  117. 4:06reason I'll be only creating like a very
  118. 4:08simple and basic app. I am planning to
  119. 4:10create a habit tracker by the way. But
  120. 4:12in your case you can build whatever app
  121. 4:14that you want to and include all the
  122. 4:16features that you want to. It's totally
  123. 4:18okay. But just for demonstration purpose
  124. 4:19and also to make it quick, I'll just
  125. 4:21create a habit tracker app. And now that
  126. 4:23we have the project opened up in cursor,
  127. 4:25I'll open the agent panel and give a
  128. 4:27simple prompt. So in this case, I'll say
  129. 4:30I want to build a habit tracker app. So
  130. 4:33I have already set up a blank next.js
  131. 4:35project and you can take it up from
  132. 4:36here.
  133. 4:38Okay. So I'll just say I want to build a
  134. 4:40habit tracker app and let's see how far
  135. 4:42cursor will take it. And now I'll hit
  136. 4:44enter. And again we'll actually want to
  137. 4:46use superbase. But after the initial
  138. 4:48version of the app is ready, we can go
  139. 4:50ahead and get a VPS install qualify
  140. 4:52setup superbase. And then after that, we
  141. 4:55can configure our app to use a database.
  142. 4:57And once all of that is done, after the
  143. 4:59fully working version of the app is
  144. 5:00ready, I'll also show you how we can
  145. 5:02deploy the app to the same uh cooly
  146. 5:05instance. Okay. In which ways, as you
  147. 5:06can see, the AI has started working on
  148. 5:08the same and it has like okay planned
  149. 5:11like seven to-do items. Build
  150. 5:13authentication system. Okay. create
  151. 5:15protected dashboard. All right. So I'll
  152. 5:18click on run.
  153. 5:20Okay. In which it will take some time.
  154. 5:22So I'll wait for the AI to complete uh
  155. 5:24in implementing the initial version and
  156. 5:26I'll see you afterwards. Okay. It seems
  157. 5:27like the initial version is ready but we
  158. 5:29have some errors. So I'll just copy the
  159. 5:31error. Maybe I can stop it for now and I
  160. 5:34can simply enter that in here. Please
  161. 5:36fix the following error.
  162. 5:40Okay. Let's wait for cursor to fix the
  163. 5:42error first. All right. So the error is
  164. 5:44now fixed and this right here is the
  165. 5:45simple version of the habit tracker app
  166. 5:47that cursor has created and it has
  167. 5:50actually even added login I believe.
  168. 5:52Okay.
  169. 5:54So I believe it must be using let's say
  170. 5:57uh local storage for the time being in
  171. 5:59which let me try to sign up for a dummy
  172. 6:02account. Sign up. Okay.
  173. 6:08All right. So that is like a dummy
  174. 6:10login. We'll fix that later. But this
  175. 6:12writer is the simple version of the
  176. 6:13habit tracker the AI has created. And I
  177. 6:16can add a habit. Okay. So we have some
  178. 6:19bugs in here as well. So let me quickly
  179. 6:21go ahead and fix it. I can drag and drop
  180. 6:23the screenshot. When I click on the add
  181. 6:26habit button, a pop-up opens up. But I
  182. 6:29believe it has a transparent background
  183. 6:30and the content are not made visible
  184. 6:32properly. So please fix it. So yeah,
  185. 6:35I'll wait for the AI to fix all of this
  186. 6:36and you afterwards. All right. So seems
  187. 6:38like that's fixed. I can click on add
  188. 6:40habit. Okay. Maybe let's say workout
  189. 6:4530 minutes. Let's choose green. Why not,
  190. 6:48right? I can click on create habit. And
  191. 6:51there you go. The habit is added in
  192. 6:53here. So I can check it out. Okay. I can
  193. 6:56complete it. And if I want to, I can add
  194. 6:57a new habit. And here we have the basic
  195. 7:00version of the habit tracker ready.
  196. 7:01Right? And if I refresh. Okay. So right
  197. 7:04now this data is not getting discarded
  198. 7:06or let's say uh deleted because it's
  199. 7:08actually using local storage. Right? So
  200. 7:10all these data that we store in here
  201. 7:11like all the workload information, the
  202. 7:14name and all other details are being
  203. 7:16stored in the browser's local storage.
  204. 7:18But next up, this is where things get
  205. 7:20very interesting. So we want to add
  206. 7:21superbase so that we can store all these
  207. 7:23data into a database and also on a VPS.
  208. 7:26So the next important step is getting a
  209. 7:28VPS installing cooly then setting up uh
  210. 7:31superbase and then we'll go ahead and
  211. 7:33link that particular superbase instance
  212. 7:35to this app such that our app has a
  213. 7:37proper database and that to a
  214. 7:39self-hosted one. So for this the first
  215. 7:41thing that you have to do is to click
  216. 7:43the link in the description below and
  217. 7:44head over to hostinger.com and after
  218. 7:47that if you go to the services section
  219. 7:49here you can find an option that says
  220. 7:51VPS hosting. So I'll select the same and
  221. 7:53if I scroll down as you can see here we
  222. 7:55have a couple of plans. So in this case
  223. 7:57I'll go with the KVM2 plan but depending
  224. 7:59on how much let's say resources you need
  225. 8:01you can go ahead and select any of these
  226. 8:03plans. So for the time being I'll select
  227. 8:04the KVM2 plan. And by the way right now
  228. 8:07they have like Black Friday sales going
  229. 8:09on. So you can make use of that as well.
  230. 8:11So I'll get it for like 12 months. And
  231. 8:13now if you're about to use my coupon
  232. 8:15that is Astro you will get additional
  233. 8:1710% discount. So you can enter the
  234. 8:19coupon in here and apply the same. And
  235. 8:21there you go, instant 10% discount. Or
  236. 8:23if you're about to, let's say, purchase
  237. 8:25the VPS for 24 months. If you use the
  238. 8:28coupon that is Astro 15, you'll get
  239. 8:30additional 15% discount. So if you're
  240. 8:32planning to get a VPS from Hostinger,
  241. 8:34make sure you use these coupons. And now
  242. 8:36that we have Okay, I'll select it for 12
  243. 8:38months. I can enter my coupon. And the
  244. 8:42next thing that you have to do is to
  245. 8:43select the data center location. So it
  246. 8:45is the best if you could select a
  247. 8:47location that is closest to your target
  248. 8:49audience or let's say the people who
  249. 8:50like the most amount of people who visit
  250. 8:52your website. It would be best to keep
  251. 8:54the data center close to that particular
  252. 8:55region. But in this case I'll keep it as
  253. 8:57India. So in your case if it is
  254. 8:59different just select that from here.
  255. 9:00And this is the very important part. In
  256. 9:02the select operating system section if
  257. 9:04you move over to applications okay maybe
  258. 9:06I can search for it. You should search
  259. 9:08for something called as codify and
  260. 9:10you'll find something called as codify
  261. 9:11that is OS with panel. And you can click
  262. 9:13on the same and now click on confirm.
  263. 9:16Now the interesting thing about using
  264. 9:17hostinger is that in just a single click
  265. 9:19right now I selected cooly right and
  266. 9:21after I complete this purchase coolify
  267. 9:23will be automatically and already set up
  268. 9:25on my VPS and I can instantly start
  269. 9:27using it. If you were to let's say
  270. 9:28manually get a VPS and then try to
  271. 9:30install it. Then you'll have to go to
  272. 9:32the Koolifi documentations and you need
  273. 9:34to click on this get started button
  274. 9:35right here and then you'll have to
  275. 9:37follow all these documentations to
  276. 9:38install Koolify. But if you get a VPS
  277. 9:41from Hostinger in just a single click,
  278. 9:43you can get a VPS with Koolifi already
  279. 9:45configured. And all I have to do is to
  280. 9:47click on continue and complete the
  281. 9:49purchase. So here I'm now logged into my
  282. 9:51Hostinger HP panel account. And I can
  283. 9:53already find the uh VPS that I got. And
  284. 9:55I'll click on this manage button right
  285. 9:57here. And if this is your first time
  286. 9:59when you open this particular interface,
  287. 10:01the first thing that you have to do is
  288. 10:02to click on this particular option that
  289. 10:04says manage panel. And as soon as you
  290. 10:06click on the same, it will open up this
  291. 10:08qualify setup page. And the first thing
  292. 10:10that you have to do is to add a username
  293. 10:12and password for the administrator
  294. 10:14account. And after that, you'll be taken
  295. 10:16to a dashboard like this. Okay. So, make
  296. 10:18sure you are the first one to click on
  297. 10:20this particular manage panel button and
  298. 10:22reach the sign up page because the first
  299. 10:24user gets to create the administrator
  300. 10:26account. And now once that part is
  301. 10:27completed, this is going to be the kind
  302. 10:29of interface that you will see. And we
  303. 10:31already have like qualify part setup
  304. 10:32complete, right? So that's the
  305. 10:34interesting thing about using hostinger.
  306. 10:35And the next thing that you have to do
  307. 10:36is to click on this particular option to
  308. 10:38create a new project. You can give it a
  309. 10:40name description and click on continue.
  310. 10:42And in my case here I have already
  311. 10:44created a project and it is called my
  312. 10:45first project. So I'll open the same.
  313. 10:48And since we want to set up superbase
  314. 10:50the next thing that you have to do is to
  315. 10:52click on this particular button right
  316. 10:53here that says new. And now it will open
  317. 10:55up this particular page that says new
  318. 10:57resource. And you'll be able to
  319. 10:59self-host like a bunch of different
  320. 11:01stuff. So first of all if you want to
  321. 11:03let's say deploy your app you can select
  322. 11:05one of these option that is private
  323. 11:06repository connect your GitHub repo and
  324. 11:09then you can directly deploy your app
  325. 11:11which I'll show later in this video but
  326. 11:12right now we are planning to uh
  327. 11:15self-host superbase so I can search for
  328. 11:17superbase okay there you go here we have
  329. 11:20superbase I'll select the same
  330. 11:23and next step okay if you want to uh
  331. 11:25modify the service name the admin
  332. 11:27username or password you can just go
  333. 11:29ahead and configure all that details
  334. 11:31from this particular page and all you
  335. 11:33have to do is to click on this deploy
  336. 11:34button and in about 5 to 10 minutes the
  337. 11:37deployment process will be complete
  338. 11:38right so right now I'm not doing this
  339. 11:40because it will take like 10 minutes but
  340. 11:41if you want to customize any of these
  341. 11:43details like username or password you
  342. 11:45can do all that and click on this deploy
  343. 11:47button and your superbase will be
  344. 11:48deployed and once that's done if you
  345. 11:50head over to your project you'll find
  346. 11:53something like this so this one right
  347. 11:54here is a superbase project that I
  348. 11:56already set up so I can open it up and
  349. 11:59right now as you can see the deployment
  350. 12:00process process is now complete and here
  351. 12:02I have like superbase running. So pretty
  352. 12:04much everything works and now after
  353. 12:06superbase is deployed the next thing
  354. 12:08that you have to do is to obviously
  355. 12:10configure the same and again this right
  356. 12:12here is my dashboard username and
  357. 12:14password. So what I'll do is I'll click
  358. 12:15on this link option right here and click
  359. 12:17on this particular option and all I have
  360. 12:19to do is to enter my username and
  361. 12:21password. So I can copy this password I
  362. 12:24mean username and paste it in here and I
  363. 12:26can get my password and paste it in here
  364. 12:30and click on sign in. And there you go.
  365. 12:33We now have our superbase instance live
  366. 12:35already. And again this particular
  367. 12:37instance I used it for a different
  368. 12:39tutorial. So I will already have like a
  369. 12:41table but no issues. I'll delete it
  370. 12:43right away.
  371. 12:45Okay let me delete it. And
  372. 12:47authentication I can delete that as
  373. 12:49well. Okay. So once the deployment
  374. 12:52process is done, this is the state you
  375. 12:54will be in. Right? So we have zero
  376. 12:56users, zero tables, nothing whatsoever.
  377. 12:58And next thing that you have to do is to
  378. 13:00you need to connect this particular
  379. 13:01superbase instance to your app that
  380. 13:04you're building. Right? So right now we
  381. 13:06don't really have any authentication or
  382. 13:07database added to this particular
  383. 13:09project. Right? So this writer is our
  384. 13:11app. So next up we need to link this
  385. 13:13particular superbase project that is our
  386. 13:14self-hosted superbase project to the uh
  387. 13:17app that we're building. So what I'll do
  388. 13:18is I'll go ahead and say next step I
  389. 13:20want to add superbase for authentication
  390. 13:23and database and the thing here is that
  391. 13:25I'm using a self-hosted version of
  392. 13:27superbase. So I basically self-hosted uh
  393. 13:30superbase on a VPS and I'm planning to
  394. 13:32use the same. So can you please set up
  395. 13:34superbase on this application for
  396. 13:35authentication and database and also
  397. 13:37give me the SQL query to run to create
  398. 13:40all the required tables indexes and RLS
  399. 13:42policies as well.
  400. 13:44Okay. And now I'll click on this send
  401. 13:46button. And now what happens is that
  402. 13:48cursor will go ahead and set up and
  403. 13:50install the SuperbaseJS and you know SSR
  404. 13:53packages. So yeah, let's just wait for
  405. 13:56it. So it says I'll help you set up
  406. 13:58superbase for authentication and
  407. 13:59database in your habit tracking
  408. 14:01application. Okay, let's set up uh okay,
  409. 14:04it is right now installing the
  410. 14:06SuperbaseJS package. I'll click on run.
  411. 14:08And while cursor is implementing
  412. 14:10superbase, we need to link our superbase
  413. 14:12project that is this particular project
  414. 14:13to this particular app. So obviously
  415. 14:15I'll have to create a new env.local
  416. 14:18file. Okay, I can create the file in
  417. 14:20here and we need to get our superbase
  418. 14:22API key and also the URL and getting
  419. 14:25them is pretty simple. So towards the
  420. 14:27top you will find an option that says
  421. 14:29connect. So I can click on the same and
  422. 14:30now if I move over to app frameworks
  423. 14:33there you go. Here we already have all
  424. 14:34this content filled in for us. So here
  425. 14:36we have the next public superbase URL
  426. 14:38and also next public superbase anon key
  427. 14:41and these two are the things that we
  428. 14:43will need. So I'll simply copy the same
  429. 14:45just like that and now I can paste it in
  430. 14:48here and here we have added both of them
  431. 14:50and again if you're using an OM like
  432. 14:52let's say Prisma or DEL and if you want
  433. 14:54to connect directly you can get your
  434. 14:56connection string from here and add it
  435. 14:58as well. So make sure you replace your
  436. 14:59password in here. But in this case,
  437. 15:01we'll be using the SuperbaseJS client.
  438. 15:03And yeah, that is how we are planning.
  439. 15:05And yeah, that is how we are planning to
  440. 15:07do this. So let's just wait for it. All
  441. 15:10right. So there you go. So cursor is
  442. 15:12done implementing uh superbase for
  443. 15:15authentication and database. And it has
  444. 15:16even created a setup uh MD file and as
  445. 15:19you can see it is asking us to add the
  446. 15:22next public superbase URL and next
  447. 15:23public superbase anode key into.local
  448. 15:26local file which we have already done.
  449. 15:28So here we have both of them added and
  450. 15:30next step okay project ID got it and
  451. 15:33next up we need to run the SQL to create
  452. 15:36all the required tables. So as you can
  453. 15:38see here we have an SQL that uh cursor
  454. 15:41has created and it's called superbase
  455. 15:43schema.sql and now all I have to do is
  456. 15:46to just copy the entire content from
  457. 15:47here. And now I'll head back to
  458. 15:49Superbase. And here I can find an option
  459. 15:51that says SQL editor. And by the way, if
  460. 15:53I go to table editor right now, as you
  461. 15:55can see here, we don't have any tables
  462. 15:57yet. But as soon as I run this
  463. 15:59particular uh SQL that cursor has
  464. 16:01created, it will create a
  465. 16:03public.profiles table, then
  466. 16:05public.habits, habit completions, a
  467. 16:08couple of indexes, rls, okay, a policies
  468. 16:11and a bunch of stuff. And now all I have
  469. 16:13to do is to click on this run button
  470. 16:14right here. Run this query. And there
  471. 16:17you go. Success. No rows returned. And
  472. 16:19if I head back to table ed right now,
  473. 16:21I'll be able to find all these tables in
  474. 16:23here. So, habit completion, habit
  475. 16:25profiles, all of that is in here. And we
  476. 16:27don't really have any data yet. And if I
  477. 16:29go to let's say authentication, we don't
  478. 16:31really have any users either. And yeah,
  479. 16:34now what I'll do is I'll head back to
  480. 16:35our app. And there you go. It is now uh
  481. 16:38I mean right now if we only login, we'll
  482. 16:40be allowed to access our app. And it is
  483. 16:43taking us to the login page. But since
  484. 16:45we don't have an account, I'll try to
  485. 16:46sign up for an account. Let's give my
  486. 16:48name as Astro. Astroastro.com.
  487. 16:52Since we don't have email verification
  488. 16:53enabled, we can get away by giving like
  489. 16:55a dummy email and then a random
  490. 16:58password. And now I'll click on sign up.
  491. 17:01And there you go. I'm now logged in and
  492. 17:03it says welcome as true log out. So
  493. 17:05everything is in here. And now if I head
  494. 17:07back to Superbase and if I go to the
  495. 17:09authentication section here, I can
  496. 17:11already find the email that we used to
  497. 17:13sign up just now. And if I go to
  498. 17:15database, I mean as table editor here,
  499. 17:17we don't have anything yet. So the
  500. 17:19profile is created, but we don't have
  501. 17:20any habits or habits completion, right?
  502. 17:22So I'll just go ahead and try to create
  503. 17:24a new habit. Let's say drink water.
  504. 17:29Okay, no need of any descriptions. I can
  505. 17:31select a color pink maybe. Create habit.
  506. 17:34And there you go. Maybe another one.
  507. 17:37Let's say workout
  508. 17:4030 minutes workout.
  509. 17:44I'll give it let's say red create habit
  510. 17:46and that's also added. And now if I head
  511. 17:49back to our self-hosted version of
  512. 17:51superbase and if I refresh there you go
  513. 17:55both of them are in here and currently
  514. 17:57we haven't really completed any habits
  515. 17:59yet. So habit completions is empty. I
  516. 18:01can head back. I can mark it as
  517. 18:03completed the workout one. I'll just
  518. 18:06refresh it right away. And there you go.
  519. 18:08The same is updated in here. And if I
  520. 18:11complete this one too and if I refresh
  521. 18:14that's also done. So yeah that's how
  522. 18:16simple it is. So first of all we went
  523. 18:18ahead and created a nextjs project in
  524. 18:20cursor and then we got a VPS from
  525. 18:23hostinger set up qualify and installed
  526. 18:25superbase in that particular qualify
  527. 18:27instance. We got all the credentials and
  528. 18:29we set up authentication and database on
  529. 18:32our app and we linked everything
  530. 18:33together and right now our app has a
  531. 18:36proper database and authentication and
  532. 18:37pretty much everything works. And if you
  533. 18:39want to let's say make any sort of
  534. 18:40changes, add new let's say tables or any
  535. 18:43new features like uh enable or disable
  536. 18:46authentication methods. I mean if you
  537. 18:47want to do any of this like file storage
  538. 18:49etc. you'll be able to do all of that in
  539. 18:51here. And yeah this is the basic setup
  540. 18:53right and next step depending on exactly
  541. 18:55what you're looking for you can go ahead
  542. 18:57and add new features and just for
  543. 18:59demonstration purpose I created a simple
  544. 19:01habit tracker app and the next thing is
  545. 19:03obviously deploying the same and making
  546. 19:05it live on the internet. And again the
  547. 19:07interesting thing here is that we are
  548. 19:08planning to self-host and let's say
  549. 19:10deploy this particular app in the same
  550. 19:12VPS where we have configured superbase.
  551. 19:14And yes you heard it correct and for
  552. 19:16that the first thing that you have to do
  553. 19:18is to head over to github.com. And if
  554. 19:20you don't already have an account I
  555. 19:22don't know why you don't already have an
  556. 19:23account but just go ahead and sign up
  557. 19:25for a new account and click on this new
  558. 19:27option to create a new repository. And I
  559. 19:29will give it a name. Let's say habit
  560. 19:31tracker. I'll keep it as private for the
  561. 19:34time being. I can click on create
  562. 19:36repository.
  563. 19:39All right. And after that I can simply
  564. 19:40copy all of this. Right. So every single
  565. 19:43one of these lines I can copy the same
  566. 19:44open cursor. And if I can Okay. I'll
  567. 19:48open a new terminal instance. Paste all
  568. 19:50of that in here. Hit enter. All right.
  569. 19:54Okay. It's completed. And if I refresh,
  570. 19:57there you go. Our initial commit is in
  571. 19:59here. And by the way, none of the
  572. 20:01changes that we made is committed in
  573. 20:02here. Only the blank NexJS project. And
  574. 20:04next what I'll do is I'll just go ahead
  575. 20:06and create our commit. App implemented
  576. 20:10fully. Okay. And I'll click on commit.
  577. 20:13I'll click on sync changes. Click on
  578. 20:15okay.
  579. 20:17Let's wait for it. Okay. That's done.
  580. 20:19And if I refresh.
  581. 20:21There you go. App implemented fully. And
  582. 20:24here we have all the files. And we
  583. 20:26pretty much pushed everything. And again
  584. 20:28here we have a file called asenb.
  585. 20:31But the same is not pushed into our
  586. 20:33GitHub repo. That's because we have
  587. 20:34added and excluded that in our git
  588. 20:37ignore file. There you go. So that won't
  589. 20:38be uh pushed. And right now what we did
  590. 20:40is that we had the project locally in
  591. 20:42our computer. Right now we just went
  592. 20:44ahead and created a GitHub repo and
  593. 20:46pushed all the changes that we made to
  594. 20:48this particular point to this GitHub
  595. 20:49repo right here. And if you want to make
  596. 20:52your life a whole lot easier, you should
  597. 20:54definitely do this. Just make sure you
  598. 20:55regularly push all your changes. And
  599. 20:57next step to deploy it, all I have to do
  600. 20:59is to head back to my Koolify account.
  601. 21:01And after that, I'll click on projects.
  602. 21:03So I can leave my superbase project as
  603. 21:05it is and okay maybe I can create my
  604. 21:07project inside of this particular uh
  605. 21:09project itself. In which choice I'll go
  606. 21:10ahead and select the project and this
  607. 21:12right here is our active superbase. And
  608. 21:14now I'll click on new to create a
  609. 21:16deployment for our app. And now in this
  610. 21:19case all you have to do is to select
  611. 21:20this particular option that says private
  612. 21:22repository with GitHub app. So I'll
  613. 21:24click on the same
  614. 21:26and I'll click on this particular option
  615. 21:28that says add GitHub app. So if this is
  616. 21:30your first time, this is going to be the
  617. 21:32kind of interface that you will see. So
  618. 21:33I'll click on add GitHub app. Can name
  619. 21:36doesn't matter. I'll click on continue.
  620. 21:39And now I'll click on this particular
  621. 21:41option that says register now.
  622. 21:44And just log to your GitHub account.
  623. 21:47I'll click on confirm.
  624. 21:49I'll create app.
  625. 21:54Okay. So that part is done. And now I'll
  626. 21:56click on install repositories on GitHub
  627. 21:58button right here.
  628. 22:00It will take me to this page right here.
  629. 22:02And you have two options. If you want to
  630. 22:04give access to all the repos within your
  631. 22:06GitHub account, you can select the first
  632. 22:07option that says all repositories. But
  633. 22:09in this case, I'm only giving access to
  634. 22:11the particular repo that I want to use.
  635. 22:13So if you're comfortable giving access
  636. 22:14to all the repo, you can do that. But in
  637. 22:16this case, I'll just go ahead and select
  638. 22:18the one that we created just now, which
  639. 22:20is the habit uh tracker one. So let me
  640. 22:23select that real quick. Habit tracker.
  641. 22:26I'll click on install.
  642. 22:29Okay. So that part is now complete. And
  643. 22:32now, okay, there you go. I can click on
  644. 22:34save. And if I go to projects again,
  645. 22:37select the project, click on new,
  646. 22:40click on private repository. Now I'll be
  647. 22:43able to find the GitHub app that we
  648. 22:45added. So I'll click on the same. Since
  649. 22:46we only gave access to this particular
  650. 22:48repo, I can find it in here. But if you
  651. 22:50have like a lot of repos and you gave
  652. 22:52access to all of them, then if you click
  653. 22:53on this dropown menu, you'll be able to
  654. 22:55find all of that in here and select the
  655. 22:56one that you want to deploy. So I'll
  656. 22:58select this one right here and I'll
  657. 22:59click on this particular option that
  658. 23:00says load repository. So branch I'll
  659. 23:03keep it as main base directory port. All
  660. 23:05of this looks good. And if you have
  661. 23:06multiple branch make sure to select the
  662. 23:08one. So in this case we only have like
  663. 23:09one. This is a basic and simple app. And
  664. 23:11no this is not a static site. So do not
  665. 23:14uh enable this option. And now I'll
  666. 23:16click on continue.
  667. 23:19And there you go. Here you can find
  668. 23:21further details. For example configuring
  669. 23:23the domain name. Okay name description
  670. 23:25and all that. But if you right away go
  671. 23:27ahead and try to deploy it just like
  672. 23:28this and if you deploy it your app won't
  673. 23:31work. That's because we haven't really
  674. 23:33added this environment variables. So as
  675. 23:35you can see here we have two of them
  676. 23:36that is uh okay maybe I can make it a
  677. 23:39bit bigger.
  678. 23:41Next up we need to add the next public
  679. 23:43superbase URL and superbase anon key. So
  680. 23:45what I'll do is I'll just go ahead and
  681. 23:47copy the first line and I'll click on
  682. 23:50this particular option that says
  683. 23:51environment variables.
  684. 23:54And now I can click on add.
  685. 23:57I'll paste the same in here.
  686. 24:01Okay.
  687. 24:03So the superbase URL is added and I'll
  688. 24:05click on save. And next step I'll repeat
  689. 24:08the same for the second one as well
  690. 24:10which is our superbase anon key. I'll
  691. 24:13paste it in here.
  692. 24:18Copy the value. Paste it in here. There
  693. 24:21you go. And now I'll click on save.
  694. 24:24All right. So both of them are added
  695. 24:25that is next public superbase addon key
  696. 24:27and next public superbase URL. So that
  697. 24:29is configured and again if you want to
  698. 24:31let's say change any of these like okay
  699. 24:33we can later change the domain but for
  700. 24:35now that looks good. So all of this
  701. 24:37looks good and now okay just making sure
  702. 24:39we have the envy main variables added
  703. 24:43superb key superb URL okay and now what
  704. 24:46I'll do is I'll click on this particular
  705. 24:47option towards the top that says deploy
  706. 24:51and the deployment process has started
  707. 24:53and it will take some time so all you
  708. 24:55have to do is to sit back and wait and
  709. 24:57after the deployment is complete you'll
  710. 24:59be able to access your app so I'll wait
  711. 25:01for some time and I'll see you
  712. 25:02afterwards so there you go the
  713. 25:04deployment is finished and pretty pretty
  714. 25:06much everything should work I believe so
  715. 25:08let's see so right now this right here
  716. 25:10is the domain of our app by the way and
  717. 25:12if I visited this particular domain and
  718. 25:14if I hit enter there you go here we have
  719. 25:17our app and this right here is our app
  720. 25:19running in local host and this right
  721. 25:21here is on our deployed version don't
  722. 25:23worry I'll also show you how we can
  723. 25:24change the domain name and next up I'll
  724. 25:26click on this get started button and try
  725. 25:28to create a new account let's give it a
  726. 25:31name Astro 2 astro2
  727. 25:33at the rateastro.com
  728. 25:36the password
  729. 25:39confirm password click on sign up okay
  730. 25:43there you go I'm now logged in and if I
  731. 25:45head back authentication here we have
  732. 25:48the newly created account
  733. 25:50I can create a dummy item in here create
  734. 25:54habit that's added maybe I can check
  735. 25:56this for nowad back to database I mean
  736. 25:59table editor
  737. 26:01uh refresh there you go So pretty much
  738. 26:05everything works. Okay. So yeah the
  739. 26:08deployment that is our superbase project
  740. 26:09is even working on the deployed version
  741. 26:11of the app. So just like that we have
  742. 26:13set up and deployed our app on the same
  743. 26:15server where we have our database as
  744. 26:18well. Yeah. And again your app is going
  745. 26:20to be lightning fast because both your
  746. 26:22database and your app is on the same
  747. 26:23server. And I don't believe it is
  748. 26:25necessarily a good thing to have both of
  749. 26:27them in the same server. But again if
  750. 26:29you want to do it this way you have the
  751. 26:30option. And right now this right here is
  752. 26:32the URL of our app and it doesn't look
  753. 26:35good right now. If you already have a
  754. 26:37domain, you have the option to connect
  755. 26:39your own custom domain and add a custom
  756. 26:41domain in here. So for that, first of
  757. 26:43all, I'll log into my Cloudflare
  758. 26:45account. So here I have opened up my
  759. 26:46Cloudflare account and opened up the DNS
  760. 26:49settings for one of the domains that I
  761. 26:50own. So if you're not using Cloudflare,
  762. 26:52just log into your domain register or
  763. 26:54wherever you manage your DNS for your
  764. 26:56domain. And the next thing that you have
  765. 26:58to do is to head back to Coolify. And
  766. 27:00first of all, you need to get your
  767. 27:02server IP address. So if you head back
  768. 27:04to Hostinger, there you go. This right
  769. 27:06here is our server IP address. So I can
  770. 27:08simply copy the same. I can head back
  771. 27:11and then all I have to do is to create a
  772. 27:13new error code. So I can simply enter
  773. 27:15the name that is the root and then add
  774. 27:18my IP address in here. So in this case,
  775. 27:20I already have that and make sure it is
  776. 27:21an error code and I'll save it. So
  777. 27:24basically all you have to do is that you
  778. 27:25have to put the address symbol or let's
  779. 27:27say the root of your domain in here. it
  780. 27:28has to be error code and copy the IP
  781. 27:30address and paste it in here and we have
  782. 27:33saved the same and next step I'll head
  783. 27:35back to uh codify and I'll open our app
  784. 27:38deployment project and here in the
  785. 27:40domain section this right here is our
  786. 27:41domain and now what I'll do is I'll
  787. 27:44change that to https and in my case
  788. 27:46astrokj.com
  789. 27:49and I'll select this particular option
  790. 27:50that says redirect to nonwww
  791. 27:54and okay looks good and now I'll click
  792. 27:56on this save button right
  793. 27:58And after that you'll have to click on
  794. 28:00this redeploy option and then redeploy
  795. 28:02the project for the domain changes to
  796. 28:04take place. And once this redeployment
  797. 28:06is complete you'll be able to access
  798. 28:08your app on the domain that we just
  799. 28:10entered. So right now we are planning to
  800. 28:12use the main domain itself. But if you
  801. 28:13want to let's say u access it on a
  802. 28:16subdomain like something.youdomain.com
  803. 28:19well you can just set up a CN record and
  804. 28:21take it that way as well. In which case,
  805. 28:22let's wait for this deployment to
  806. 28:24complete and let's try to access our app
  807. 28:26from the domain that we just added. So
  808. 28:28there you go. The redeployment is now
  809. 28:30finished. And if I come back to
  810. 28:32configuration,
  811. 28:34uh let's see. So there you go. Right now
  812. 28:36our app address is our custom domain.
  813. 28:39And if I try to visit astrokj.com and
  814. 28:42hit enter, there you go. Our habit
  815. 28:44tracker is active under our own custom
  816. 28:46domain. And yeah, pretty much everything
  817. 28:48works. So I can click on login to log to
  818. 28:50my account or sign up for a new account.
  819. 28:53So pretty much everything works. So
  820. 28:54that's how simple it is. So we just
  821. 28:56basically went ahead and created an app
  822. 28:58using AI. And more importantly we
  823. 29:00installed Kify on a VPS and then we
  824. 29:02self-hosted both superbase and also
  825. 29:04deployed our app and that two on a
  826. 29:06custom domain. And now this is the
  827. 29:08overall flow if you want to build an app
  828. 29:10and also deploy the same. But depending
  829. 29:12on your use case now you can go ahead
  830. 29:13and make any sort of changes to the app
  831. 29:15and then deploy or let's say push all
  832. 29:16these changes to GitHub and Kify will
  833. 29:19pick up all those changes and do a
  834. 29:20redeployment for you such that whatever
  835. 29:22change that you push to GitHub will be
  836. 29:24automatically applied to your production
  837. 29:27deployment as well. So exact same
  838. 29:29feature that you get in versel. So
  839. 29:30that's pretty much all I wanted to show
  840. 29:32you in today's video. And again the
  841. 29:34whole idea or the whole point of this
  842. 29:35video was to show you this workflow and
  843. 29:37not necessarily about the app that I
  844. 29:39built. I know it's a basic and very
  845. 29:41simple app but the flow is that once you
  846. 29:43create your app you have the option to
  847. 29:45deploy it and not just the app you can
  848. 29:47also uh deploy the database that is
  849. 29:49superbase and also your app in the same
  850. 29:51VPS using coolify and this is the
  851. 29:53overall flow that you'll have to follow
  852. 29:55and that's pretty much all I wanted to
  853. 29:56show you in today's video I hope you
  854. 29:58guys found this video useful if yes make
  855. 30:00sure to subscribe and I'll see you in
  856. 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.