Course

App Router

You’ll primarily work within this folder on most feature implementations, including creating pages, API routes, etc.

Before diving into this folder’s details, let's first run the application using:

npm run dev

Now, back to the app folder—you'll notice several files and folders, such as:

  • fonts: This is where you can store font files, import them into the application, and use them easily. Your own self-hosted fonts.
  • favicon.ico: Any file with this name in the root of the app folder will become your website’s favicon. It’s a naming convention of Next.js for adding favicon.
  • globals.css: This is where you can write all your custom CSS or TailwindCSS utilities.
  • layout.tsx: This is the main entry point for your application. Anything you do here will be applied across all pages and routes. That’s why we’ve imported fonts, styles, and metadata information here. For example, let's change the metadata from Create Next App to Hello Next.js 👋. Visit your browser, and you'll instantly see the change without reloading.
  • page.tsx: This file represents the home page or / route of your site. It contains some boilerplate code by default. Let’s remove it and replace it with “Welcome to Next.js.” You can style the text, make it bold, or increase the font size using TailwindCSS. You’ll see the changes instantly on the site, thanks to HMR (Hot Module Replacement)

0 Comments

glass-bbok

No Comments Yet

Be the first to share your thoughts and start the conversation.

tick-guideNext Lesson

React Client and Server Components