Skip to content
All notes

5 min readUpdated

How to Build a Website with Next.js: A Starter Guide

Learn how to build a website with the Next.js App Router through planning, page structure, data, metadata, images, testing and release decisions.

By Kamer Can İzvermez · The Kai

How to Build a Website with Next.js: A Starter Guide — cover

Building a site with Next.js is not just running a command and generating pages. First the site’s purpose, content owner, primary action and data needs are defined; then the routes, layouts, components and release model are chosen. The Next.js App Router is file-system based and uses React features such as Server Components, Suspense and Server Functions. Which features to use should be decided by what the site actually needs.

Komsa responsive web detail screen
How responsive content and navigation decisions look on a real venue surface.

The workflow from setup to release

  1. Write down the need and the routesList the homepage, information pages, contact, language and data flow.
  2. Start the projectSet up the TypeScript, lint and App Router basics with create-next-app.
  3. Separate layouts and pagesPut the shared navigation and footer in the layout and the route content in the page.
  4. Add data and metadataDecide the Server/Client split, the cache behaviour, and the title, description and OG image.
  5. Test and releaseComplete the responsive, accessibility, link, form, build and release-environment checks.
Choose Next.js decisions by use case.
NeedStarting optionWatch for
Static showcaseStatic exportServer features are left out
Live dataServer or client fetchCache, error and loading states
FormRoute Handler or external endpointValidation and spam protection
Private dataServer Component / server endpointAuth and permission checks
SEO and sharingMetadata API + OGUnique content for every route

Static export generates HTML per route at build time and lets you move the result to a server that can serve static files. An API call from the browser may still be possible; but a secret key, privileged data, a payment webhook or business logic that has to run on a server needs a server side as well. So do not read “static” as “no dynamic data can ever be used”; the decision depends on where the data is processed and with what permissions.

In the App Router, pages and layouts are Server Components by default. A Client Component is chosen when you need interaction, a browser API or local state. Data fetching behaviour is likewise set not by a default slogan but by the need for freshness, caching, errors and loading. The Next.js data fetching guide explains that with slow sources the flow can be split up with loading.js or Suspense.

Generalisations such as “Next.js is the best framework” or “Core Web Vitals are almost always 90+” are not a sound starting point. Core Web Vitals are not a score; they are made up of real-user experience metrics such as LCP, INP and CLS. The Next.js production checklist covers image optimisation, caching, security, accessibility, metadata and measurement together. Vercel can offer conveniences such as automatic previews and HTTPS; check the plan and usage terms separately.

For your first project, pick a small route, run it, see the error and compare it with the acceptance example. Then add the shared layout, metadata, images, forms and release steps. On a surface carrying real multilingual content such as Komsa you can study why route and language decisions are handled separately, and on a visually heavy surface such as Shortlist Creative, why media and responsive decisions are.

Think of the minimal route example as behaviour first

An example scenario: the file app/hakkimizda/page.tsx starts as a Server Component; the page has a heading, a description and an image. The shared app/layout.tsx carries the navigation and the metadata base. If an interactive language switcher or a form field is needed, only that piece is made a Client Component. This split sets boundaries by need instead of loading the whole page with unnecessary browser JavaScript.

Before release, check /hakkimizda, the language route, the 404, metadata, image alt text, keyboard navigation and the mobile breakpoint. Then verify the production output with next build. A passing build does not by itself prove visual or content accuracy; real route and device checks are still required.

Read the file tree through a small example

An example scenario: app/page.tsx holds the homepage, app/hakkimizda/page.tsx the information page, app/layout.tsx the shared shell and app/not-found.tsx the route that is not found. Images under public/ are referenced at build time. When adding a page, first write the route’s expected URL, then its metadata and lastly whether interaction is needed. This order fixes user behaviour before component names.

For a Client Component such as a form, browser state and validation can be used; a secret key or privileged data must not be placed in the client bundle. When choosing between a Route Handler and an external endpoint, decide on request validation, spam control, the error message and who is responsible for logs. In a Server Component that uses fetch, the loading, error and cache behaviour should be tried against the real data source. An empty demo endpoint does not prove production behaviour.

In the release check, open every important route directly; check the title, description, OG image, canonical, alt text, 404, language link and keyboard focus. When static export is chosen, list the unsupported server features in advance. For Core Web Vitals, read the definitions of LCP, INP and CLS in the official guide and plan real-user measurement; a Lighthouse result alone is not user experience or a sales result.

A small but complete vertical slice for the first release

At the start, instead of producing only the homepage, choose a small vertical slice: the homepage, one content route, a 404 and completed metadata. That slice should include a real image, a mobile breakpoint, keyboard focus, an internal link and, if needed, a form error state. This shows the file tree, the data flow and the release model working together. Later pages share the same shell; but for every new route the content owner, canonical, image alt text and empty state are thought through again. This method ties learning the framework to real delivery criteria and makes visible the difference between an incomplete demo and a production-ready site.