Goal
สร้าง Vue.js applications ด้วย SSR/SSG/ISR และ full-stack capabilities ด้วย Nuxt v4
Scope
ใช้สำหรับการพัฒนา Vue.js applications ที่ต้องการ SEO-friendly, auto-imports, file-based routing, TypeScript support และ server-side capabilities ด้วย Nitro engine
Execute
1. เริ่มต้นใช้งาน
ทำตาม workflows/setup-project.md เพื่อตั้งค่าโปรเจกต์ Nuxt v4 ด้วย npx nuxi@latest init
2. ศึกษาคู่มือ
อ่าน guide/:
quick-start.md- เริ่มต้นใช้งานอย่างรวดเร็วinstallation.md- วิธีติดตั้งและ setup โปรเจกต์how-it-works.md- ภาพรวม architecture และ request lifecycleintegration.md- การเชื่อมต่อกับ libraries และ tools อื่นๆbest-practices.md- best practices สำหรับการพัฒนาconfiguration.md- การตั้งค่าnuxt.config.tsfeatures.md- ฟีเจอร์หลักของ Nuxt v4
3. ทำตาม Workflows
ทำตาม workflows ใน workflows/:
setup-project.md- ตั้งค่าโปรเจกต์create-page.md- สร้างหน้าเว็บด้วย file-based routingcreate-component.md- สร้างคอมโพเนนต์create-module.md- สร้าง Nuxt moduledeploy-nuxt.md- deploy application
4. ศึกษาแนวคิดหลัก
อ่าน key-concepts/:
overview.md- ภาพรวมแนวคิดหลักของ Nuxtauto-imports.md- auto-imports system สำหรับ components และ composablesnitro-server.md- Nitro server engine สำหรับ full-stack capabilitiesnuxt-app-instance.md- Nuxt App instance และ lifecyclerendering-modes.md- rendering modes (SSR, SSG, ISR, SPA)app-directory.md- app/ directory structure ใน Nuxt v4create-use-fetch.md- createUseFetch และ createUseAsyncData factory functions (4.4+)use-announcer.md- useAnnouncer composable สำหรับ accessibility (4.4+)typed-layout-props.md- Typed layout props ใน definePageMeta (4.4+)
5. ปฏิบัติตามหลักการ
อ่าน principles/:
component-design.md- component design principlesdata-fetching.md- data fetching best practicesperformance.md- performance optimization
6. ดูเอกสารอ้างอิง
อ่าน references/:
api.md- API documentationcli.md- CLI commandsconfiguration.md- configuration optionsmodules.md- module systemwebsite.md- official documentationhooks.md- Nuxt hooks system สำหรับ build และ runtimemigration.md- migration guide จาก Nuxt 2 ไป Nuxt 3nuxt-5-preparation.md- Nuxt 5 preparation และ breaking changes
Rules
- ใช้ Nuxt v4 (stable) หรือ Nuxt 3 (maintenance until July 2026)
- ใช้
app/directory structure สำหรับ application code (Nuxt v4 default) - ใช้ TypeScript สำหรับ type safety ด้วย zero-config support และ separate TS projects
- ใช้ Composition API สำหรับ components
- ใช้ auto-imports สำหรับ composables, components และ Vue APIs จาก
app/directory - ใช้ file-based routing จาก
app/pages/directory - เลือก rendering mode ที่เหมาะสม (SSR, SSG, ISR, SPA) ด้วย
routeRules - ใช้
server/directory สำหรับ API routes และ middleware - ใช้ Nitro composables สำหรับ server-side code
- ตั้งค่า
compatibilityDateในnuxt.config.ts - ใช้ Nuxt modules สำหรับ extend functionality ด้วย
@nuxt/kit - ใช้
<NuxtLink>สำหรับ internal navigation และ smart prefetching - ใช้
useFetchและuseAsyncDataสำหรับ data fetching ที่ SSR-compatible พร้อม automatic data sharing - ใช้
createUseFetchและcreateUseAsyncData(Nuxt 4.4+) สำหรับ custom data fetching instances ด้วย default options - ใช้ lazy loading สำหรับ components (
<LazyMyComponent>) - ใช้
featuresconfig สำหรับ enable/disable optional features (devLogs, inlineStyles, noScripts) - ใช้
future.compatibilityVersion: 5สำหรับ early opt-in ไปยัง Nuxt 5 features (Vite Environment API, normalized page names) - ใช้
useAnnouncercomposable (Nuxt 4.4+) สำหรับ accessibility และ dynamic content announcements พร้อม<NuxtAnnouncer>component - ใช้ typed layout props ใน
definePageMeta(Nuxt 4.4+) สำหรับ parameterized layouts ด้วย full type safety - ใช้ Vue Router v5 (Nuxt 4.4+) สำหรับ 28x faster dev routing
- ใช้
refreshoption ในuseCookie(Nuxt 4.4+) สำหรับ cookie refresh control - ใช้
useStatereset to default (Nuxt 4.4+) สำหรับ state management - เตรียมสำหรับ Nuxt 5: Vite 8 (Rolldown), Nitro v3 (Web standard APIs), package renames
- ทำตาม
/follow-nuxtสำหรับ best practices
Expected Outcome
- Vue.js applications ด้วย SSR/SSG/ISR/SPA rendering modes
- SEO-friendly web applications ด้วย server-side rendering
- Modern Vue 3 features และ zero-config TypeScript support
- Auto-imports และ file-based routing จาก
app/directory - Full-stack applications ด้วย Nitro server engine
- Type-safe code ด้วย auto-generated types
- Cross-platform deployment (Node.js, serverless, edge, static)
- Nuxt 4.4+ features (createUseFetch, useAnnouncer, typed layout props, Vue Router v5)
- Nuxt 5 preparation ด้วย future.compatibilityVersion