The full-stack SSR framework built on Vue 3. Learn file-based routing, the Nitro server, useFetch, SEO optimization, and deployment to Vercel. Rather than listing concepts, this guide is organized so you can follow the content in the order you have to make decisions on a real project.
Key perspective
Frontend / app development
Do not stop at drawing the screen: look at state, data requests, routing, accessibility, and the unit of deployment together.
Vue SSR/SSGNitro server APIsSEO optimizationVercel deployment
Architecture diagrams
To make what you read stick, it helps to capture the flow as a picture first. The two diagrams below are reference maps you can keep coming back to while learning Nuxt.js.
Learning flow
Rendering diagramβ¦
Architecture view
Rendering diagramβ¦
What is Nuxt.js?
When you first open Nuxt.js, the big picture matters more than individual commands. This section starts with the problems the concepts ahead were created to solve.
Nuxt is a full-stack framework that bundles file-based routing, server-side rendering, and an API server (Nitro) on top of Vue. The folder structure itself is the convention: adding a file to pages/ creates a route, and adding a file to server/api/ creates a backend endpoint, automatically.
Here you look at File-based routing alongside real code. Rather than copying the example as-is, read it with an eye on the inputs, the outputs, and the parts most likely to change.
Nuxt turns the file structure of the `pages/` directory directly into routes. A file or folder name wrapped in square brackets (`[id]`) becomes a dynamic segment, and inside the component you read its value with `useRoute()`.
Here you look at useFetch / useAsyncData alongside real code. Rather than copying the example as-is, read it with an eye on the inputs, the outputs, and the parts most likely to change.
useFetch fetches the data once on the server side and passes it straight to the client, so the same request is not sent again from the browser. It re-requests automatically when a reactive value in the watch option changes, so there is no need to write code that calls fetch again by hand every time userId changes.
Here you look at Nitro server API routes alongside real code. Rather than copying the example as-is, read it with an eye on the inputs, the outputs, and the parts most likely to change.
Creating a file under server/api/ makes it a backend endpoint in itself, so you can run the API in the same project as the frontend with no separate Express or NestJS server. A suffix in the file name such as .get.ts determines the HTTP method, so REST conventions are followed with no router configuration.
Here you look at SEO & Meta alongside real code. Rather than copying the example as-is, read it with an eye on the inputs, the outputs, and the parts most likely to change.
useSeoMeta is a composable for declaring the title, description, Open Graph, and Twitter Card tags of each page in one go. Nuxt plants these values directly into the HTML head during server rendering, so search engines and social media crawlers can read the meta information without running JavaScript.
Here you look at Deployment alongside real code. Rather than copying the example as-is, read it with an eye on the inputs, the outputs, and the parts most likely to change.
Thanks to the Nitro engine, Nuxt can build the same codebase for several deployment targets. If `nitro.preset` is not set, Nuxt detects the deployment environment (Vercel, Netlify, and so on) automatically and uses the appropriate preset.
BASH
# Build as a default Node server (SSR)npm run buildnode .output/server/index.mjs# Generate a fully static site (SSG)npx nuxi generate
nuxt.config.tsTYPESCRIPT
export default defineNuxtConfig({ nitro: { preset: 'vercel', // 'node-server' | 'netlify' | 'cloudflare-pages' and so on },});
Deployment target
Command
Characteristics
Node server (SSR)
npm run build
Server rendering on every request β suits real-time data
Static site (SSG)
npx nuxi generate
Pre-generates every page as HTML at build time β suits blogs and the like
Vercel/Netlify/Cloudflare
Set nitro.preset
Optimized automatically for the edge/serverless runtime of the platform
Nuxt.js practical design
Nuxt.js practical design is a point where the options diverge. Using the table to compare what each approach is for and how it differs in operation makes later decisions much easier.
With Nuxt, decide the SSR/CSR/hybrid strategy per page. Auto imports and conventions are convenient, but manage them so boundaries do not blur.
Decision point
Question to ask
Practical guideline
Boundaries
Which parts of the Nuxt.js code are most likely to change?
Separate input/output, configuration, external integrations, and the core rules.
State
Where is state created and where does it go away?
Make the owner and lifecycle of state visible in the code.
Failure
What does the caller receive on failure?
Decide the timeout, fallback, and error contract first.
Nuxt.js operating standards
This section covers Nuxt.js operating standards from a practical perspective. Instead of memorizing the concept, focus on the situations in which you would reach for it.
The Nitro server, route rules, payload size, caching, and image optimization affect production performance.
Nuxt.js verification strategy
Nuxt.js verification strategy is a point where the options diverge. Using the table to compare what each approach is for and how it differs in operation makes later decisions much easier.
Verify route rules, the server API, hydration, and SEO metadata.
Quality axis
How to verify
Definition of done
Correctness
Automate the normal/failure cases.
The core scenarios pass reproducibly.
Regression prevention
When fixing a bug, leave the same case behind as a test.
The same failure is not deployed again.
Operability
Check the logs, metrics, and alerts.
There is a path for tracing the cause when a problem occurs.
Nuxt.js: frequently asked questions
What is the difference between Nuxt and Vue?
Vue is a framework for building screens, and Nuxt is a full-stack framework that adds file-based routing, server rendering, data fetching, and server APIs on top of Vue. It occupies the same place for Vue that Next.js does for React.
Why use useFetch and useAsyncData? Can I not just use fetch?
They pass data fetched during server rendering to the browser so the same request is not sent again. A plain fetch in a component sends the request twice, once on the server and once in the browser. For a request made once in response to a user action, such as a button click, use $fetch.
Where can I deploy a Nuxt app?
The server engine builds output for different runtimes, so you can deploy to a Node.js server, serverless platforms, or edge runtimes. A site that needs no server can be generated as static files and put on static hosting.