CHAPTER 03
Beginner
Vue Project Structure
Updated: May 18, 2026
5 min read
# CHAPTER 3
Vue Project Structure
1. Chapter Introduction
A new Vue 3 project looks overwhelming at first — dozens of files and folders. But each file has a clear purpose. Understanding the project structure is the foundation of productive Vue development. This chapter decodes every file and folder.2. Learning Objectives
-
Understand the role of every folder in
src/.
-
Know what
main.js,App.vue, andindex.htmldo.
- Understand the router, stores, components, and assets folders.
-
Read and understand
vite.config.jsandpackage.json.
3. Full Project Structure
text
4. main.js — Application Entry Point
javascript
5. App.vue — Root Component
vue
6. index.html — HTML Shell
html
7. router/index.js — Router Configuration
javascript
8. stores/counter.js — Pinia Store
javascript
9. Component vs View
text
10. vite.config.js
vite.config.js
11. Common Mistakes
-
Putting page components in
components/instead ofviews/: Components should be small and reusable. Pages go inviews/and map 1:1 with routes.
-
Not using
@/path alias: Using../../components/relative paths breaks when files move. Always use@/which maps tosrc/.
12. MCQs
Question 1
Where does Vue mount to in index.html?
Question 2
What is App.vue?
Question 3
What does @/ path alias resolve to?
Question 4
What folder contains page-level components?
Question 5
What does () => import('../views/About.vue') in router do?
Question 6
What does app.use(router) do?
Question 7
Where do global CSS styles go?
Question 8
<RouterView /> in App.vue renders?
Question 9
What is a Pinia store?
Question 10
vite.config.js is for?
13. Interview Questions
-
Q: Explain the role of
main.jsin a Vue 3 project.
-
Q: What is the difference between
components/andviews/folders?
14. Summary
A Vue 3 Vite project has a clean, predictable structure:main.js bootstraps the app, App.vue is the root, views/ holds pages, components/ holds reusable pieces, router/ configures navigation, and stores/ manages global state. Understanding this structure means understanding Vue architecture itself.