npm create svelte@latest project-name
cd project-name
npm i
npm run dev -- --open
Project will open on Port localhost:5173
npm install prisma --save-dev
npx prisma
npx prisma init
This will Install Prisma
Also add Prisma
Folder and create .env
File
Example :
mongodb+srv://<username>:<password>@bob.qousp1y.mongodb.net/test
Add Your Username & Password
Add your Database Name
/test indicates Database Name
npm install @prisma/client
model Article {
id String @id @default(auto()) @map("_id") @db.ObjectId
title String
desc String
}
npx prisma generate
- Add Queries into
+page.server.js
file in route Folder - Now copy the
+page.server.js
file