Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
6f56175
update react-router-7 example
nikolasburk Oct 1, 2025
ce4d6f6
update solid-start example
nikolasburk Oct 1, 2025
cef2285
update nextjs example
nikolasburk Oct 1, 2025
14a64e9
update nuxt example
AmanVarshney01 Oct 2, 2025
70806d1
update betterauth-nextjs example
AmanVarshney01 Oct 2, 2025
accb59d
update nuxt-prisma-module example
AmanVarshney01 Oct 2, 2025
734bf03
Merge branch 'latest' into chore/fullstack-v7
AmanVarshney01 Oct 2, 2025
5763c56
test with lts
AmanVarshney01 Oct 7, 2025
e255e74
Revert "test with lts"
AmanVarshney01 Oct 7, 2025
f3c51c1
test: comment seed command
AmanVarshney01 Oct 8, 2025
3206fcb
Revert "test: comment seed command"
AmanVarshney01 Oct 8, 2025
e9ef747
test: add prisma generate command
AmanVarshney01 Oct 8, 2025
09bc17d
test: remove accelerate in seed.ts
AmanVarshney01 Oct 8, 2025
88075c0
Revert
AmanVarshney01 Oct 8, 2025
3d48eb5
test
AmanVarshney01 Oct 12, 2025
e50f350
Merge branch 'latest' into chore/fullstack-v7
AmanVarshney01 Oct 12, 2025
6a7a98e
Remove generated files from tracking
nurul3101 Oct 13, 2025
d41cd95
chore: add app/generated to .gitignore
nurul3101 Oct 13, 2025
591d33f
Remove generated files from tracking
nurul3101 Oct 13, 2025
5ea1e9f
chore: add prisma/generated to .gitignore
nurul3101 Oct 13, 2025
12f7b3b
Remove generated files from tracking
nurul3101 Oct 13, 2025
d83ba8b
chore: update .gitignore to include app/generated
nurul3101 Oct 13, 2025
c6a50f8
Remove generated files from tracking
nurul3101 Oct 13, 2025
49434ab
chore: add src/generated to .gitignore
nurul3101 Oct 13, 2025
3978d86
Merge branch 'latest' into chore/fullstack-v7
AmanVarshney01 Oct 22, 2025
16a848c
update @prisma/client prisma
AmanVarshney01 Oct 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion orm/betterauth-nextjs/.env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
BETTER_AUTH_SECRET=
DATABASE_URL=
BETTER_AUTH_SECRET=change-me
BETTER_AUTH_URL=http://localhost:3000
31 changes: 15 additions & 16 deletions orm/betterauth-nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,26 @@
"scripts": {
"dev": "next dev --turbopack",
"build": "next build",
"start": "next start",
"lint": "next lint"
"start": "next start"
},
"dependencies": {
"@prisma/client": "6.10.1",
"@prisma/extension-accelerate": "2.0.2",
"better-auth": "1.2.12",
"next": "15.3.5",
"@prisma/client": "^6.18.0",
"@prisma/extension-accelerate": "^2.0.2",
"better-auth": "1.3.24",
"next": "15.5.4",
"react": "19.1.0",
"react-dom": "19.1.0"
},
"devDependencies": {
"@eslint/eslintrc": "3.3.1",
"@tailwindcss/postcss": "4.1.13",
"@types/node": "20.19.20",
"@types/react": "19.1.8",
"@types/react-dom": "19.1.6",
"eslint": "9.30.1",
"eslint-config-next": "15.3.5",
"prisma": "6.10.1",
"tailwindcss": "4.1.13",
"typescript": "5.8.3"
"@tailwindcss/postcss": "4.1.14",
"@types/node": "24.6.2",
"@types/react": "19.1.0",
"@types/react-dom": "19.1.0",
"eslint": "9.36.0",
"eslint-config-next": "15.5.4",
"prisma": "^6.18.0",
"tailwindcss": "4.1.14",
"typescript": "5.9.3"
}
}
}
5 changes: 3 additions & 2 deletions orm/betterauth-nextjs/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init

generator client {
provider = "prisma-client-js"
output = "../src/generated/prisma"
provider = "prisma-client"
engineType = "client"
output = "../src/generated/prisma"
}

datasource db {
Expand Down
2 changes: 1 addition & 1 deletion orm/betterauth-nextjs/src/lib/prisma.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PrismaClient } from '@/generated/prisma'
import { PrismaClient } from '@/generated/prisma/client'
import { withAccelerate } from '@prisma/extension-accelerate'

