Introduction · Get Started with Nuxt (2024)

Nuxt is a free and open-source framework with an intuitive and extendable way to create type-safe, performant and production-grade full-stack web applications and websites with Vue.js.

We made everything so you can start writing .vue files from the beginning while enjoying hot module replacement in development and a performant application in production with server-side rendering by default.

Nuxt has no vendor lock-in, allowing you to deploy your application everywhere, even on the edge.

Nuxt uses conventions and an opinionated directory structure to automate repetitive tasks and allow developers to focus on pushing features. The configuration file can still customize and override its default behaviors.

  • File-based routing: define routes based on the structure of your pages/ directory. This can make it easier to organize your application and avoid the need for manual route configuration.
  • Code splitting: Nuxt automatically splits your code into smaller chunks, which can help reduce the initial load time of your application.
  • Server-side rendering out of the box: Nuxt comes with built-in SSR capabilities, so you don't have to set up a separate server yourself.
  • Auto-imports: write Vue composables and components in their respective directories and use them without having to import them with the benefits of tree-shaking and optimized JS bundles.
  • Data-fetching utilities: Nuxt provides composables to handle SSR-compatible data fetching as well as different strategies.
  • Zero-config TypeScript support: write type-safe code without having to learn TypeScript with our auto-generated types and tsconfig.json
  • Configured build tools: we use Vite by default to support hot module replacement (HMR) in development and bundling your code for production with best-practices baked-in.

Nuxt takes care of these and provides both frontend and backend functionality so you can focus on what matters: creating your web application.

Server-Side Rendering

Nuxt comes with built-in server-side rendering (SSR) capabilities by default, without having to configure a server yourself, which has many benefits for web applications:

  • Faster initial page load time: Nuxt sends a fully rendered HTML page to the browser, which can be displayed immediately. This can provide a faster perceived page load time and a better user experience (UX), especially on slower networks or devices.
  • Improved SEO: search engines can better index SSR pages because the HTML content is available immediately, rather than requiring JavaScript to render the content on the client-side.
  • Better performance on low-powered devices: it reduces the amount of JavaScript that needs to be downloaded and executed on the client-side, which can be beneficial for low-powered devices that may struggle with processing heavy JavaScript applications.
  • Better accessibility: the content is immediately available on the initial page load, improving accessibility for users who rely on screen readers or other assistive technologies.
  • Easier caching: pages can be cached on the server-side, which can further improve performance by reducing the amount of time it takes to generate and send the content to the client.

Overall, server-side rendering can provide a faster and more efficient user experience, as well as improve search engine optimization and accessibility.

As Nuxt is a versatile framework, it gives you the possibility to statically render your whole application to a static hosting with nuxt generate,disable SSR globally with the ssr: false option or leverage hybrid rendering by setting up the routeRules option.

Read more in Nuxt rendering modes.

Server engine

The Nuxt server engine Nitro unlocks new full-stack capabilities.

In development, it uses Rollup and Node.js workers for your server code and context isolation. It also generates your server API by reading files in server/api/ and server middleware from server/middleware/.

In production, Nitro builds your app and server into one universal .output directory. This output is light: minified and removed from any Node.js modules (except polyfills). You can deploy this output on any system supporting JavaScript, from Node.js, Serverless, Workers, Edge-side rendering or purely static.

Read more in Nuxt server engine.

Production-ready

A Nuxt application can be deployed on a Node or Deno server, pre-rendered to be hosted in static environments, or deployed to serverless and edge providers.

Read more in Deployment section.

Modular

A module system allows to extend Nuxt with custom features and integrations with third-party services.

Read more in Nuxt Modules Concept.

Architecture

Nuxt is composed of different core packages:

We recommend reading each concept to have a full vision of Nuxt capabilities and the scope of each package.

Introduction · Get Started with Nuxt (2024)

FAQs

How to start a Nuxt project? ›

To start a new Nuxt project run npx nuxi init [project-name] in your terminal. Open your new project in your favorite code editor (VS code recommended). Now run yarn install or npm install to install project dependencies and packages. Lastly, run yarn dev or npm run dev to view project on a development server.

What is the entry point of Nuxt? ›

When running nuxt build with the Node server preset, the result will be an entry point that launches a ready-to-run Node server. This will launch your production Nuxt server that listens on port 3000 by default. It respects the following runtime environment variables: NITRO_PORT or PORT (defaults to 3000 )

How to check if Nuxt is installed? ›

To check the existing NuxtJS Version of the project, run yarn why nuxt on your terminal from the project root directory. If you want to check for the VueJS version, install Vue Developer tool web extension, and check for Vue version. If you have installed create-nuxt-app globally using npm, first uninstall that.

How to install nuxt.js in Ubuntu? ›

