Introduction
When developing a website, one of the most important things is organising different pages and making navigation between them work properly. For example, a business website may have a Home page, About page, Services page, Blog page and Contact page. Each page needs its own URL and content.
In traditional React applications, developers often use additional libraries such as React Router to manage navigation. Next.js provides its own routing system, making it easier to create and organise website pages.
Understanding App Router
The Next.js App Router uses a file-system-based routing system. This means your folders and files determine the URLs of your website. You do not need to manually create a separate route configuration for every page.
Main routing directory
Source: Next.js documentation
Defines a route's page UI
Source: Next.js documentation
Defines shared page UI
Source: Next.js documentation
Defines a loading state
Source: Next.js documentation
Defines route-level error UI
Source: Next.js documentation
Page File
The page.tsx file defines the content displayed at a particular URL. For example, app/about/page.tsx creates the About page.
Shared Layout
The layout.tsx file allows developers to reuse elements such as headers, navigation bars and footers across multiple pages.
Pages Layouts Navigation
A website usually contains multiple pages, but some elements remain the same on every page. For example, a business website may display the same header, navigation menu and footer on its Home, About, Services and Contact pages.