const prisma = new PrismaClient().$extends(withAccelerate())
Expand Down
3 changes: 3 additions & 0 deletions orm/nextjs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@ yarn-error.log*

# typescript
*.tsbuildinfo

# generated files
app/generated
2 changes: 1 addition & 1 deletion orm/nextjs/lib/prisma.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PrismaClient } from '@prisma/client'
import { PrismaClient } from '../app/generated/prisma/client'
import { withAccelerate } from '@prisma/extension-accelerate'

const prisma = new PrismaClient().$extends(withAccelerate())
Expand Down
14 changes: 7 additions & 7 deletions orm/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
"postinstall": "prisma generate"
},
"dependencies": {
"@prisma/client": "6.9.0",
"@prisma/client": "^6.18.0",
"next": "15.3.5",
"react": "19.1.0",
"react-dom": "19.1.0"
"react-dom": "19.1.0",
"@prisma/extension-accelerate": "^2.0.2"
},
"devDependencies": {
"@eslint/eslintrc": "3.3.1",
Expand All @@ -23,13 +24,12 @@
"eslint": "9.30.1",
"eslint-config-next": "15.3.5",
"postcss": "8.5.6",
"prisma": "6.9.0",
"prisma": "^6.18.0",
"tailwindcss": "3.4.17",
"tsx": "4.20.6",
"typescript": "5.8.2",
"@prisma/extension-accelerate": "2.0.2"
"tsx": "4.20.3",
"typescript": "5.8.2"
},
"prisma": {
"seed": "tsx prisma/seed.ts"
}
}
}
5 changes: 4 additions & 1 deletion orm/nextjs/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?
// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init


generator client {
provider = "prisma-client-js"
provider = "prisma-client"
engineType = "client"
output = "../app/generated/prisma"
}

datasource db {
Expand Down
2 changes: 1 addition & 1 deletion orm/nextjs/prisma/seed.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PrismaClient, Prisma } from '@prisma/client'
import { PrismaClient, Prisma } from '../app/generated/prisma/client'
import { withAccelerate } from '@prisma/extension-accelerate'

const prisma = new PrismaClient().$extends(withAccelerate())
Expand Down
1 change: 1 addition & 0 deletions orm/nuxt-prisma-module/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DATABASE_URL=
2 changes: 2 additions & 0 deletions orm/nuxt-prisma-module/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ package-lock.json
prisma/migrations
prisma/dev.db
prisma/dev.db-journal

prisma/generated
50 changes: 46 additions & 4 deletions orm/nuxt-prisma-module/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,61 @@ The app demonstrates:
cd nuxt-prisma-module
```

3. Create a `.env` file:
3. Install dependencies:

```terminal
DATABASE_URL="file:./dev.db"
npm install
```

4. Start the development server:
4. Set up your Prisma Postgres database:

```terminal
npx prisma init --db
```

This will prompt you to:
- Select a region (e.g., `ap-southeast-1`)
- Enter a project name
- Copy the provided database URL to your `.env` file

5. Create a `.env` file with your Prisma Postgres database URL:

```bash
# .env
DATABASE_URL="prisma+postgres://accelerate.prisma-data.net/?api_key=..."
```

6. Apply database migrations:

```terminal
npx prisma migrate dev
```

7. Seed the database with sample data:

```terminal
npx prisma db seed
```

8. Start the development server:

```terminal
npm run dev
```

5. Follow the instructions in the terminal to launch Prisma Studio integrated in the Nuxt devtools within your browser.
9. Follow the instructions in the terminal to launch Prisma Studio integrated in the Nuxt devtools within your browser.

## Prisma Postgres Setup

This example uses Prisma Postgres, which requires the Prisma Accelerate extension. The extension is already included in the project dependencies and configured in [`lib/prisma.ts`](./lib/prisma.ts).

The Prisma Client is extended with the Accelerate extension to enable querying against your Prisma Postgres database:

```typescript
import { withAccelerate } from '@prisma/extension-accelerate'

