YouTube2Text

Build SaaS with AI | Part 4 | Edit Prompt & Add Firebase β€” Transcript

by Sabrina Ramonov πŸ„ Β· 6,082 words Β· 842 segments Β· language en Β· Watch on YouTube

Full transcript

  1. 0:00my name is Sabrina Romanov and this is
  2. 0:01part four of my video series build SAS
  3. 0:04with AI and in this video and the next
  4. 0:06couple videos we're just going to focus
  5. 0:08on adding more features adding a
  6. 0:10database getting the app to a point that
  7. 0:13is launchable but first I want to talk
  8. 0:15about my process for adding new features
  9. 0:17especially New Logic features typically
  10. 0:19when building an app there are three
  11. 0:21concepts to think about number one the
  12. 0:23data model number two the UI what the
  13. 0:25user sees and number three the workflows
  14. 0:28or logic uh if this happens then this
  15. 0:31other thing should happen when the user
  16. 0:33clicks this button then that triggers
  17. 0:36this other stuff so a lot of if then
  18. 0:38kind of thinking so in the last video we
  19. 0:40focused on building out the UI a little
  20. 0:43bit of logic in terms of putting in a
  21. 0:45text calling open AI to repurpose that
  22. 0:48text and then displaying that text back
  23. 0:50to the user uh we didn't talk about the
  24. 0:52data model we left that out now we're
  25. 0:54going to start introducing a database
  26. 0:56and see what that looks like and then
  27. 0:58mostly in this video and the next couple
  28. 1:00videos we're going to be implementing
  29. 1:01logic features so when the user does
  30. 1:04this this should happen and here's my
  31. 1:06step-by-step process for adding a new
  32. 1:08logic feature so number one actually
  33. 1:10applies to any feature creating a new
  34. 1:11branch in git if you haven't heard of
  35. 1:13git it's basically a version control
  36. 1:15system so that you can easily save your
  37. 1:17work try out building new things if you
  38. 1:20mess that up you know you can roll back
  39. 1:21to the last stable version and then if
  40. 1:24you're happy with your changes you can
  41. 1:26merge it back to your main version and
  42. 1:28so I really like using get it's is it
  43. 1:30necessary no but highly recommend it
  44. 1:33especially with AI driven or AI assisted
  45. 1:35cating it's kind of inevitable that AI
  46. 1:38will mess up some code and depending on
  47. 1:40how many changes were made and how aware
  48. 1:42you were of the changes being made it
  49. 1:44could be difficult to precisely reverse
  50. 1:47everything without breaking something
  51. 1:49else accidentally so it's really nice to
  52. 1:51have a version control so you can just
  53. 1:53go back to the last stable version and
  54. 1:55try again number two be ultra specific
  55. 1:58and clear this is kind of a common theme
  56. 2:01when working with AI the more specific
  57. 2:03and clear your instructions are the
  58. 2:05better answers you're going to get
  59. 2:08number three identify all relevant files
  60. 2:11so cursor Ai and other AI they produce
  61. 2:13better results if you can narrow down
  62. 2:15the context to a handful of files that
  63. 2:18they should be editing instead of
  64. 2:20passing in your entire code base and
  65. 2:22this concept is true outside of code so
  66. 2:25chat GPT for example it it does well
  67. 2:28with a couple examples but if you feed
  68. 2:30in like tons and tons and tons of
  69. 2:31examples max out its context window it
  70. 2:34usually performs poorly because it
  71. 2:35doesn't know what to prioritize among
  72. 2:38all of that data it doesn't have to be
  73. 2:40perfect but try your best to identify
  74. 2:42the relevant files that cursor AI should
  75. 2:44be looking at and then number four I'll
  76. 2:46show you how to add those files as
  77. 2:48context within cursor it's super easy
  78. 2:50you just tag each file with an add sign
  79. 2:52and then there's auto complete then you
  80. 2:53submit the prompt the cursor and then
  81. 2:55review the code changes and test test
  82. 2:58test even if you're not technical look
  83. 3:00at cursor's explanation for what it
  84. 3:02changed and try to follow along in the
  85. 3:04code base and then the last step once
  86. 3:07everything looks good is to merge your
  87. 3:09experimental Branch your feature Branch
  88. 3:11into main branch so even though I
  89. 3:13haven't done a tutorial on it I will add
  90. 3:15a link to the blog post accompanying
  91. 3:17this video to step-by-step guide to set
  92. 3:19up G for Version Control I recommend
  93. 3:22learning it if you are ever going to
  94. 3:24touch a piece of code even if it's just
  95. 3:26a python script to do some web scraping
  96. 3:28so the first feature I'm going to
  97. 3:29Implement is the ability to edit a
  98. 3:32prompt that's already been submitted and
  99. 3:34regenerate the output with a new prompt
  100. 3:36so for example we'll have like default
  101. 3:38prompts in there for each social media
  102. 3:40platform LinkedIn Twitter will have a
  103. 3:42different prompt obviously but the user
  104. 3:44might want to tweak the prompt you know
  105. 3:46make sure it's closer to their own voice
  106. 3:48make sure it's a certain format whatever
  107. 3:50it is so when they edit the prompts I
  108. 3:52want to have one click to regenerate the
  109. 3:54output with the edited prompt so number
  110. 3:56one create a new Branch so open up your
  111. 3:59terminal whe whether it's warp a default
  112. 4:00terminal or cursor also has its own
  113. 4:03terminal make sure you're in the
  114. 4:04directory of your project so CD is the
  115. 4:06change directory so go into your project
  116. 4:09mine is temporarily called remix then
  117. 4:11I'm going to say get Branch feature
  118. 4:13sledit prompt and this is my typical
  119. 4:16naming convention for features so I'll
  120. 4:18do create a new Branch feature sledit
  121. 4:20prompt versus like a cleanup chore I'll
  122. 4:23do like chore sledit D prompt versus
  123. 4:26like fixing a bug I'll do bug fix slash
  124. 4:28whatever the bug fix is and that's
  125. 4:30totally up to you that's just kind of
  126. 4:32how I do things okay so once you create
  127. 4:34that branch check out means we're going
  128. 4:36to switch to that branch and it will
  129. 4:38autoc complete now you should see this
  130. 4:40get and then it should actually say the
  131. 4:43branch you're on so get feature sledit D
  132. 4:46prompt you can see in earlier history it
  133. 4:49said get main so that's the main branch
  134. 4:51and then we've branched out to this
  135. 4:53experimental Branch the next step for
  136. 4:55the feature is just to Think Through
  137. 4:57like what it is do your best to list out
  138. 4:59step-by-step instructions so this is
  139. 5:02kind of my attempt so when the generate
  140. 5:04content button is clicked so that's over
  141. 5:06here in the app when generate content is
  142. 5:08clicked The Prompt should be returned
  143. 5:10from open AI so that the user can edit
  144. 5:13it so here so currently if I click edit
  145. 5:16prompt it's actually blank so we don't
  146. 5:18know what prompt was submitted to open
  147. 5:21AI but what we want is when the user
  148. 5:23clicks on this we want the prompt that
  149. 5:25was submitted to be populated here so I
  150. 5:27can easily tweak it okay so when the
  151. 5:30user clicks edit prompt The Prompt used
  152. 5:33to generate the content should appear in
  153. 5:35the model and then when the user clicks
  154. 5:37save and regenerate this button the app
  155. 5:40should rerun content generation calling
  156. 5:43open aai with a new prompt and display
  157. 5:45the new content over here in this
  158. 5:48component generated content and again
  159. 5:51the more specific you are like I want to
  160. 5:53show this text in this particular
  161. 5:56component whatever it is generated
  162. 5:58content side Side Bar whatever it is the
  163. 6:00more specific you can be the better
  164. 6:02answers you're going to get from AI
  165. 6:04whether it's cursor Cloud artifact
  166. 6:06whatever you're using the last thing I
  167. 6:08want to clarify is I use the existing
  168. 6:11prompt in generate content as the
  169. 6:13default prompt so when a user signs up
  170. 6:15we should have a default prompt in there
  171. 6:17so that using this app doesn't require
  172. 6:20you to put in a prompt in the first
  173. 6:21place we'll have like really high
  174. 6:23quality prompts for each social media
  175. 6:25platform out of the box okay so the next
  176. 6:27step in our process is identify all
  177. 6:29relevant files so when the generate
  178. 6:32content button is clicked okay well like
  179. 6:34where is that generate content button um
  180. 6:37so it would be here right in content
  181. 6:39generator and you can kind of like wing
  182. 6:42it from the name I mean content
  183. 6:43generator and generated content are like
  184. 6:46the main things in the app so those are
  185. 6:48going to be the things you want when the
  186. 6:50user clicks edit prompt okay that
  187. 6:52corresponds to prompt edit modal right
  188. 6:55like that's the popup where they can
  189. 6:56edit the prompt and so we'll want to
  190. 6:58include that file as well route. TS over
  191. 7:02here the open AI Library obviously we
  192. 7:04want to change this so that it takes in
  193. 7:07the new prompt that has been updated and
  194. 7:10so this is really where making sure
  195. 7:11you're familiar with your own code base
  196. 7:13really helps in identifying the relevant
  197. 7:16context the relevant files for cursor AI
  198. 7:18to look at and the more you can narrow
  199. 7:20it down instead of feeding in your
  200. 7:22entire code base the better answers you
  201. 7:23will get from cursor AI okay and then
  202. 7:26I'll show you how to add files as
  203. 7:27context to cursor but here's how it
  204. 7:29looks like with like everything combined
  205. 7:31and then I added these two things as
  206. 7:33well so add robust logging to help
  207. 7:35troubleshoot issues I just like to do
  208. 7:37that and then I also want AI to ask me
  209. 7:40clarifying questions because especially
  210. 7:43if you're not a software developer or
  211. 7:44product manager there's there's probably
  212. 7:46like nuances here and you want to make
  213. 7:48sure that the AI understands what you're
  214. 7:50asking for so I like to append these two
  215. 7:52requirements to each New Logic feature
  216. 7:55prompt let's go ahead and copy all this
  217. 7:56and then we're going to have to actually
  218. 7:57manually tag the files I'll show you how
  219. 7:59to do that oh and real quick I almost
  220. 8:02forgot the settings um so I have been
  221. 8:05playing around with cursor settings so
  222. 8:08I'm actually still on the free trial and
  223. 8:10I've built like five apps with it which
  224. 8:12is great um but here so go to models I'm
  225. 8:14just trying to force cursor to use clae
  226. 8:173.5 onet I even put in my anthropic API
  227. 8:20key and stuff and then also over in beta
  228. 8:24I enabled long context chat which uses
  229. 8:27Cloud's 200k token context window um it
  230. 8:30is slower obviously if you're feeding in
  231. 8:32you know lots and lots of files but we
  232. 8:35just want to enable it just in case we
  233. 8:37do do that we don't want to run into any
  234. 8:39issues so go ahead and do that in your
  235. 8:41settings as well let me copy paste this
  236. 8:44and then we actually need to tag each of
  237. 8:45these files so it looks like this at
  238. 8:47sign and then just start typing the file
  239. 8:49name rout okay and this looks like lot
  240. 8:53but I mean first of all in most features
  241. 8:56we're implementing it's going to involve
  242. 8:58like at least one or or two of these
  243. 8:59files once you get used to it it's not
  244. 9:01too bad and then to confirm that it's
  245. 9:03included in the context it should look
  246. 9:05something like this and then you'll also
  247. 9:07see the context listed here so when it
  248. 9:09says cursor will use that that's the
  249. 9:12context it's going to use for our
  250. 9:13request okay so let's go ahead so for
  251. 9:16this just hit enter you don't have to
  252. 9:18hit command enter again because command
  253. 9:19enter feeds the entire codebase in as
  254. 9:21context whereas we actually want to
  255. 9:23narrow down the context when we're
  256. 9:25implementing a feature at a time so here
  257. 9:27I just hit enter and then first first
  258. 9:29cursor should ask me a bunch of
  259. 9:31clarifying questions we're going to go
  260. 9:32ahead and answer those yep so here are
  261. 9:35the clarifying questions let me expand
  262. 9:37this here are the answers to the
  263. 9:40clarifying questions yes each platform
  264. 9:42individually each platform of its
  265. 9:46platform optimized prompt okay currently
  266. 9:50the prompt state is not being used
  267. 9:51should we repurpose this to store the
  268. 9:53glob promp okay so again we're going to
  269. 9:55clarify platform specific prompts when
  270. 9:57the user clicks edit prompt for specific
  271. 9:59spefic platform should be showed the
  272. 10:00plat okay so all these are related
  273. 10:02update only the content for the specific
  274. 10:05platform being edited so so what that
  275. 10:07means is like if I'm repurposing content
  276. 10:09for Twitter LinkedIn and Facebook but I
  277. 10:12only want to change the prompt for
  278. 10:13Twitter then it should only update the
  279. 10:16content for Twitter because that's the
  280. 10:17prompt that I'm changing where exactly
  281. 10:19should we add logging let's do both I
  282. 10:22like more logging are there any specific
  283. 10:25error scenarios we should handle and log
  284. 10:27apart from General API ER let's say I'm
  285. 10:30not sure we want to log as much as
  286. 10:35possible to help us troubleshoot issues
  287. 10:37should we Implement any rate limiting or
  288. 10:39error handling no hit enter and then
  289. 10:42it's it's already has the context of
  290. 10:45this conversation of this particular
  291. 10:47chat and it's using the same files so
  292. 10:49now it's going to outline the plan for
  293. 10:51implementing this feature here's the
  294. 10:52plan technical or non-technical I
  295. 10:54recommend you read this try to
  296. 10:56understand what it's doing you can ask
  297. 10:58questions too you can ask follow
  298. 10:59questions like what do you mean by doing
  299. 11:01this update the content generator prompt
  300. 11:03blah blah blah update the generated
  301. 11:05component Pass the full prompt as a prop
  302. 11:06to the component modify prompt edit
  303. 11:08model so it displays the full platform
  304. 11:11specific prompt update the API route and
  305. 11:13open AI okay so here it's going to first
  306. 11:16start with content generator so let's
  307. 11:17apply it to this file and you can again
  308. 11:20you can see the changes it's making you
  309. 11:22can accept or reject individual changes
  310. 11:24so green is stuff it's adding red is
  311. 11:26stuff it's removing so go ahead and
  312. 11:28accept that and before I forget I just
  313. 11:30reopened my terminal here just make sure
  314. 11:32you in the correct Branch feature sledit
  315. 11:35D prompt okay and you can see here we've
  316. 11:38only edited one file which is correct
  317. 11:40okay now let's update generated content
  318. 11:43okay now it's modifying prompt edit
  319. 11:45modal Okay click accept now it's
  320. 11:48updating the routes and then updating
  321. 11:51open AI okay I don't like that it just
  322. 11:53removed my super long prompt but that's
  323. 11:55okay we can add it back with a actual
  324. 11:57platform specific prompts the last thing
  325. 11:59I'll mention just double check what
  326. 12:01model you're using here so for our
  327. 12:03purposes I actually just want to use GP
  328. 12:0540 mini next step is to test this
  329. 12:08implementation thoroughly how do I run
  330. 12:10the app let's say we forgot how to run
  331. 12:12the app okay if you haven't already done
  332. 12:14this we should have done this from the
  333. 12:15previous video but go ahead and do it
  334. 12:17anyway if you haven't and then here npm
  335. 12:19runev okay so you can see here it's
  336. 12:21starting then we'll go to Local Host
  337. 12:233000 okay this is my old one here I'm
  338. 12:27just copying content original content
  339. 12:30okay select the platform let's open up
  340. 12:33the console log so right click inspect
  341. 12:35go to console so if there are any errors
  342. 12:38on the client side we can see here and
  343. 12:40then click generate content since we
  344. 12:42added a bunch of logging you can
  345. 12:44actually see like all the logging here
  346. 12:46which is pretty cool I'd really
  347. 12:48recommend getting comfortable scan logs
  348. 12:50and stuff so here there was a request
  349. 12:53API request and then this is generating
  350. 12:56content for Facebook which is what I we
  351. 12:58selected and then this is the prompt
  352. 13:01here is the actual input that was sent
  353. 13:04to the in API so input content and then
  354. 13:07here's the input prompt and now this is
  355. 13:09sending post requests to this endpoint
  356. 13:11API generate content and then here is
  357. 13:14the generated content you can tell with
  358. 13:16all the emojis that's not the version I
  359. 13:17wrote so this is kind of the same
  360. 13:20functionality as we left off in the last
  361. 13:21video so now we're going to edit this
  362. 13:23prompt right so this is good this is
  363. 13:25what we want so remember before it
  364. 13:27didn't even show us the prompt to edit
  365. 13:29now this is showing the prompt that was
  366. 13:31used to generate that output and we can
  367. 13:33edit directly here so let's do something
  368. 13:35really drastic like write a 200
  369. 13:38character tweet from the input and then
  370. 13:42click save and regenerate okay so
  371. 13:44nothing seem to change here but let's
  372. 13:47check the logs and see what happened
  373. 13:49okay so here's our latest called
  374. 13:50generate content with prompt okay so we
  375. 13:53know that the front end actually did
  376. 13:55capture the updated prompt right a 200
  377. 13:58character tweet from the input um the
  378. 14:01input stayed the same it's just copy
  379. 14:02pasted from my blog post and then here
  380. 14:04is the generated content which does look
  381. 14:07like a tweet so this generated content
  382. 14:09is you know drastically different from
  383. 14:11this long form post over here so that
  384. 14:14means everything is working except we're
  385. 14:17not seeing the generated content
  386. 14:19displayed but that's good so we got
  387. 14:21everything working so far we just need
  388. 14:23to display the new generated content now
  389. 14:26what I'm going to do is commit this
  390. 14:28since it's working status so again I'm
  391. 14:31going to link in the newsletter
  392. 14:32accompanying this I'm going to link to
  393. 14:34an awesome G tutorial if you've never
  394. 14:36set it up before but basically the
  395. 14:38workflow is like you make a bunch of
  396. 14:39changes you add those changes you commit
  397. 14:43with a message like describing what you
  398. 14:45you've changed so so now users can edit
  399. 14:49the prompt submitted to open AI so we
  400. 14:53know that part's working the only part
  401. 14:55that's not working is displaying the new
  402. 14:57output right so that's why I kind of
  403. 14:59want to commit it we have a unit of
  404. 15:01something that is working fine and we
  405. 15:04just need to add something else and so
  406. 15:06this is a good practice the less
  407. 15:08technical you are I would say commit
  408. 15:10more frequently because you you want to
  409. 15:12make sure you can roll back to that
  410. 15:13stable working version if you use like
  411. 15:16GitHub or something you can actually
  412. 15:17push this to a remote repository in my
  413. 15:21case it would be G push origin uh
  414. 15:24feature sledit prompt so that's our
  415. 15:26branch and then I'll be able to see it
  416. 15:28in GitHub okay and then here I'm just
  417. 15:32going to click on that link and I use
  418. 15:34GitHub for Version Control another one
  419. 15:36is bit bucket that's popular so here's
  420. 15:38the repo remix and you can see now two
  421. 15:42branches right here's our feature sledit
  422. 15:44prompt branch and you can see it's one
  423. 15:47commit ahead of main meaning like I made
  424. 15:49all of those changes committed it to
  425. 15:51this experimental branch and the goal is
  426. 15:54like once we're good with this feature
  427. 15:56then we'll merge this branch with all of
  428. 15:59its commits to the main so that's it
  429. 16:02that's all you have to do so now let's
  430. 16:03say like you make a bunch of other
  431. 16:05changes and you mess stuff up and you
  432. 16:07want to go back to this point we're
  433. 16:09currently at all you have to do is get
  434. 16:11stash okay so let's say we like try
  435. 16:13implementing displaying content and for
  436. 16:16some reason just like messes up other
  437. 16:17code you can roll back to this exact
  438. 16:19point where we're at yeah let's keep
  439. 16:21everything in this Contex so now I want
  440. 16:23to say I see the updated prompt being
  441. 16:27sent to
  442. 16:29T and I see the generated output with
  443. 16:33the or let's say the new promptings and
  444. 16:35I see the generated output with the new
  445. 16:37prompt is correct but I don't see the
  446. 16:41generated output being displayed in the
  447. 16:44generated content component again be as
  448. 16:47specific as possible and then I still
  449. 16:49like to
  450. 16:50add even for a minor thing like this I I
  451. 16:53wanted to ask me clarifying questions
  452. 16:55okay then hit enter remember to not hit
  453. 16:58command ENT because that'll do the
  454. 16:59entire code base now it's asking me a
  455. 17:01bunch of clarifying questions here are
  456. 17:04answers to
  457. 17:05your follow up
  458. 17:08questions yes I see the content and then
  459. 17:12it's also asking to check the network
  460. 17:14tab so here this is the network tab on
  461. 17:16the front end so you can see two
  462. 17:18generate contents here so just click on
  463. 17:21that um and this is like the the API
  464. 17:24call and then if you click response this
  465. 17:27is what the front end received
  466. 17:29so so this is the actual tweet tweet
  467. 17:31that was updated so new to CHP don't
  468. 17:33worry and you can tell it's a tweet
  469. 17:34because it's just super short whereas if
  470. 17:36you look at the previous call this
  471. 17:38response super super long right so we we
  472. 17:41know they're two different prompts yes I
  473. 17:43see returned in the in the logs and call
  474. 17:47it and the network tab two are we seeing
  475. 17:51any console errors no no cons errors
  476. 17:54three is the issue occurring for all
  477. 17:56platforms or only for specific ones I'll
  478. 17:59say all
  479. 18:00platforms for when you say you don't see
  480. 18:03the generat is the generator not
  481. 18:04updating at all or is it showing
  482. 18:06outdated content so here I don't think
  483. 18:10it's updating at all oh well it is
  484. 18:12showing updated content I'm not sure I'm
  485. 18:14not sure I'm not sure if it updated I
  486. 18:18see outdated content five are we certain
  487. 18:21that set gener content function I'm not
  488. 18:24certain number six is there any specific
  489. 18:27State Management Library
  490. 18:29on being used in this project Redux mob
  491. 18:33X or we riing on reacts State and I
  492. 18:36believe we're flying solely onx you
  493. 18:41state avoid just in general avoid
  494. 18:44introducing more libraries unless
  495. 18:48absolutely necessary that's just in
  496. 18:50general are there any requirements for
  497. 18:52persisting the generated content between
  498. 18:54pach reloads or browser sessions no I
  499. 18:57don't think we need to do that should we
  500. 18:59Implement any visual feedback yeah yes
  501. 19:01that would be very nice okay let's hit
  502. 19:03enter I just love it when the AI ask
  503. 19:06clarifying questions because it always
  504. 19:07asks things that like you didn't think
  505. 19:09about even if you don't need it like
  506. 19:11right now you can keep it in mind for
  507. 19:13future versions to improve the user
  508. 19:14experience this works much better than
  509. 19:17just being like it doesn't work and you
  510. 19:18fix it because then then the AI may not
  511. 19:21know where to start it'll try like all
  512. 19:23sorts of things and rewrite different
  513. 19:25parts the more specific you are what
  514. 19:27what's missing versus what's working
  515. 19:28well already so don't touch that the the
  516. 19:30better answers you're going to get the
  517. 19:32smoother experience you're going to have
  518. 19:34Okay so let's apply these changes accept
  519. 19:37generated content okay accept oh we're
  520. 19:40going to create a new file called
  521. 19:41loading spinner. TSX which probably
  522. 19:44honestly was unnecessary but I I'm just
  523. 19:47a sucker for loading Spinners
  524. 19:50okay yeah just make sure you've saved
  525. 19:52all the files okay okay and then let's
  526. 19:55test it out opening up our console log
  527. 19:57just in case there's any issues
  528. 19:59okay this is generated prompt edit
  529. 20:02prompt write a 200 character from the
  530. 20:06input okay and there we go so it updated
  531. 20:08the generated content and now we see the
  532. 20:11tweet and we had a really cute loading
  533. 20:13spinner too so we're pretty much done
  534. 20:15with this first feature and so just to
  535. 20:17recap what we completed we already had
  536. 20:19the functionality where it repurposed
  537. 20:21this content through an API called the
  538. 20:23chat GPT um but what else we want is to
  539. 20:26edit the prompt that's being used and
  540. 20:28then regenerate the content from one
  541. 20:30click and so now if I do this again
  542. 20:32right let's say write a 10 point bullet
  543. 20:35list a 10 item bullet point list from
  544. 20:40the input something like that save and
  545. 20:42regenerate now now it shows the loading
  546. 20:44spinner and it should regenerate the
  547. 20:46content again okay see perfect so yeah
  548. 20:49this works pretty much exactly as we
  549. 20:52want and the purpose of this feature is
  550. 20:54like for me if I'm repurposing my own
  551. 20:56content for example this YouTube video
  552. 20:58and I want to send it to my newsletter
  553. 21:01Facebook like a Tik Tok video script
  554. 21:03whatever I kind of want to see
  555. 21:05everything in one place and have my
  556. 21:07default high quality prompts do the
  557. 21:10first pass but then I might want to want
  558. 21:11to tweak The Prompt and I want to do it
  559. 21:13on a platform specific basis and I want
  560. 21:15to do it all in one place for me it's
  561. 21:17important I see the original content
  562. 21:19compare it with a generated content and
  563. 21:21then make sure I don't lose any
  564. 21:23important information like for me I want
  565. 21:25that level of control and so yeah so
  566. 21:28this feature can be marked done so let's
  567. 21:30go ahead and commit it and everything so
  568. 21:32here do contr X let's do exit and then
  569. 21:37you can do get status this shows you
  570. 21:39what changes you made what files will be
  571. 21:41added so I do get-- capital A so that
  572. 21:44adds all of the changes and then get
  573. 21:47Commish DM is the message and the
  574. 21:50message is display generated output to
  575. 21:54user okay and then we're going to push
  576. 21:57this again to our branch
  577. 22:00prompt okay and that's pretty much it
  578. 22:02now since we're done with this feature
  579. 22:04you have two choices you can either
  580. 22:05merge this Branch to main because you're
  581. 22:09you're kind of done with it and it's
  582. 22:10good to go and then from Main you can
  583. 22:12create a new Branch for the next feature
  584. 22:14we're going to implement or you can keep
  585. 22:16adding changes to this branch and just
  586. 22:18merge it to main later when you're done
  587. 22:20I personally like to create a new Branch
  588. 22:23for each new feature but just for the
  589. 22:25sake of this video series I'm just going
  590. 22:27to keep everything in this branch brch
  591. 22:28and then commit everything to main at
  592. 22:31and then merge everything to main at the
  593. 22:33end just so we don't spend a lot of time
  594. 22:35on it but my personal workflow usually
  595. 22:38is you know new feature new chor new bug
  596. 22:40whatever it is I have a separate Branch
  597. 22:42for each of those so the next thing
  598. 22:43we're going to do set up Firebase is our
  599. 22:46database so go ahead and create an
  600. 22:47account if you haven't yet again in my
  601. 22:49newsletter I'll have the link to
  602. 22:51everything here firebase.com click get
  603. 22:55started and then basically here's the
  604. 22:57prompt to generate the initial
  605. 22:59scaffolding for the Firebase integration
  606. 23:01so so we're going to put this in here at
  607. 23:03the end of The Prompt it's really
  608. 23:05important to explain step by-step how to
  609. 23:06set up a new Firebase project from
  610. 23:08scratch so just as a best practice if
  611. 23:10I'm integrating a new API or anything
  612. 23:13external I like to include this at the
  613. 23:15end of The Prompt to make sure I
  614. 23:18understand how to go through setting it
  615. 23:19up go ahead and copy this and go to
  616. 23:21cursor and we're going to create a new
  617. 23:24chat okay because we don't want all the
  618. 23:26context from the previous chats made it
  619. 23:28note here to make sure you run it with
  620. 23:30the entire codebase as context okay so
  621. 23:33here copy it paste it to do command
  622. 23:35enter so run with entire codebases
  623. 23:37context and you can confirm it here when
  624. 23:40it says Global context like that that
  625. 23:42means it's running with the entire
  626. 23:43codebase here are the paths through the
  627. 23:45newly created file so we're going to
  628. 23:47have to go in and create these files uh
  629. 23:49so let's do that first and then we'll go
  630. 23:50to the next part so app SL utils file
  631. 23:55.ts okay and then apps let hooks I don't
  632. 23:59believe we have a hooks directory no so
  633. 24:01we're going to create Hooks and then
  634. 24:04we're going to create a file called use
  635. 24:07Firebase and then app SL components new
  636. 24:11file Firebase
  637. 24:14provider okay cool now let's go through
  638. 24:17the step-by-step process of setting up a
  639. 24:19new Firebase project from scratch so I
  640. 24:21go to the Firebase console so that's
  641. 24:23console. firebase.com click on get
  642. 24:27started with a new project add project
  643. 24:30so let's call this project remix accept
  644. 24:32the terms okay continue okay I do have a
  645. 24:37Google analytics account you can skip
  646. 24:39that if you don't have an analytics
  647. 24:40account so yeah we'll just follow the
  648. 24:42instructions here once the project is
  649. 24:44created click on add app and choose web
  650. 24:47platform which is this one okay nickname
  651. 24:49is called remix uh we don't need
  652. 24:51Firebase hosting right now so just click
  653. 24:53Register App you'll be presented with a
  654. 24:55configuration object which we'll use in
  655. 24:58our code okay so here install the
  656. 25:01Firebase SDK by running npm install
  657. 25:03Firebase so go to your terminal run npm
  658. 25:06install Firebase now we will create the
  659. 25:07scaffold for Firebase integration here
  660. 25:10I'm just going to ask it to clarify
  661. 25:11which files for steps one 2 3 your
  662. 25:14answer that should be created because
  663. 25:17remember in the previous step we kind of
  664. 25:18already created the file so we just want
  665. 25:20to make sure it's aligned with what it
  666. 25:22wants us to use so we're going to do
  667. 25:24util slf Firebase first so that's number
  668. 25:27one okay let's go to to step one this is
  669. 25:29the Firebase configuration file util
  670. 25:38firebase.com
  671. 25:46so that's going to be this component
  672. 25:49Firebase provider click accept Okay and
  673. 25:52then update app SL file layouts okay cck
  674. 25:56accept hit save and create a n local I
  675. 25:58believe we already have one for open API
  676. 26:01key okay so I don't want to reveal mym
  677. 26:04local because it has my open API key but
  678. 26:06what you're going to do is copy this add
  679. 26:08it to n.l and obviously replace all of
  680. 26:12these variables with the with the stuff
  681. 26:14from your project and if you go back to
  682. 26:17the Firebase website that's where you
  683. 26:18can see it you can see like the Firebase
  684. 26:20config here are some tips to add
  685. 26:22features that use Firebase as always
  686. 26:25like be concise and clear in what it is
  687. 26:27you're trying to do with a feature ask
  688. 26:29for the overview of the data model that
  689. 26:32it's going to create based on your
  690. 26:33feature request for new features I only
  691. 26:36use Firebase context to drive the output
  692. 26:39instead of like including the entire
  693. 26:40codebase as the context and then for
  694. 26:42existing features I like to include
  695. 26:45previously implemented crud features and
  696. 26:48like give that as an example to AI so it
  697. 26:50can follow the same format the same
  698. 26:52structure so I'll say something like for
  699. 26:54this new feature follow the same crud
  700. 26:56structure as this other feature
  701. 26:58specified in this other file something
  702. 27:01like that and then yeah do your best to
  703. 27:03Think Through the data model like each
  704. 27:05user can they have multiple prompts yes
  705. 27:07what are the fields that a prompt should
  706. 27:09have probably like a text field and a
  707. 27:12created at the Tim stamp so think about
  708. 27:14like the objects in your data model like
  709. 27:16a prompt is an object a user is an
  710. 27:18object the relationship between those
  711. 27:20objects a user has multiple prompts Etc
  712. 27:24and the next feature we're going to be
  713. 27:25working on is crud for promps so being
  714. 27:27able to create read meaning use the
  715. 27:30prompt sending it to open AI update a
  716. 27:33prompt and delete a prompt so if you're
  717. 27:35not technical crud just is acronym for
  718. 27:37create read update delete and this
  719. 27:40feature like I said it allows users to
  720. 27:42create a prompt read the prompts which
  721. 27:44means using it sending it to chat gbt
  722. 27:46for repurposing content update the
  723. 27:48prompt to make them better and delete
  724. 27:50prompts you no longer want that's a typo
  725. 27:52I'm just fixing a typo here we're going
  726. 27:54to use these files as context use
  727. 27:56firebase.com
  728. 27:58TS so here's the prompt for implementing
  729. 28:02crud for prompts think about the
  730. 28:04relationship so can a user have one only
  731. 28:06one prompt many prompts in our case each
  732. 28:09user will have many prompts you'll have
  733. 28:11like a whole prompt library and you can
  734. 28:12pick and choose which prompt you want to
  735. 28:14use for each platform each prompt
  736. 28:16belongs to a user output functionality
  737. 28:18into a separate service file designed to
  738. 28:20interact with the Firebase data and all
  739. 28:22that means is we're asking for a
  740. 28:24separate file that is then going to
  741. 28:26interact with the data from our database
  742. 28:28base and before producing the code think
  743. 28:30through it step by step and output the
  744. 28:32data model so you can review it before
  745. 28:34it goes ahead and does it and you'll
  746. 28:36want to review that data model and make
  747. 28:37sure it represents relationships you're
  748. 28:39thinking of correctly and then as usual
  749. 28:41before start working on this feature ask
  750. 28:43me any clarification questions go over
  751. 28:45to cursor I'm going to start a new chat
  752. 28:47so the context is fresh and then I'm
  753. 28:50going to tag the files use fireb base.
  754. 28:52TS and then fire base. TS okay so you
  755. 28:57can remove it from here that was just
  756. 28:58kind of a placeholder for my blog post
  757. 29:01now here are the clarifying questions
  758. 29:04here are answers to your questions so
  759. 29:08number one what specific field should be
  760. 29:11included in a prompt so I like the
  761. 29:13fields that mentioned yes include Fields
  762. 29:15like title content you might want to
  763. 29:19name a prompt like a shorthand like
  764. 29:21tweet 60 or tweet no Emojis or whatever
  765. 29:24and that title would be separate from
  766. 29:25the prompt itself do we need to imp any
  767. 29:28sort of sorting or filtering for proms
  768. 29:31yes are there any limits no limits
  769. 29:33Implement any validation no real time
  770. 29:37functionality such as live updates no
  771. 29:40out of scope are there any specific air
  772. 29:42handling no I'll just say not sure
  773. 29:45actually do we need to implement any
  774. 29:47pagination for retrieving prompts
  775. 29:49especially if a user has many prompts
  776. 29:51let's say no for now okay we'll probably
  777. 29:55want to implement that later though
  778. 29:56first let's think through the steps and
  779. 29:58design the data model so here's a
  780. 30:00collection called prompts okay with
  781. 30:02documents representing individual
  782. 30:04prompts each document will have a
  783. 30:06reference to the user that created it
  784. 30:08the data M looks like prompts prompt ID
  785. 30:10and then the title of the prompt content
  786. 30:12created at update at and the user
  787. 30:14reference to the user who created it and
  788. 30:16then here are the steps for implementing
  789. 30:17cred operations create a new file
  790. 30:19Implement blah blah blah now let's start
  791. 30:21implementing the code so what I do want
  792. 30:23to do since I forgot to ask is to
  793. 30:26clarify what the file and the file paths
  794. 30:29clarify the file names and file paths
  795. 30:32for files that must be created I'm just
  796. 30:36asking that in the same chat so again it
  797. 30:38already has the the context of this
  798. 30:40conversation okay so we're going to
  799. 30:42create a new directory called
  800. 30:45Services create a new file called prompt
  801. 30:48service and this file will contain all
  802. 30:51the functions for crud as it relates to
  803. 30:53prompts okay let's go ahead and apply
  804. 30:57this to a new file
  805. 30:59and this is going to hitting this will
  806. 31:01Implement all this code create a prompt
  807. 31:02function read Implement read Implement
  808. 31:04update Implement delete Implement
  809. 31:06sorting and filtering okay it's still
  810. 31:08creating and what we're going to do so
  811. 31:10when you implement another crud like
  812. 31:12feature like this what you can do is
  813. 31:14pass this file as context to cursor and
  814. 31:17say like I said over here in my
  815. 31:18newsletter for this new feature follow
  816. 31:21the same Crow structure as the prompt
  817. 31:23feature specified in this file prompt
  818. 31:25service.ts and what that does it's a
  819. 31:27temp almost so it gives cursor a very
  820. 31:29clear idea how you want a new crud
  821. 31:32feature to be created and it's
  822. 31:33consistent with a code base all right so
  823. 31:35just to recap what we walked through
  824. 31:36today showed you some cursor settings to
  825. 31:38force it to use cloud 3.5 sonnet my
  826. 31:41process for adding New Logic we
  827. 31:43implemented a new feature where you can
  828. 31:45edit the prompt and regenerate the
  829. 31:46output we added Firebase as our database
  830. 31:49and then we created the crud routes for
  831. 31:52being able to create read update and
  832. 31:53delete prompts next up we will build
  833. 31:56like a little table where users can see
  834. 31:58the prompts that they have update them
  835. 32:00create new ones delete them and we'll
  836. 32:02also build out user authentication so
  837. 32:04people can actually sign up and then see
  838. 32:06the prompts that they created my name is
  839. 32:09Sabrina Romanov if you like this kind of
  840. 32:10stuff hit like hit subscribe drop a
  841. 32:12comment below look forward to hearing
  842. 32:14from you

About this transcript

This page contains the full transcript of Build SaaS with AI | Part 4 | Edit Prompt & Add Firebase by Sabrina Ramonov πŸ„, generated from the public captions YouTube serves with the video. The transcript has 6,082 words across 842 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 translate the transcript into 100+ languages.

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, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.