Skip to content

STP5940/nuxtjs4-app

Repository files navigation

Nuxt4 Minimal Starter

Look at the Nuxt documentation to learn more.

Setup

Make sure to install dependencies:

npm install

ติดตั้ง Prisma CLI

# รันคำสั่งนี้แค่ครั้งแรก ของการติดตั้งโปรแกรม
$ npm install prisma -g
$ npm install @prisma/client
$ npx prisma generate

สร้าง structure ฐานข้อมูล และใส่ข้อมูลตัวอย่าง

  • *** ใช้ฐานข้อมูล ในเครื่องตัวเอง
# รันคำสั่งนี้แค่ครั้งแรก ของการติดตั้งโปรแกรม
$ npx prisma migrate reset
$ npx prisma migrate dev --name init
# Table: T_Users
# รันคำสั่งนี้แค่ครั้งแรก ของการติดตั้งโปรแกรม
$ npm run seed
  • คำสั่งอื่นๆ
# เรียกใช้ Prisma Studio เพื่อใช้แก้ไขข้อมูลในฐานข้อมูล
$ npx prisma studio
# สร้างไฟล์มิกเรตใหม่ อัปเดตฐานข้อมูล
$ npx prisma migrate dev
# init คือชื่อของการ migrate ตัวอย่าง
$ npx prisma migrate dev --name create_signinlogs_table

Development Server

Start the development server on http://localhost:3000:

npm run dev

Production

Build the application for production:

npm run build

Locally preview production build:

npm run preview

Install prisma global

npm install -g prisma@6.7.0

Install seed

npm run seed

Server api best practices

server/
├── api/
│   └── v1/
│       └── users/
│           ├── index.get.ts    // GET     ดึงรายชื่อผู้ใช้ทั้งหมด (List)
│           ├── index.post.ts   // POST    สร้างผู้ใช้ใหม่ (Create)
│           ├── [id].get.ts     // GET     ดูรายละเอียดรายคน (Detail)
│           ├── [id].put.ts     // PUT     แก้ไขข้อมูล (Update)
│           └── [id].delete.ts  // DELETE  ลบผู้ใช้ (Delete)

Extensions VS Code

  • ไม่ควรใช้ Vetur ให้ใช้ Volar
  • Vetur ไม่รองรับ Top-level await ใน script setup

Check out the deployment documentation for more information.

🚀 Nuxtjs4 App 🖥️

Nuxt4 Minimal Starter

About

🏎️💨 NuxtJS4: MSSQL, Prisma ORM

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages