Claude Code for Product Designers
Lesson 32 of 49, 0 of 49 lessons completed
Sign in
Watch on YouTubePlay

Plays from YouTube. Google's privacy policy (opens in a new tab) applies.

Up next

3.4 Secrets from the team

Next lesson in 8 s

3.3 Docker and the local database

Adam explains how a shared database differs from data kept in the browser, and what Supabase and Docker are, then installs Docker Desktop and starts the app's local database.

What you'll learn

  1. The training app stored data in the browser; the mature app shares one database between all users.
  2. Relational databases (tables like spreadsheets, linked to each other: Postgres, MySQL, SQLite) vs document databases (MongoDB, Firebase), at a glance.
  3. Supabase is Postgres with extra services such as authentication.
  4. Docker runs prepackaged containers of programs the same way on every machine.
  5. How to install and start Docker Desktop on a Mac and check the engine is running.
  6. A local database is your own playground for fake users and bookings, edge cases and empty states.

Chapters

  1. 00:00From sticky notes to a database
  2. 01:50Relational vs document databases
  3. 03:02What Supabase and Docker do
  4. 04:44Your own local playground
  5. 05:59Installing Docker Desktop
  6. 07:53Starting the local database
  1. 00:00So, in the previous video, we have cloned the fork of the mature version of the parking spot booking application.
  2. 00:08Um, and even though we could have asked Claude to help us set it up locally for us, and chances are it would succeed, we decided to try to go
  3. 00:19through some of these steps manually just so that we know the next time when Claude is doing something for us, we have a basic understanding of what are like
  4. 00:27what things are happening in the background.
  5. 00:30And in the previous video, we have reached this step over here, the NPM install.
  6. 00:34So, we have installed all of the dependencies needed to run this application.
  7. 00:39And then we tried running this command to start the database.
  8. 00:43And, you know, we had an error over here uh in the terminal.
  9. 00:48Uh, an error saying that we should have installed Docker Desktop.
  10. 00:52So, let's talk about it.
  11. 00:54Let's uh discuss what are um like what is the difference here between this version of the application and the one we built initially.
  12. 01:03So, in the application that we have built in the previous module, we didn't really have any sort of database, meaning information about like the bookings you have made or
  13. 01:15that have been made by others were fake and they were stored in your browser in local storage.
  14. 01:21It's more like writing things on a sticky notes and having them around your monitor.
  15. 01:26Of course, you can see them, but nobody else can.
  16. 01:30Um, whereas the like mature version of this application uses a proper database, which makes sure that everyone gets to see the same information and everyone can, you know, have
  17. 01:42their set up their own account and they can create um a new booking for their own and everybody everybody else is going to essentially see the same thing.
  18. 01:52And talking about databases, there are essentially two kinds that you know, we should look into.
  19. 01:57So, first we have relational Um these could be MySQL, SQLite, or PostgreSQL SQL in our example.
  20. 02:08So in relational databases we have basically tables like spreadsheets in which each row in the table is a new entry uh in that in that table in the database.
  21. 02:20And you can have one table for users, another one for your reserva for all of the reservations made by everyone in the application.
  22. 02:28And then you can have a relation between these tables which is going to make sure it's clear to everyone like whose reservation we are looking at for example.
  23. 02:38And then we also have these more free form um kind of databases uh non-relational.
  24. 02:45We can think of them as you know simple um like unstructured or like I'm sorry very much structured documents.
  25. 02:51We can think of uh JSON files.
  26. 02:54We can [snorts] think of uh things like MongoDB or Firebase.
  27. 03:00Our application or this mature version of the application uses PostgreSQL SQL as I mentioned before.
  28. 03:06There is also one more thing being mentioned here in the README file and it's over here.
  29. 03:11The npm install also installs Supabase command line tool for this project only.
  30. 03:17So what is Supabase?
  31. 03:18It's essentially PostgreSQL with some sprinkles on top.
  32. 03:22Uh you know engineers love Supabase because it gives you many good things out of the box.
  33. 03:28Things like authentication for example.
  34. 03:30We as Tonik for exa by the way have been working with Supabase in the past.
  35. 03:36Um this imaginary engineering team behind this mature version of the booking app has um database in the cloud on Supabase.
  36. 03:44And in this video we are basically going to take this this same thing and we're going to install it and run it locally on our machine.
  37. 03:54Now Supabase is really a couple of things all at once a couple of programs.
  38. 03:59And instead of installing them separately on your machine, um it's more common to have these programs like packed together in a form of a container because a container is
  39. 04:11something that we can later take and install like um with on our computer so that it runs the same way on every single machine.
  40. 04:21So it's all the same programs pre-configured.
  41. 04:24The thing is if you want to use these containers, you need a Docker, like a Docker desktop application.
  42. 04:31And that error that we saw in the previous video is essentially our computer telling us that, hey, you have the container, but I have no Docker over here to
  43. 04:40use it. So we are going to install one right now and we are going to install a Docker desktop application.
  44. 04:47Now you might be wondering, why are we even going to such lengths?
  45. 04:51Like couldn't we, for example, run our application locally, but in terms of a database, couldn't we just connect to the one we have in the cloud on Superbase?
  46. 05:02Well, we very much could have.
  47. 05:04But the thing about having your own local database is that it's your very own playground and this can be a really uh really nice thing, especially for you as
  48. 05:14a designer because having your own local database and having Claude together with you means you can ask Claude to fill it out however you want.
  49. 05:23It can create as many, you know, fake users or fake projects or, you know, fake bookings as you want and it can create the like all of these things
  50. 05:32in a matter of seconds without you needing to go through the application and click those things manually or in if this was a production database without you potentially messing
  51. 05:42with production data, which wouldn't be really a good thing now, would it?
  52. 05:47So having your own virtual sandbox really unlocks the ability to design for all sorts of use cases and also edge cases, error states, empty states, you name it.
  53. 05:58So let's go ahead and install Docker.
  54. 06:00So first I 'm going to head over to this docker.com website and I'll need to a download link.
  55. 06:06Depending on when you're watching this, this page, of course, might be looking different.
  56. 06:10Uh, let's see. Um, can I see?
  57. 06:13Can I find a download link?
  58. 06:15Okay, here it is.
  59. 06:16I'm go to I'll go into Products, Docker Desktop here, and I'm going to download Docker Desktop.
  60. 06:22In my case, uh, I'm on this M1 Pro machine, so I'm going to uh, do the Apple Silicon version.
  61. 06:31And I'm going to give it a second to fully download.
  62. 06:33Now, Docker is free for personal I'm sorry, for like, educational use or for small companies.
  63. 06:40Depending on your needs, you might need to check out their licensing and their, you know, terms and, you know, pricing.
  64. 06:47Okay, my Docker has downloaded, so I'm going to um, open it up, and I'm going to drag it over to my Applications folder.
  65. 06:58Okay, and with that, I'm just going to go command space Docker to open it up.
  66. 07:05Um, so I think it's going to ask you to set up an account, like offer you an option to set up an account.
  67. 07:14I don't think it's uh, it's really needed.
  68. 07:17Um, so I'm going to accept the terms.
  69. 07:22Yeah, I can totally skip this step over here.
  70. 07:26And uh, let's see.
  71. 07:29Okay, so um, I can see that this whale icon in the menu bar um, I'm not sure you can actually see my menu bar, but there is going to
  72. 07:39be that whale icon in your menu bar.
  73. 07:41Um, if it's not animating, it means that the engine is running.
  74. 07:46Uh, and I can actually confirm this by uh, taking a look over here in the bottom left corner.
  75. 07:53So with the engine running, I'm going to go back to my terminal.
  76. 07:56I'm going to type in Docker version just to confirm.
  77. 08:00Okay, so it hasn't found.
  78. 08:02I think I'm just going to restart my terminal and give another shot.
  79. 08:10Okay, there it is.
  80. 08:12So now with the Docker installed, we can come back to our readme file and revisit the step number two and try running that npm run database start command again.
  81. 08:24But of course, we need to make sure we are in the proper folder on our Mac in the terminal.
  82. 08:29So let me type in current directory, paste the path.
  83. 08:33Okay, I'm in the right folder and now I'm going to copy this, paste it over here and okay.
  84. 08:44So this is going to take a while that initial initial start is going to download quite a lot of things.
  85. 08:51So give it a second depending also of course on how mature the real application you're trying to run locally is, this process might be even longer.
  86. 08:59So go and grab a cup of coffee, cup of tea if that's your thing and after we come back, everything should be good to go.
  87. 09:09Okay, the download has finished.
  88. 09:11Docker is requesting access to my documents folder.
  89. 09:14I'm going to allow it and over here in the background in the Docker desktop application, I can see there is a container for Tonik parking application and yep, and
  90. 09:26now we have a confirmation that everything is good to go and and with the step number two officially behind us, all that's left before we can finally run the
  91. 09:37application is step number three and we're going to talk about it in the next video.
  92. 09:42So I'll see you there.

The cheat sheet is for signed-in viewers. Inside: the lesson's prompts ready to reuse, the commands and shortcuts, useful links and what to watch out for.

Sign in to get the cheat sheet

Loading the cheat sheet…