Project Structure
Understand the folder structure of Nuxt project to navigate and customize your application.
app/: Core application logic.app.vue: Main app component, defining the root layout.app.config.ts: Global app configuration, including colors and Nuxt UI component classes used across the project.components/: Reusable Vue components (e.g., buttons, modals).composables/: Reusable logic functions (e.g.,useSeo.tsfor SEO).middleware/: Route-specific middleware (e.g., authentication checks).pages/: Defines routes using file-based routing (e.g.,app/pages/about.vuecreates/about).plugins/: Nuxt plugins for extended functionality (e.g., analytics).error.vue: Custom error page, any unexpected error will go to this page.
layouts/: Custom layouts for pages (e.g.,layouts/default.vue).server/: API routes and middleware for server-side logic.public/: Static assets like images, favicon, or fonts (e.g.,public/images/logo.png).shared/: Shared configuration files (e.g.,shared/config.tsfor app settings).locales/: Language files for internationalization (e.g.,locales/en.json).content/: Markdown or CMS content used by Nuxt Content (e.g., blog posts, docs).
Usage
- Navigate the Project: Use the folder structure to locate files for customization (e.g., edit
app/pages/index.vuefor the homepage). - Add Pages: Create new
.vuefiles inapp/pages/to add routes (e.g.,app/pages/contact.vuefor/contact). - Customize Components: Modify or add components in
components/for reusable UI elements. - Configure Settings: Update
shared/config.tsfor app-wide settings like SEO or branding.