Table of Contents
  1. Prerequisites.
  2. Steps to create a Nuxt app.
  3. 2.1. Install create-nuxt-app.
  4. 2.2. Review the folder/file structure.
  5. 2.3. Run the Nuxt.js application.

Is nuxt a full-stack framework? ›

Nuxt is a free and open-source framework with an intuitive and extendable way to create type-safe, performant and production-grade full-stack web applications and websites with Vue. js.

Is Nuxt frontend or backend? ›

js is categorized as a full-stack framework for creating server-side rendering React apps. Meanwhile, Nuxt. js is categorized as a frontend framework for building universal Vue apps.

Should I use Nuxt instead of Vue? ›

- For Simple Projects or Beginners: If you're just starting out or working on a small project, Vue. js might be the better choice. Its simplicity and flexibility make it easy to learn and use. - For Larger Projects or Teams: If you're working on a larger project or with a team of developers, Nuxt.

Which companies use Nuxt? ›

Who uses Nuxt.js?
CompanyWebsiteCompany Size
Globantglobant.com>10000
SAP SEsap.com>10000
AppSumoappsumo.com50-200
Chargebeechargebee.com1000-5000
1 more row

Is Nextjs similar to Nuxt? ›

In summary, while Nuxt. js is excellent for smaller to mid-sized projects with quick development needs, Next. js provides the scalability and flexibility required for larger, more complex applications.

Why should I use nuxt? ›

Nuxt. js gives you access to properties like isServer and isClient on your components so you can easily decide if you're rendering something on the client or on the server. There's also special components like the no-ssr component which is used to purposely prevent the component from rendering on the server side.

Does nuxt use vite? ›

We use the following build tools by default: Vite or webpack.

How to use jest in nuxt? ›

Steps
  1. Install dependencies. npm i -D @vue/test-utils babel-core@^7.0.0-bridge.0 babel-jest jest vue-jest.
  2. Add command test in package. ...
  3. Add file jest.config.js in root directory. ...
  4. Add file .babelrc in root directory. ...
  5. Create test directory in root directory. ...
  6. Write your first test of your component /test/YourComponent.spec.js.
Jan 27, 2021

How do I import plugins into Nuxt? ›

In Nuxt, plugins are automatically imported from the plugins directory. However, if you need to ship a plugin with your module, Nuxt Kit provides the addPlugin and addPluginTemplate methods. These utils allow you to customize the plugin configuration to better suit your needs.

How does Nuxt SSR work? ›

Server-Side Rendering (SSR): Enhances performance and SEO by rendering pages on the server before sending them to the client. Static Site Generation (SSG): At the same time, Nuxt supports generating static websites that are highly performant and easily deployable to various hosting platforms.

What versions of node are supported by Nuxt 3? ›

On the server side, Nuxt 3 supports Node. js 14, 16, 18, and 19 at the moment. We encourage everyone to use the latest LTS releases of Node. js, we push them once widely adopted by major deployment platforms.

How do I launch a Vue project? ›

With these things set up, you're all ready to start your first Vue 3 project!
  1. Step 1: Install Node. js and Vue CLI. ...
  2. Step 2: Creating Your Vue 3 Project. ...
  3. Step 3: Project Structure and Configuration. ...
  4. Step 4: Understanding Composition API. ...
  5. Step 5: Adding Components and Routing. ...
  6. Step 6: Running the Project.
Feb 26, 2024

How to run nuxt build locally? ›

Run the Nuxt app locally

Nuxt generates files (opens in a new tab) related to your application in the hidden . nuxt directory during development. In your web browser, navigate to http://127.0.0.1:3000 to see the default landing page generated by Nuxt.

How to start an npm project? ›

To start an npm project, you can run npm init in the directory where you want to initiate the project. You will be prompted with some prompts about the name of the project and some other stuff that you can just skip by pressing enter . After that a package. json file will be created.

How to start a Angular js project? ›

How to Build a Single Page Application with AngularJS
  1. Step 1: Create a Module.
  2. Step 2: Define Controller.
  3. Step 3: Deploy the AngularJS script in HTML Code. ...
  4. Step 5: Configure Routes.
  5. Step 6: Time to Build Controllers.
  6. Step 7: Configuring the HTML Pages.
  7. Step 8: Add Links to Those HTML Pages.

Top Articles
Latest Posts
Article information

Author: Wyatt Volkman LLD

Last Updated:

Views: 6251

Rating: 4.6 / 5 (66 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Wyatt Volkman LLD

Birthday: 1992-02-16

Address: Suite 851 78549 Lubowitz Well, Wardside, TX 98080-8615

Phone: +67618977178100

Job: Manufacturing Director

Hobby: Running, Mountaineering, Inline skating, Writing, Baton twirling, Computer programming, Stone skipping

Introduction: My name is Wyatt Volkman LLD, I am a handsome, rich, comfortable, lively, zealous, graceful, gifted person who loves writing and wants to share my knowledge and understanding with you.