Thuta Learning
Vue.js
BasicWeb DevelopmentBeginner

Create a Vue Project with Vite

Vue.jsLesson 320 min

What you'll walk away with

  • Create a Vue project
  • Run the development server
  • Get familiar with the main project folders

Explain it simply

Create a Vue Project with Vite, in plain language

Install Node.js, then run create-vue from your terminal. Among the project options, you can pick Vue Router, Pinia, and testing as needed. src/App.vue is the root component, and src/main.js is the entry file that starts up the app.

Problem → Why → Solution

The problem — why this concept matters

Starting the dev server before running npm install

A common mistake

Running the terminal outside the project directory

Core concept — understand how it works

Use the official create-vue scaffolding tool to spin up a Vite-based Vue 3 project.

Mental model
  1. props or event
  2. component and template
  3. rendered Vue UI

Create a Vue project

Core syntax or pattern

bash
npm create vue@latest
cd my-vue-app
npm install
npm run dev

Use the official create-vue scaffolding tool to spin up a Vite-based Vue 3 project.

Read the code step by step

  1. props or eventnpm create vue@latest

    Install Node.js, then run create-vue from your terminal. Among the project options, you can pick Vue Router, Pinia, and testing as needed. src/App.vue is the root component, and src/main.js is the entry file that starts up the app.

  2. component and templatenpm install

    Use the official create-vue scaffolding tool to spin up a Vite-based Vue 3 project.

  3. rendered Vue UInpm run dev

    Apply Create a Vue Project with Vite in a small example and test normal, edge, and failure cases.

Execution flow
  1. props or event
  2. component and template
  3. rendered Vue UI

Success

Create a Vue project

Failure

Starting the dev server before running npm install

Let's break it down simply

Install Node.js, then run create-vue from your terminal. Among the project options, you can pick Vue Router, Pinia, and testing as needed. src/App.vue is the root component, and src/main.js is the entry file that starts up the app.

bash
npm create vue@latest
cd my-vue-app
npm install
npm run dev
You should see
Local: http://localhost:5173/

Try it yourself

Create a new project and change the heading in App.vue to "My Vue Lab".

Vue Quick Start — Vue.js

Real-world usage

How to apply it in a real project

Apply Create a Vue Project with Vite in a small example and test normal, edge, and failure cases.

Mini challenge

Build it yourself

Create a new project and change the heading in App.vue to "My Vue Lab".

  • Rebuild the example without copying it
  • Test a normal input and an edge case
  • Predict the compiler or output result before running it
bash
npm create vue@latest
cd my-vue-app
npm install
npm run dev

Expected: Create a Vue project

Show hint

Apply Create a Vue Project with Vite in a small example and test normal, edge, and failure cases.

Quick quiz 1 / 3

What best describes the core idea of Create a Vue Project with Vite?

Quick quiz 2 / 3

Which mistake should you avoid first?

Quick quiz 3 / 3

How should this be applied in a real project?

What to remember

  • props or event → component and template → rendered Vue UI
  • Use the official create-vue scaffolding tool to spin up a Vite-based Vue 3 project.
  • Starting the dev server before running npm install
  • Apply Create a Vue Project with Vite in a small example and test normal, edge, and failure cases.

Vue Quick Start — Vue.js

Easy traps

  • Starting the dev server before running npm install
  • Running the terminal outside the project directory

Exercise

Create a new project and change the heading in App.vue to "My Vue Lab".

You'll know it worked when: Local: http://localhost:5173/

Updated on

Progress is saved only in this browser on this device. It isn't synced to other devices.

Report a problem with this lessonOpens your email app with this lesson's address filled in — nothing is sent until you send it.

Create a Vue Project with Vite | Thuta Learning