Claude Code for Product Designers
Lesson 10 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

1.6 Tailwind and design tokens

Next lesson in 8 s

1.5 A walk through the files

Adam starts the dev server himself in the app's terminal, then tours the project's folders to show where the views, components and tokens live, which folders to leave alone, and what CLAUDE.md, AGENTS.md and README.md are for.

What you'll learn

  1. If the app doesn't load after a restart, the dev server stopped: run npm run dev yourself (saves tokens) or ask Claude.
  2. Terminal basics: Ctrl+C stops a process, clear clears the screen, up/down arrows recall earlier commands.
  3. app: the views, the shared layout and globals.css (your tokens as CSS variables); a folder name becomes the page's URL.
  4. components: reusable UI pieces with the same names as in Figma; a file mixes logic, layout and what you can change.
  5. lib is the data layer (leave it to Claude for simple MVPs); public holds logos, images and other static assets.
  6. .next and node_modules are generated: don't touch them.
  7. CLAUDE.md is a project brief Claude reads at session start; AGENTS.md is the cross-vendor equivalent; README.md is for humans.

Chapters

  1. 00:00Starting the dev server yourself
  2. 03:00The app folder: views and tokens
  3. 06:36Components, lib and public
  4. 09:27Generated folders to leave alone
  5. 11:36CLAUDE.md, a brief for Claude
  6. 13:41AGENTS.md and README.md
  1. 00:01Okay, with the first implementation of our Next.js application ready to be reviewed, how about we take a quick walk through of the folder structure just so that we have
  2. 00:11a basic understanding on of things such as where do I look for code behind my UI components or where can I change my design variables uh or like CSS
  3. 00:23variables I should be precise here um where can I find code for this particular view of my application.
  4. 00:30Um so let me switch over to my Claude Code desktop application.
  5. 00:34I have restarted it since my last recording, which means that um if I now go ahead and try to preview my application in my own browser and because it's
  6. 00:45a Next.js application I know that the way for me to do this is by just typing in localhost and using the port 3000 um I can see like nothing
  7. 00:55really comes back um and again this is because I've restarted my you know Claude Code application and um my local server is no longer running.
  8. 01:04Um there is a quick way to fix it.
  9. 01:06One way is of course to ask Claude to fix it.
  10. 01:08We can just type something like spin up the dev server um without the type of course uh but if we want to save some money on tokens, what we
  11. 01:21can do is we can actually do this ourselves because it's super easy and will make you feel like a true engineer.
  12. 01:27So what I'm going to do is I 'm going to head over here.
  13. 01:30First of all, let's make sure you are looking at a session uh that uh started off in this original folder.
  14. 01:37So here I want to make sure my working folder is Tonik Parking Cars because this is the one in which we just built the thing, right?
  15. 01:45And then I want to open up the terminal over here uh because it this terminal is also going to launch in the same folder and I 'm just going
  16. 01:52to type in a command that is very easy to memorize npm run dev.
  17. 01:57So three words uh all of which are three So and I just going to hit enter and I can see that my dev server is running over here at
  18. 02:07localhost 3000. If you see any issues here, you can always ask Claude to help you out with this.
  19. 02:14In my case, it was fairly fairly simple.
  20. 02:17And I can actually close this terminal like close the viewer of the terminal.
  21. 02:22It doesn't really shut down that terminal shell.
  22. 02:25It's still running behind the scenes.
  23. 02:27If I want to stop the dev server, I can hit control C and that is going to disable it.
  24. 02:33Then I can type in clear if I want to clear my terminal.
  25. 02:36These are like basic things which are super helpful to know.
  26. 02:39And then again, I'm just going to type in npm run dev or a very cool thing that I like about terminals is that you can use your arrow keys
  27. 02:47down and up to shuffle between all of the recently run commands.
  28. 02:51So I'm going to do double up arrow and I'm going to just hit enter and it's going to restart the dev server.
  29. 02:58And yep, there it is.
  30. 02:59It's right in front of me.
  31. 03:00Awesome. Okay, let's get back to looking at like the file tree structure or just the folder structure.
  32. 03:09First of all, I could open up just my finder on my Mac OS and review the files, but there is an easier way within Claude code desktop application.
  33. 03:18I can head over here like on this I can hit the files button.
  34. 03:23And a personal preference that I have is I don't really like my my file tree be listed here on the right.
  35. 03:32So I'm just going to head over here to change this to be on the left.
  36. 03:36Let me resize this so that we have a little bit more room.
  37. 03:39And there it is.
  38. 03:40This is the entire folder of our application.
  39. 03:43Now there are some folders and some files which we are going to be looking more often than not.
  40. 03:49And then there are folders and files which we don't really need to care about.
  41. 03:53Let's quickly like let's start off with the ones that we are going to be looking at every now and then.
  42. 03:59So first of all, we have the app folder.
  43. 04:01This is where all of the views of our application are defined along with you know all of the dependencies that they might require um and like custom local components
  44. 04:12that we sometimes built for different views.
  45. 04:15But this is also where we are going to find the definition of like the entire like global shared layout of our entire application.
  46. 04:23And also this is where we are going to find uh a global CSS file which is going to define uh all of our CSS variables for this project.
  47. 04:32Um now I can see yes I do definitely recognize these CSS variables color background default color background muted.
  48. 04:41Uh just a reminder um let me switch over to Figma.
  49. 04:45If I go over here to the variables panel these are exactly my own um like semantic tokens which I created uh in Figma and I can see they are
  50. 04:57define over here. One thing that is sort of worrying but um we are going to tackle and discuss this in the next lesson is the fact that um uh
  51. 05:05like my background muted is defined using like a raw hex value and in my Figma I was actually referencing uh a different Tailwind variable but then again we are
  52. 05:17going to worry about this a little bit later.
  53. 05:20Um so so here it is my global CSS file and then all of my page app views and we don't have many because we've just did the first implementation
  54. 05:31are defined here within folders including the thing that my Claude agent decided to do proactively.
  55. 05:37I didn't really ask it to do so uh which is that components gallery page and I can see within this folder there is a page .tsx file which is
  56. 05:46the main file that defines how this page looks like and how it works.
  57. 05:52Um and if I want to preview it in my browser I can actually just look at the like folder name over here and I can just go into my
  58. 06:00browser type in components gallery and it's going to open up this you know, temporary components playground, which Mike Claude decided to implement, uh, which is really nice, but again,
  59. 06:11not something I was expecting Mike Claude to do.
  60. 06:15So you might not have the same page in your implementation, just and it's okay.
  61. 06:20Um, okay. And we also have the parking view and all of the code that, you know, defines, uh, how it works and how it looks like.
  62. 06:29Okay, so this is the app folder, right?
  63. 06:31Again, views and things such as, uh, the main layout or variables.
  64. 06:36Then we have a components folder.
  65. 06:39Um, this is just like a convention that is really widely adopted with Next.js applications, uh, that all of your, um, either primitive UI components or components which, uh, are
  66. 06:51reused across many different views of your application are defined separately in this components folder.
  67. 06:58Um, and yes, over here I do definitely recognize these names, button, alert dialog, info field, list item.
  68. 07:05If I were to go back to Figma and, um, let me zoom out, let me take a look at what's going on here, I can definitely see these are
  69. 07:13the names. So info fields, list item, toast, alert dialog.
  70. 07:18Um, all of this is recreated here and, um, we can like get into each and every component to see how it's defined.
  71. 07:26There is a little bit of logic, there is a little bit of layout.
  72. 07:29So it's a mix of both.
  73. 07:30Um, and then also like, um, like a meta description or a definition of, you know, what you can change about each and every component when you use it.
  74. 07:39Um, so keep on keep in mind that when you try to read these files, uh, it's not just going to be only about how a component looks like, okay?
  75. 07:48Um, okay. And then we have a lib folder and this is a folder that we are probably not going to be using or looking into or thinking about as
  76. 07:57much as other folders as designers because this is where you can define your, like basically the data layer of your application.
  77. 08:04Um, this is where you can, you know, have shared functions or like logic of your application being described over here.
  78. 08:11So this is definitely a folder that we are not going to be looking into as much.
  79. 08:15Uh it doesn't mean it's not important.
  80. 08:16Um you know, quite the opposite actually.
  81. 08:19Uh but again, we are going to uh let Claude handle what's going on in this folder for the purpose of building, you know, these simple MVPs or proof of
  82. 08:27concepts. And then we have the public folder, uh which is a place um that we can use if we want to um you know, store an image file for
  83. 08:36a logo for our application or logo of our partners or photos or other images that are not, you know, served dynamically based on the like let's say the logic
  84. 08:48of our application. Um this is where you would definitely put a logo.
  85. 08:52Uh this is where you would put illustrations for things such as, you know, this arrow over here.
  86. 08:58Um so this is what the public folder is for all assets like audio, videos.
  87. 09:04This is where you would want to keep them here.
  88. 09:06Uh and this matters for Next.js applications because, you know, they, you know, look at what's inside of these folders and sometimes they can, you know, um serve these assets
  89. 09:17um in your implemented application in uh a nicely optimized way.
  90. 09:22Um so that's I believe as far as we should go for now uh about what what this public folder is.
  91. 09:28And then we have uh next and node modules folders.
  92. 09:32So next is um this temporary folder.
  93. 09:34Both of these are grayed out by the way.
  94. 09:36I'm not sure if you can see it here in this recording.
  95. 09:39Um they are grayed out on purpose.
  96. 09:41These are sort of these folders get created automatically and we really don't need to worry about those.
  97. 09:46So next is this special kind of folder that is going to keep files for our, you know, for for like for the built version of our Next.js application locally.
  98. 09:56So you just saw me running that npm run dev command in the terminal.
  99. 10:00And when I did this, what Next.js and Node did is um you know, it has basically rebuilt this folder uh because this is where like the that our browser
  100. 10:12can read are actually stored.
  101. 10:15We you know, I can delete it and that is not going to be an issue because basically next time I run npm run dev, it's going to come back
  102. 10:24and it's okay. Not that I should be deleting this folder.
  103. 10:27The best way to do or like handle this folder is by just not touching it and that's it.
  104. 10:33And then we have the node modules and this is where all of the dependencies of for our application are going to be installed.
  105. 10:41So in one of the previous lessons we talked about node and npm being you know this Figma community for our Figma files.
  106. 10:51So I'm sorry, Figma community for like for node-based applications.
  107. 10:56So all of the extensions third-party extensions are going that you know we are going to install to with our application are going to be stored in here and we
  108. 11:07don't really need to worry about this folder.
  109. 11:09It's you know it's all designed so that it basically maintains itself.
  110. 11:15And then we have a couple of folders.
  111. 11:17Again most of these are either created or maintained or updated automatically such as the package lock JSON.
  112. 11:26Again it basically lists out it's sort of a like a cooking recipe for your application.
  113. 11:32So it's a list or registry of all of the dependencies for your application and the versions for these.
  114. 11:39But then we have some files that are worth our attention.
  115. 11:43And the first one is that CLAUDE.md.
  116. 11:46So MD markdown file, something that we can totally edit ourselves.
  117. 11:51If we just head over here the view source, I can I can start like changing the contents because you know it's meant to be human readable.
  118. 12:00It's basically a brief description of what our application is.
  119. 12:04You might be wondering why do we need one in the first place anyway?
  120. 12:07First of all, right now it's only me and Claude who's been working on this application so we know everything there is to know about this application.
  121. 12:16But next time I invite one of my colleagues to join me on working on this application then might actually find this sort of description of what this project is
  122. 12:25and how it's built and you know things to keep an eye on very helpful.
  123. 12:30And the same is true when working with Claude.
  124. 12:32So right now I only have this one Claude session and this Claude session knows literally everything there is to know about what this application is and how it's built.
  125. 12:45But if I now were to start working on a new thing within this application by going into here and starting a new session, this brand new session would basically
  126. 12:57not have it's basically as if I were to go and invite a new person to enter the room and just start like talking to it about this application.
  127. 13:06At first it's going to need to take a moment to read through the files just to figure out that okay it seems to be an application that allows you
  128. 13:14to book parking spots, right?
  129. 13:16And you know us having Claude constantly re-reading like the files every time we start a new session is not like the most optimal optimal things to do.
  130. 13:27So this is exactly why the CLAUDE.md file exists.
  131. 13:31It's a sort of a like a memory system.
  132. 13:33Everything we run we like input over here is going to be read read by Claude when you initialize a new session and it's going to help it get started
  133. 13:42a little bit faster.
  134. 13:44Now [snorts] AGENTS.md you know is in spirit the exact same kind of file.
  135. 13:50So you might be wondering why we have both and why the contents is different because you see when this Claude session started working on this next JS application it
  136. 14:00has run a command that basically like creates these files automatically within a split of a second.
  137. 14:09So these are like hand like hard-coded files that appear every time you start a new next JS application.
  138. 14:16So things that are here have been added here by Next.js developers.
  139. 14:21And the AGENTS.md file is basically the same kind of file as CLAUDE.md, except this is a standard that all other AI companies have agreed on using.
  140. 14:33So I'm talking about OpenAI and Codex.
  141. 14:36I'm talking about Grok.
  142. 14:37I'm talking about Gemini models.
  143. 14:40I'm talking about like Cursor models.
  144. 14:43They will all look for the AGENTS.md file.
  145. 14:46But the funny part is that it doesn't mean that when they don't find one and find the CLAUDE.md instead, they are not going to read these models and
  146. 14:53are not going to read this file.
  147. 14:55They are going to do so.
  148. 14:56And the same is true in the opposite direction.
  149. 14:58If you have a Claude like Claude code reading through a codebase that only have agent that only has AGENTS.md file, it is still going to read it.
  150. 15:08So it's not ideal to have two.
  151. 15:11And at some point I will definitely want to fix fix it up.
  152. 15:15And then we have the README MD file.
  153. 15:17And this is something that humans have been creating for other humans before AI assisted coding was ever a thing.
  154. 15:27And again, it's not ideal because some of the things that are like explained over here in the README file can be also found within the CLAUDE.md file.
  155. 15:36So three files all trying to do same thing.
  156. 15:42We are going to definitely want to fix it up at some point.
  157. 15:47So yeah, that is it in terms of the most important things about like your folder structure.
  158. 15:55Again, as a recap, the most important folders for us designers to keep an eye on are the components because this is where we are going to find like definition
  159. 16:06of UI components. And then the I'm sorry, the app folder and specifically the global CSS file.
  160. 16:14Sometimes it might be called index CSS or style CSS, any CSS file is something we can keep an eye on because it's going to have definitions of variables and
  161. 16:26you know other visual things.
  162. 16:28So that's it. In the next lesson we're going to take a look at Tailwind because it's going to help us out tremendously with styling.
  163. 16:38Thank you.

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…