const prisma = new PrismaClient().$extends(withAccelerate())
```

## Resources

Expand Down
File renamed without changes.
6 changes: 4 additions & 2 deletions orm/nuxt-prisma-module/lib/prisma.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { Prisma, PrismaClient } from '@prisma/client'
import { Prisma, PrismaClient } from "../prisma/generated/prisma/client"
import { withAccelerate } from '@prisma/extension-accelerate'

const prismaClientSingleton = () => {

// Custom extended Prisma ORM instance with client extensions, adding a method to verify the existence of a database entry.
return new PrismaClient().$extends({
return new PrismaClient().$extends(withAccelerate()).$extends({
model: {
$allModels: {
async exists<T>(
Expand Down
5 changes: 2 additions & 3 deletions orm/nuxt-prisma-module/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
export default defineNuxtConfig({
modules: ['@prisma/nuxt'],
// You can learn more about the `@prisma/nuxt` module configuration options [here](https://pris.ly/configure-prisma-nuxt)
prisma: {
autoSetupPrisma: true,
},
prisma: {},
devtools: { enabled: true },
compatibilityDate: '2025-07-15',
})
22 changes: 12 additions & 10 deletions orm/nuxt-prisma-module/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,22 @@
"dev": "nuxt dev",
"generate": "nuxt generate",
"preview": "nuxt preview",
"postinstall": "nuxt prepare",
"test": ""
"postinstall": "nuxt prepare"
},
"dependencies": {
"@prisma/nuxt": "0.3.0",
"nuxt": "3.17.6",
"vue": "3.5.21",
"vue-router": "4.5.1"
"@prisma/nuxt": "^0.3.0",
"@prisma/client": "^6.18.0",
"@prisma/extension-accelerate": "^2.0.2",
"nuxt": "^4.1.2",
"vue": "^3.5.22",
"vue-router": "^4.5.1"
},
"devDependencies": {
"@prisma/client": "6.9.0",
"prisma": "6.9.0"
"@types/node": "^24.6.1",
"prisma": "^6.18.0",
"tsx": "^4.20.6"
},
"prisma": {
"seed": "node prisma/seed.js"
"seed": "tsx prisma/seed.ts"
}
}
}
6 changes: 4 additions & 2 deletions orm/nuxt-prisma-module/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
// learn more about it in the docs: https://pris.ly/d/prisma-schema

generator client {
provider = "prisma-client-js"
provider = "prisma-client"
engineType = "client"
output = "./generated/prisma"
}

datasource db {
provider = "sqlite"
provider = "postgresql"
url = env("DATABASE_URL")
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
const { PrismaClient } = require('@prisma/client')
const { withAccelerate } = require('@prisma/extension-accelerate')

const prisma = new PrismaClient().$extends(withAccelerate())
import prisma from "../lib/prisma"

const userData = [
{
Expand All @@ -26,7 +23,6 @@ const userData = [
title: 'Follow Prisma on Twitter',
content: 'https://www.twitter.com/prisma',
published: true,
viewCount: 42,
},
],
},
Expand All @@ -40,7 +36,6 @@ const userData = [
title: 'Ask a question about Prisma on GitHub',
content: 'https://www.github.com/prisma/prisma/discussions',
published: true,
viewCount: 128,
},
{
title: 'Prisma on YouTube',
Expand All @@ -54,10 +49,12 @@ const userData = [
async function main() {
console.log(`Start seeding ...`)
for (const u of userData) {
const user = await prisma.user.create({
data: u,
const user = await prisma.user.upsert({
where: { email: u.email },
update: {},
create: u,
})
console.log(`Created user with id: ${user.id}`)
console.log(`Created/updated user with id: ${user.id}`)
}
console.log(`Seeding finished.`)
}
Expand Down
3 changes: 2 additions & 1 deletion orm/nuxt-prisma-module/server/api/user-exists.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import prisma from '~/lib/prisma'
import prisma from "../../lib/prisma"


export default eventHandler(async () => {
const user = await prisma.user.exists({
Expand Down
18 changes: 16 additions & 2 deletions orm/nuxt-prisma-module/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
{
// https://nuxt.com/docs/guide/concepts/typescript
"extends": "./.nuxt/tsconfig.json"
}
"files": [],
"references": [
{
"path": "./.nuxt/tsconfig.app.json"
},
{
"path": "./.nuxt/tsconfig.server.json"
},
{
"path": "./.nuxt/tsconfig.shared.json"
},
{
"path": "./.nuxt/tsconfig.node.json"
}
]
}
1 change: 1 addition & 0 deletions orm/nuxt/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DATABASE_URL=
Loading