feat: Scaffold new Nuxt.js application with initial pages, layouts, composables, and middleware.

This commit is contained in:
supalerk-ar66 2026-01-23 09:54:35 +07:00
parent ab3124628c
commit 9bfb852ad0
8 changed files with 113 additions and 48 deletions

View file

@ -1,13 +1,18 @@
// Nuxt 3 + Quasar + Tailwind + TypeScript
// Configuration for E-Learning Platform
// ไฟล์ตั้งค่าหลักของ Nuxt.js ใช้สำหรับกำหนด Modules, Plugins, CSS และ Environment Variables
export default defineNuxtConfig({
// Modules ที่ใช้ในโปรเจกต์
// - nuxt-quasar-ui: สำหรับ UI Component Library (Quasar)
// - @nuxtjs/tailwindcss: สำหรับ Utility-first CSS Framework
// - @nuxtjs/i18n: สำหรับระบบหลายภาษา (Internationalization)
modules: ["nuxt-quasar-ui", "@nuxtjs/tailwindcss", "@nuxtjs/i18n"],
// i18n Configuration
// การตั้งค่า i18n (ระบบภาษา)
i18n: {
strategy: 'no_prefix',
defaultLocale: 'th',
langDir: 'locales',
strategy: 'no_prefix', // ไม่ใส่ prefix URL สำหรับภาษา default
defaultLocale: 'th', // ภาษาเริ่มต้นเป็นภาษาไทย
langDir: 'locales', // โฟลเดอร์เก็บไฟล์แปลภาษา
locales: [
{ code: 'th', name: 'ไทย', iso: 'th-TH', file: 'th.json' },
{ code: 'en', name: 'English', iso: 'en-US', file: 'en.json' }
@ -18,14 +23,19 @@ export default defineNuxtConfig({
redirectOn: 'root'
}
},
// ไฟล์ CSS หลักของโปรเจกต์
css: ["~/assets/css/main.css"],
typescript: {
strict: true,
},
// การตั้งค่า Quasar Framework
quasar: {
plugins: ["Notify"],
plugins: ["Notify"], // เปิดใช้ Plugin Notify
config: {
brand: {
brand: { // กำหนดชุดสีหลัก (Theme Colors)
primary: "#4b82f7",
secondary: "#2f5ed7",
accent: "#44d4a8",
@ -33,12 +43,16 @@ export default defineNuxtConfig({
},
},
},
// กำหนดให้ Nuxt สแกน Components ในโฟลเดอร์ ~/components โดยอัตโนมัติ
components: [
{
path: "~/components",
pathPrefix: false,
pathPrefix: false, // เรียกใช้ Component ได้โดยไม่ต้องมี prefix ชื่อโฟลเดอร์
},
],
// การตั้งค่า HTML Head (Meta tags, Google Fonts)
app: {
head: {
htmlAttrs: {
@ -51,11 +65,14 @@ export default defineNuxtConfig({
link: [
{
rel: "stylesheet",
// โหลด Font: Inter, Prompt, Sarabun
href: "https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Prompt:wght@300;400;500;600;700;800;900&family=Sarabun:wght@300;400;500;600;700;800&display=swap",
},
],
},
},
// Environment Variables ที่ใช้ในโปรเจกต์ (เข้าถึงได้ทั้ง Server และ Client)
runtimeConfig: {
public: {
apiBase: process.env.NUXT_PUBLIC_API_BASE || 'http://localhost:4000/api'