Performance
03-09-2026
7 min read

Nuxt 3 Tutorial - Complete Beginner Guide

This comprehensive Nuxt 3 tutorial provides practical guidance for setting up, structuring, and optimizing Nuxt 3 projects, helping teams speed up development and avoid common pitfalls.

By Nunuqs Team

If your team is updating frameworks, bringing developers onto a new stack, or planning a greenfield SaaS or ecommerce product, this Nuxt 3 tutorial cuts weeks of rework. You'll get practical steps for fast ramp-up, code patterns that avoid common mistakes, and plain reasoning behind major architectural choices-drawn from senior engineers who have shipped Nuxt 2 → Nuxt 3 migration upgrades in large U.S. organizations.

Pro Tip

Create a branch just for sandboxing your Nuxt 3 experimentation. Keep demo and production logic separate to move fast without risking accidental API or config changes.

Nuxt 3 Tutorial - Complete Beginner Guide

Modern Project Setup & Environment Configuration

Nuxt 3's revamped CLI and configuration simplify initial setup. Start with a clean, predictable foundation to lower maintenance, improve scalability, and speed up new developer ramp time.

Start by installing Nuxt 3 using nuxi CLI:

Assumption: Node 18+, Vite build, Pinia instead of Vuex, and modern hosting (Vercel/Netlify or Dockerized VPS).

      
    
  • nuxt.config.ts is TypeScript-first-type safety shortens feedback loops and helps new devs get productive faster.
  • .env.local manages sensitive environment variables with fallbacks for CI/CD.
  • tsconfig.json controls workspace-wide type hints and keeps IDEs useful.

Why TypeScript and How to Structure Configurations

Nuxt 3 uses a single configuration file (nuxt.config.ts) for build, runtime, and modules. It supports runtime configuration injected via environment variables:

      
    

Never put secrets in public config-public values are shipped to the browser. Mistakes here can expose credentials, a common source of production incidents in SaaS/ecommerce stacks.

Pro Tip

Keep sensitive API keys in .env.local and never commit secrets. Use separate files per environment (.env.staging.local, etc.) to isolate deployments.

Version Management & Production Tips:

  • Pin Node and Nuxt versions in package.json for deterministic builds.
  • Audit dependencies monthly; avoid semver wildcards ("^", "~") in production.
  • Use npm ci in CI/CD for consistent dependency resolution.

ROI: A streamlined setup with strong defaults cuts developer ramp time from days to hours and prevents config drift that slows teams later.

Structure: Project Anatomy & File-Based Routing in Nuxt 3

Nuxt 3's directory-first approach handles routing and module discovery by convention-fewer decisions, faster collaboration, and consistent structure for large teams.

A canonical Nuxt 3 project tree:

/pages, /components, /layouts, /server, /composables, /middleware, /utils each signals intent. Ignoring conventions becomes long-term debt.

my-nuxt3-app/
├─ assets/
├─ components/
│ └─ MyButton.vue
├─ composables/
│ └─ useAuth.ts
├─ middleware/
│ └─ auth.global.ts
├─ pages/
│ ├─ index.vue
│ ├─ products/
│ │ └─ [id].vue
│ └─ [...slug].vue
├─ server/
│ ├─ api/
│ │ └─ products.ts
│ └─ routes/
├─ layouts/
│ └─ default.vue
├─ nuxt.config.ts
├─ package.json
└─ tsconfig.json

File-Based Routing Logic Explained

Every .vue file in /pages becomes a route (see the Nuxt docs on routing: Nuxt routing documentation):

  • /pages/index.vue/
  • /pages/products.vue/products
  • /pages/products/[id].vue/products/:id (dynamic)
  • /pages/[...slug].vue/anything/nested/here (catch-all)

Nested directories generate nested routes and layouts. Catch-all routes handle fallback 404s, campaign pages, or deep ecommerce category trees. For redirects, navigateTo('/path') handles routing without manual registration.

Practical visualization:

  • New-user flow: /pages/onboarding/step1.vue, /pages/onboarding/step2.vue
  • Ecommerce product detail: /pages/products/[slug].vue

Pro Tip

For microservices or modular platforms, keep shared components and utilities outside /pages to avoid exposing internals in your public route surface.

Why this matters for enterprise teams: Prescriptive structure improves handoff, reduces ramp time, and standardizes contributions across multiple teams. Learn more in the Nuxt docs: Nuxt documentation

Components: Auto-Import System & Naming Conventions

Nuxt 3 auto-imports from /components, /composables, and /utils. Drop <MyButton /> into any template-no manual import needed.

      
    
Share this article:

Get your Nuxt 2 audit

Full code analysis in 48 hours

Comprehensive audit with risk assessment and migration roadmap

Fixed price - no surprises

$499 audit with transparent pricing and no hidden fees

Expert migration guidance

Tailored recommendations for your specific Nuxt 2 codebase

Need technical support or have questions?

Contact support →

Tell us about your project

You can also email us at hello@nunuqs.com