Skip to content

DC-4745 AI SDK Example Project#8276

Merged
aidankmcalister merged 6 commits intolatestfrom
DC-4745-ai-sdk-example-project
Aug 13, 2025
Merged

DC-4745 AI SDK Example Project#8276
aidankmcalister merged 6 commits intolatestfrom
DC-4745-ai-sdk-example-project

Conversation

@aidankmcalister
Copy link
Member

@aidankmcalister aidankmcalister commented Aug 12, 2025

Summary by CodeRabbit

  • New Features

    • AI chat app with streaming replies, message persistence, and initial history loading; web UI with light/dark theming and responsive input.
  • API

    • Endpoints to send chat messages (streamed responses) and to fetch stored messages.
  • Documentation

    • README with setup, env vars, DB instructions, and run steps.
  • Chores

    • Project config added for Next.js, TypeScript, Prisma, Tailwind/PostCSS, and package manifest.
  • Tests

    • E2E test runner to provision a DB, start services, perform a basic health check, and teardown.

@coderabbitai
Copy link

coderabbitai bot commented Aug 12, 2025

Walkthrough

Adds a new Next.js AI SDK example at orm/ai-sdk-nextjs: Prisma schema, persistence and Prisma client, API routes for chat/messages, client chat UI, project configs, assets, and a CI Bash test runner that provisions a local Prisma Dev, runs migrations/seeds, starts the app, health-checks, and tears down.

Changes

Cohort / File(s) Summary
CI Test Runner
.github/tests/orm/ai-sdk-nextjs/run.sh
New Bash script to install deps, start Prisma Dev, wait for DATABASE_URL in logs, run migrations and seed, launch Next.js dev server, perform a curl health check, and clean up processes.
Env & Ignore
orm/ai-sdk-nextjs/.env.example, orm/ai-sdk-nextjs/.gitignore
Adds .env template with DATABASE_URL and OPENAI_API_KEY placeholders and a comprehensive .gitignore for Node/Next/Prisma artifacts.
Project Config & Manifest
orm/ai-sdk-nextjs/package.json, orm/ai-sdk-nextjs/tsconfig.json, orm/ai-sdk-nextjs/next.config.ts, orm/ai-sdk-nextjs/postcss.config.mjs, orm/ai-sdk-nextjs/README.md
Adds package manifest, TypeScript config, Next config, PostCSS/Tailwind config, and README with setup and usage instructions.
App Shell & Styling
orm/ai-sdk-nextjs/app/layout.tsx, orm/ai-sdk-nextjs/app/globals.css
Adds root layout with metadata and Google fonts plus global CSS defining light/dark variables and base typography.
Client Chat UI
orm/ai-sdk-nextjs/app/page.tsx
New client-side chat page using useChat(), loads initial messages from /api/messages, renders message feed, and posts new messages.
API Routes
orm/ai-sdk-nextjs/app/api/chat/route.ts, orm/ai-sdk-nextjs/app/api/messages/route.ts
POST /api/chat streams AI responses (convertToModelMessages, streamText, toUIMessageStreamResponse) and saves chats; GET /api/messages returns stored messages mapped to UI shape.
Prisma & Persistence
orm/ai-sdk-nextjs/prisma/schema.prisma, orm/ai-sdk-nextjs/lib/prisma.ts, orm/ai-sdk-nextjs/lib/save-chat.ts
Adds Prisma schema (Session, Message, MessageRole), PrismaClient singleton with Accelerate extension, and saveChat to upsert sessions and persist message records.

Sequence Diagram(s)

sequenceDiagram
  participant U as User
  participant UI as Next.js Client (app/page.tsx)
  participant APIc as POST /api/chat
  participant AI as AI SDK
  participant DB as Prisma (save-chat)

  U->>UI: Submit message
  UI->>APIc: POST { id, messages }
  APIc->>AI: streamText(converted messages)
  AI-->>APIc: Streamed tokens
  APIc-->>UI: Streamed response
  APIc->>DB: saveChat(messages, id)
  DB-->>APIc: Persisted
Loading
sequenceDiagram
  participant UI as Next.js Client (app/page.tsx)
  participant APIg as GET /api/messages
  participant DB as Prisma

  UI->>APIg: GET /api/messages
  APIg->>DB: findMany Messages (asc)
  DB-->>APIg: Records
  APIg-->>UI: { messages: [...] }
Loading
sequenceDiagram
  participant SH as run.sh
  participant P as Prisma Dev
  participant N as Next.js Dev Server
  participant H as curl

  SH->>P: Start prisma dev (background)
  SH->>P: Wait for prisma+postgres:// URL in log
  SH->>SH: Export DATABASE_URL
  SH->>P: Run prisma migrate/seed
  SH->>N: Start npm run dev (background)
  SH->>H: curl http://localhost:3000/
  SH->>N: Terminate Next.js process
  SH->>P: Terminate Prisma Dev process
Loading
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch DC-4745-ai-sdk-example-project

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 33

🔭 Outside diff range comments (1)
.github/tests/orm/ai-sdk-nextjs/run.sh (1)

66-70: Missing line ending and improve cleanup messaging.

Line 70 is missing a newline character at the end of the file. Also, the cleanup messages should be more consistent.

 kill "$pid"
-echo "🛑 App stopped (PID $pid)"
+echo "🛑 Next.js app stopped (PID $pid)"
 kill "$NODE_PID"
+echo "🛑 Prisma Dev stopped (PID $NODE_PID)"
 wait "$NODE_PID" || true
+
📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c86fd72 and d7e7ba7.

⛔ Files ignored due to path filters (1)
  • orm/ai-sdk-nextjs/app/favicon.ico is excluded by !**/*.ico
📒 Files selected for processing (16)
  • .github/tests/orm/ai-sdk-nextjs/run.sh (1 hunks)
  • orm/ai-sdk-nextjs/.env.example (1 hunks)
  • orm/ai-sdk-nextjs/.gitignore (1 hunks)
  • orm/ai-sdk-nextjs/README.md (1 hunks)
  • orm/ai-sdk-nextjs/app/api/chat/route.ts (1 hunks)
  • orm/ai-sdk-nextjs/app/api/messages/route.ts (1 hunks)
  • orm/ai-sdk-nextjs/app/globals.css (1 hunks)
  • orm/ai-sdk-nextjs/app/layout.tsx (1 hunks)
  • orm/ai-sdk-nextjs/app/page.tsx (1 hunks)
  • orm/ai-sdk-nextjs/lib/prisma.ts (1 hunks)
  • orm/ai-sdk-nextjs/lib/save-chat.ts (1 hunks)
  • orm/ai-sdk-nextjs/next.config.ts (1 hunks)
  • orm/ai-sdk-nextjs/package.json (1 hunks)
  • orm/ai-sdk-nextjs/postcss.config.mjs (1 hunks)
  • orm/ai-sdk-nextjs/prisma/schema.prisma (1 hunks)
  • orm/ai-sdk-nextjs/tsconfig.json (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
orm/ai-sdk-nextjs/app/api/chat/route.ts (1)
orm/ai-sdk-nextjs/lib/save-chat.ts (1)
  • saveChat (4-30)
🪛 dotenv-linter (3.3.0)
orm/ai-sdk-nextjs/.env.example

[warning] 2-2: [EndingBlankLine] No blank line at the end of the file

🪛 LanguageTool
orm/ai-sdk-nextjs/README.md

[grammar] ~1-~1: Use correct spacing
Context: # Vercel AI SDK V5 + Prisma example This example shows how to store AI chat ...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~5-~5: Use correct spacing
Context: ...ma](https://www.prisma.io). ## Getting started ### 1. Download example and navigate into th...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~7-~7: Use articles correctly
Context: ...). ## Getting started ### 1. Download example and navigate into the project directory...

(QB_NEW_EN_OTHER_ERROR_IDS_11)


[grammar] ~7-~7: There might be a mistake here.
Context: ...d example and navigate into the project directory Download this example: ``` npx try-pris...

(QB_NEW_EN_OTHER)


[grammar] ~9-~9: Use correct spacing
Context: ...to the project directory Download this example: npx try-prisma@latest --template orm/ai-sdk-nextjs Then, navigate into the project director...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~15-~15: Use correct spacing
Context: ...js Then, navigate into the project directory: cd ai-sdk-nextjs <details><summary><strong>Alternative:</strong> Clone the entire repo</summary> Clone this repository: git clone gi...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~23-~23: Use correct spacing
Context: ...e the entire repo Clone this repository: git clone git@github.com:prisma/prisma-examples.git --depth=1 Install npm dependencies: ``` cd prisma...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~29-~29: Use correct spacing
Context: ...examples.git --depth=1 Install npm dependencies: cd prisma-examples/orm/ai-sdk-nextjs npm install ```

Rename the .env.example file to `.env`...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~38-~38: Use correct spacing
Context: ...etails> Rename the .env.example file to .env ### 2. Create a Prisma Postgres instance Th...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~40-~40: There might be a mistake here.
Context: ....env ### 2. Create a Prisma Postgres instance This example uses a [Prisma Postgres](ht...

(QB_NEW_EN_OTHER)


[grammar] ~42-~42: Use the right verb tense
Context: ...rted with the project, you will need to setup a Prisma Postgres connection string: 1...

(QB_NEW_EN_OTHER_ERROR_IDS_13)


[grammar] ~42-~42: Use correct spacing
Context: ...d to setup a Prisma Postgres connection string: 1. Set up a new Prisma Postgres instance in...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~44-~44: Use correct spacing
Context: ...ma.io) and copy the database connection URL. > You can also start a new Prisma Postgres...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~46-~46: Use correct spacing
Context: ... also start a new Prisma Postgres using create-db. > > Run npx create-db@latest and copy the ...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~48-~48: Use correct spacing
Context: ...BASE_URL that is "optimized for Prisma ORM". 2. Add your database url to the .env Tha...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~50-~50: Use correct spacing
Context: ...sma ORM"_. 2. Add your database url to the .env That's it, your project is now configure...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~52-~52: Use correct spacing
Context: ...project is now configured to use Prisma Postgres! ### 3. Generate and migrate Prisma client 1...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~54-~54: There might be a mistake here.
Context: ...es! ### 3. Generate and migrate Prisma client 1. Run the following command to generate th...

(QB_NEW_EN_OTHER)


[grammar] ~56-~56: Use correct spacing
Context: ...you will be using to interact with your database. npx prisma generate 2. Migrate the DB ``` npx prisma migrate d...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~62-~62: There might be a mistake here.
Context: ...npx prisma generate 2. Migrate the DB npx prisma migrate dev --name init ``` ### 4. Set up Open AI 1. Navigate to https:...

(QB_NEW_EN_OTHER)


[grammar] ~68-~68: There might be a mistake here.
Context: ...rate dev --name init ``` ### 4. Set up Open AI 1. Navigate to https://platform.ope...

(QB_NEW_EN_OTHER)


[grammar] ~72-~72: There might be a mistake here.
Context: .... Create a new API key and give it full access 3. Add the API key to the .env. ### 5. S...

(QB_NEW_EN_OTHER)


[grammar] ~74-~74: Use correct spacing
Context: ... full access 3. Add the API key to the .env. ### 5. Start the development server ``` npm...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~76-~76: There might be a mistake here.
Context: ...e .env. ### 5. Start the development server npm run dev The server is now running at http://loca...

(QB_NEW_EN_OTHER)


[grammar] ~84-~84: There might be a mistake here.
Context: ...://localhost:3000 ## Switch to another database If you want to try this example with ano...

(QB_NEW_EN_OTHER)


[grammar] ~86-~86: Use correct spacing
Context: .../orm/overview/databases) section in our documentation. ## Next steps - Check out the [Prisma docs...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~88-~88: Use correct spacing
Context: ... section in our documentation. ## Next steps - Check out the [Prisma docs](https://www....

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~90-~90: Insert the missing word
Context: ... ## Next steps - Check out the Prisma docs - [Join ou...

(QB_NEW_EN_OTHER_ERROR_IDS_32)

🪛 markdownlint-cli2 (0.17.2)
orm/ai-sdk-nextjs/README.md

11-11: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


17-17: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


21-21: Inline HTML
Element: details

(MD033, no-inline-html)


21-21: Inline HTML
Element: summary

(MD033, no-inline-html)


21-21: Inline HTML
Element: strong

(MD033, no-inline-html)


25-25: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


31-31: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


50-50: Ordered list item prefix
Expected: 1; Actual: 2; Style: 1/1/1

(MD029, ol-prefix)


58-58: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


62-62: Ordered list item prefix
Expected: 1; Actual: 2; Style: 1/1/1

(MD029, ol-prefix)


64-64: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


70-70: Bare URL used

(MD034, no-bare-urls)


78-78: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


82-82: Bare URL used

(MD034, no-bare-urls)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (25)
  • GitHub Check: test (orm/grpc)
  • GitHub Check: test (orm/clerk-nextjs)
  • GitHub Check: test (orm/express)
  • GitHub Check: test (orm/betterauth-nextjs)
  • GitHub Check: test (orm/fastify-graphql)
  • GitHub Check: test (orm/fastify)
  • GitHub Check: test (orm/astro)
  • GitHub Check: test (orm/ai-sdk-nextjs)
  • GitHub Check: test (orm/fastify-graphql-sdl-first)
  • GitHub Check: test (orm/graphql-nexus)
  • GitHub Check: test (orm/graphql)
  • GitHub Check: test (orm/graphql-sdl-first)
  • GitHub Check: test (orm/hapi-graphql)
  • GitHub Check: test (orm/nest-graphql-sdl-first)
  • GitHub Check: test (orm/nest)
  • GitHub Check: test (orm/hapi-graphql-sdl-first)
  • GitHub Check: test (orm/koa)
  • GitHub Check: test (orm/hapi)
  • GitHub Check: test (orm/nextjs)
  • GitHub Check: test (orm/nuxt)
  • GitHub Check: test (orm/nest-graphql)
  • GitHub Check: test (orm/react-router-7)
  • GitHub Check: test (orm/nextjs-graphql)
  • GitHub Check: test (orm/sveltekit)
  • GitHub Check: test (orm/solid-start)
🔇 Additional comments (5)
orm/ai-sdk-nextjs/postcss.config.mjs (1)

1-5: Tailwind v4 setup verified

Both tailwindcss (^4) and @tailwindcss/postcss (^4) are present in orm/ai-sdk-nextjs/package.json, matching your postcss.config.mjs—no inconsistencies detected.

orm/ai-sdk-nextjs/package.json (2)

20-20: Zod v4 Stability Confirmed
Version “^4.0.15” is valid—Zod v4.x is officially stable (latest patch is v4.0.17). No changes required.


17-19: React 19.1.0 is compatible with Next.js 15.4.6 — please validate your ecosystem

Next.js 15.x officially targets React 19, so your versions are aligned. Before shipping to production, verify that all dependencies in your monorepo support React 19 to avoid peer-dependency or runtime issues.

• File: orm/ai-sdk-nextjs/package.json (lines 17–19)

  "next": "15.4.6",
  "react": "19.1.0",
  "react-dom": "19.1.0",

• Audit critical libraries (UI frameworks, animation, 3D, forms) for React 19-compatible peerDependencies and upgrade them where necessary.
• Run full local builds (next build && next start) and mirror your CI/Vercel build to catch install-time or runtime errors.
• Avoid long-term use of --legacy-peer-deps or --force; prefer official upgrades, package resolutions/overrides, or alpha/beta releases.
• If a library isn’t yet React 19-ready, consult its repo for recommended workarounds (e.g., beta builds of @react-three/fiber).

orm/ai-sdk-nextjs/lib/save-chat.ts (1)

13-13: Consider the implications of only saving the last two messages.

The function only saves the last two messages, which might not capture the full conversation context. This could be intentional for storage optimization, but should be documented.

Is limiting message persistence to only the last two messages intentional? This approach will lose conversation history over time.

orm/ai-sdk-nextjs/app/api/chat/route.ts (1)

5-5: High maxDuration value needs justification.

The maxDuration of 3000 seems unusually high. Clarify if this is in seconds or milliseconds, and ensure it's appropriate for the use case.

What are the units for Next.js maxDuration? Is 3000 seconds (50 minutes) the intended timeout for this chat endpoint?

nurul3101
nurul3101 previously approved these changes Aug 12, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

♻️ Duplicate comments (3)
orm/ai-sdk-nextjs/.env.example (1)

3-3: Trailing newline present — linter nit resolved

The EndingBlankLine nit from earlier feedback is addressed. No further action needed.

orm/ai-sdk-nextjs/README.md (2)

62-62: Normalize ordered list numbering (MD029)

Same issue later in the doc.

-2. Migrate the DB
+1. Migrate the DB

50-50: Normalize ordered list numbering (MD029)

Use 1/1/1 style for ordered lists to satisfy markdownlint and ease maintenance.

-2. Add your database URL to the `.env`
+1. Add your database URL to the `.env`
📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d7e7ba7 and a7ba970.

📒 Files selected for processing (3)
  • orm/ai-sdk-nextjs/.env.example (1 hunks)
  • orm/ai-sdk-nextjs/.gitignore (1 hunks)
  • orm/ai-sdk-nextjs/README.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
orm/ai-sdk-nextjs/README.md

[grammar] ~1-~1: Use correct spacing
Context: # Vercel AI SDK V5 + Prisma example This example shows how to store AI chat ...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~7-~7: Use articles correctly
Context: ...). ## Getting started ### 1. Download example and navigate into the project directory...

(QB_NEW_EN_OTHER_ERROR_IDS_11)


[grammar] ~7-~7: There might be a mistake here.
Context: ...d example and navigate into the project directory Download this example: ```bash npx try-...

(QB_NEW_EN_OTHER)


[grammar] ~9-~9: Use correct spacing
Context: ...to the project directory Download this example: bash npx try-prisma@latest --template orm/ai-sdk-nextjs Then, navigate into the project director...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~15-~15: Use correct spacing
Context: ...js Then, navigate into the project directory: bash cd ai-sdk-nextjs <details><summary><strong>Alternative:</strong> Clone the entire repo</summary> Clone this repository: bash git clon...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~23-~23: Use correct spacing
Context: ...e the entire repo Clone this repository: bash git clone git@github.com:prisma/prisma-examples.git --depth=1 Install npm dependencies: ```bash cd pr...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~29-~29: Use correct spacing
Context: ...examples.git --depth=1 Install npm dependencies: bash cd prisma-examples/orm/ai-sdk-nextjs npm install ```

Rename the .env.example file to `.env`...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~38-~38: Use correct spacing
Context: ...etails> Rename the .env.example file to .env ### 2. Create a Prisma Postgres instance Th...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~40-~40: There might be a mistake here.
Context: ....env ### 2. Create a Prisma Postgres instance This example uses a [Prisma Postgres](ht...

(QB_NEW_EN_OTHER)


[grammar] ~42-~42: Use the right verb tense
Context: ...rted with the project, you will need to setup a Prisma Postgres connection string: 1...

(QB_NEW_EN_OTHER_ERROR_IDS_13)


[grammar] ~42-~42: Use correct spacing
Context: ...d to setup a Prisma Postgres connection string: 1. Set up a new Prisma Postgres instance in...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~44-~44: Use correct spacing
Context: ...ma.io) and copy the database connection URL. > You can also start a new Prisma Postgres...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~48-~48: Use correct spacing
Context: ...BASE_URL that is "optimized for Prisma ORM". 2. Add your database URL to the .env Tha...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~50-~50: Use correct spacing
Context: ...sma ORM"_. 2. Add your database URL to the .env That's it, your project is now configure...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~52-~52: Use correct spacing
Context: ...project is now configured to use Prisma Postgres! ### 3. Generate and migrate Prisma client 1...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~54-~54: There might be a mistake here.
Context: ...es! ### 3. Generate and migrate Prisma client 1. Run the following command to generate th...

(QB_NEW_EN_OTHER)


[grammar] ~56-~56: Use correct spacing
Context: ...you will be using to interact with your database. bash npx prisma generate 2. Migrate the DB ```bash npx prisma migra...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~62-~62: There might be a mistake here.
Context: ...npx prisma generate 2. Migrate the DB bash npx prisma migrate dev --name init ``` ### 4. Set up OpenAI 1. Navigate to [OpenAI...

(QB_NEW_EN_OTHER)


[grammar] ~68-~68: There might be a mistake here.
Context: ...rate dev --name init ``` ### 4. Set up OpenAI 1. Navigate to [OpenAI API keys](https://pl...

(QB_NEW_EN_OTHER)


[grammar] ~70-~70: There might be a mistake here.
Context: ...t up OpenAI 1. Navigate to OpenAI API keys 2. Create a new API key and give it full ac...

(QB_NEW_EN_OTHER)


[grammar] ~72-~72: There might be a mistake here.
Context: .... Create a new API key and give it full access 3. Add the API key to the .env. ### 5. S...

(QB_NEW_EN_OTHER)


[grammar] ~74-~74: Use correct spacing
Context: ... full access 3. Add the API key to the .env. ### 5. Start the development server ```bash...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~76-~76: There might be a mistake here.
Context: ...e .env. ### 5. Start the development server bash npm run dev The server is now running at [http://loc...

(QB_NEW_EN_OTHER)


[grammar] ~84-~84: There might be a mistake here.
Context: ...//localhost:3000) ## Switch to another database If you want to try this example with ano...

(QB_NEW_EN_OTHER)


[grammar] ~86-~86: Use correct spacing
Context: .../orm/overview/databases) section in our documentation. ## Next steps - Check out the [Prisma docs...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~88-~88: Use correct spacing
Context: ... section in our documentation. ## Next steps - Check out the [Prisma docs](https://www....

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~90-~90: Insert the missing word
Context: ... ## Next steps - Check out the Prisma docs - [Join ou...

(QB_NEW_EN_OTHER_ERROR_IDS_32)

🪛 markdownlint-cli2 (0.17.2)
orm/ai-sdk-nextjs/README.md

21-21: Inline HTML
Element: details

(MD033, no-inline-html)


21-21: Inline HTML
Element: summary

(MD033, no-inline-html)


21-21: Inline HTML
Element: strong

(MD033, no-inline-html)


50-50: Ordered list item prefix
Expected: 1; Actual: 2; Style: 1/1/1

(MD029, ol-prefix)


62-62: Ordered list item prefix
Expected: 1; Actual: 2; Style: 1/1/1

(MD029, ol-prefix)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (26)
  • GitHub Check: test (orm/astro)
  • GitHub Check: test (orm/graphql)
  • GitHub Check: test (orm/graphql-sdl-first)
  • GitHub Check: test (orm/grpc)
  • GitHub Check: test (orm/express)
  • GitHub Check: test (orm/fastify)
  • GitHub Check: test (orm/graphql-nexus)
  • GitHub Check: test (orm/clerk-nextjs)
  • GitHub Check: test (orm/graphql-auth)
  • GitHub Check: test (orm/betterauth-nextjs)
  • GitHub Check: test (orm/fastify-graphql)
  • GitHub Check: test (orm/ai-sdk-nextjs)
  • GitHub Check: test (orm/fastify-graphql-sdl-first)
  • GitHub Check: test (orm/graphql-subscriptions)
  • GitHub Check: test (orm/nextjs-graphql)
  • GitHub Check: test (orm/koa)
  • GitHub Check: test (orm/hapi-graphql-sdl-first)
  • GitHub Check: test (orm/nextjs)
  • GitHub Check: test (orm/nest-graphql)
  • GitHub Check: test (orm/hapi)
  • GitHub Check: test (orm/nuxt)
  • GitHub Check: test (orm/solid-start)
  • GitHub Check: test (orm/nest)
  • GitHub Check: test (orm/nest-graphql-sdl-first)
  • GitHub Check: test (orm/react-router-7)
  • GitHub Check: test (orm/sveltekit)
🔇 Additional comments (2)
orm/ai-sdk-nextjs/.gitignore (2)

33-39: Env patterns and template negation look correct

Covers .env variants and preserves .env.example. This matches project needs and common practices.


47-47: Prisma client output ignored correctly

Ignoring /app/generated/prisma aligns with the generator output path and avoids committing generated artifacts.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

♻️ Duplicate comments (3)
orm/ai-sdk-nextjs/README.md (3)

21-36: Wrap inline HTML block with markdownlint disable/enable for MD033

If MD033 is enforced, surround the

Details block with disable/enable comments to avoid lint errors while keeping the collapsible UI.

Apply this diff:

-<details><summary><strong>Alternative:</strong> Clone the entire repo</summary>
+<!-- markdownlint-disable MD033 -->
+<details><summary><strong>Alternative:</strong> Clone the entire repo</summary>
@@
-</details>
+</details>
+<!-- markdownlint-enable MD033 -->

50-50: Normalize ordered list numbering to 1/1/1 (MD029)

Align with MD029 by using “1.” for all ordered items.

-2. Add your database URL to the `.env`
+1. Add your database URL to the `.env`

62-66: Normalize numbering and expand “DB” to “database” for clarity

Match MD029’s 1/1/1 style and prefer “database” over “DB” in docs.

-2. Migrate the DB
+1. Migrate the database
📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a7ba970 and f71f246.

📒 Files selected for processing (1)
  • orm/ai-sdk-nextjs/README.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
orm/ai-sdk-nextjs/README.md

[grammar] ~1-~1: Use correct spacing
Context: # Vercel AI SDK V5 + Prisma example This example shows how to store AI chat ...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~5-~5: Use correct spacing
Context: ...ma](https://www.prisma.io). ## Getting started ### 1. Download example and navigate into th...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~7-~7: Use articles correctly
Context: ...). ## Getting started ### 1. Download example and navigate into the project directory...

(QB_NEW_EN_OTHER_ERROR_IDS_11)


[grammar] ~7-~7: There might be a mistake here.
Context: ...d example and navigate into the project directory Download this example: ```bash npx try-...

(QB_NEW_EN_OTHER)


[grammar] ~9-~9: Use correct spacing
Context: ...to the project directory Download this example: bash npx try-prisma@latest --template orm/ai-sdk-nextjs Then, navigate into the project director...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~15-~15: Use correct spacing
Context: ...js Then, navigate into the project directory: bash cd ai-sdk-nextjs <details><summary><strong>Alternative:</strong> Clone the entire repo</summary> Clone this repository: bash git clon...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~23-~23: Use correct spacing
Context: ...e the entire repo Clone this repository: bash git clone git@github.com:prisma/prisma-examples.git --depth=1 Install npm dependencies: ```bash cd pr...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~29-~29: Use correct spacing
Context: ...examples.git --depth=1 Install npm dependencies: bash cd prisma-examples/orm/ai-sdk-nextjs npm install ```

Rename the .env.example file to `.env`...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~38-~38: Use correct spacing
Context: ...etails> Rename the .env.example file to .env ### 2. Create a Prisma Postgres instance Th...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~40-~40: There might be a mistake here.
Context: ....env ### 2. Create a Prisma Postgres instance This example uses a [Prisma Postgres](ht...

(QB_NEW_EN_OTHER)


[grammar] ~42-~42: Use correct spacing
Context: ... to set up a Prisma Postgres connection string: 1. Set up a new Prisma Postgres instance in...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~44-~44: Use correct spacing
Context: ...ma.io) and copy the database connection URL. > You can also start a new Prisma Postgres...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~48-~48: Use correct spacing
Context: ...BASE_URL that is "optimized for Prisma ORM". 2. Add your database URL to the .env Tha...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~50-~50: Use correct spacing
Context: ...sma ORM"_. 2. Add your database URL to the .env That's it, your project is now configure...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~52-~52: Use correct spacing
Context: ...project is now configured to use Prisma Postgres! ### 3. Generate and migrate Prisma client 1...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~54-~54: There might be a mistake here.
Context: ...es! ### 3. Generate and migrate Prisma client 1. Run the following command to generate th...

(QB_NEW_EN_OTHER)


[grammar] ~56-~56: Use correct spacing
Context: ...you will be using to interact with your database. bash npx prisma generate 2. Migrate the DB ```bash npx prisma migra...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~62-~62: There might be a mistake here.
Context: ...npx prisma generate 2. Migrate the DB bash npx prisma migrate dev --name init ``` ### 4. Set up OpenAI 1. Navigate to [OpenAI...

(QB_NEW_EN_OTHER)


[grammar] ~68-~68: There might be a mistake here.
Context: ...rate dev --name init ``` ### 4. Set up OpenAI 1. Navigate to [OpenAI API keys](https://pl...

(QB_NEW_EN_OTHER)


[grammar] ~70-~70: There might be a mistake here.
Context: ...t up OpenAI 1. Navigate to OpenAI API keys 2. Create a new API key and give it full ac...

(QB_NEW_EN_OTHER)


[grammar] ~72-~72: There might be a mistake here.
Context: .... Create a new API key and give it full access 3. Add the API key to the .env. ### 5. S...

(QB_NEW_EN_OTHER)


[grammar] ~74-~74: Use correct spacing
Context: ... full access 3. Add the API key to the .env. ### 5. Start the development server ```bash...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~76-~76: There might be a mistake here.
Context: ...e .env. ### 5. Start the development server bash npm run dev The server is now running at [http://loc...

(QB_NEW_EN_OTHER)


[grammar] ~84-~84: There might be a mistake here.
Context: ...//localhost:3000) ## Switch to another database If you want to try this example with ano...

(QB_NEW_EN_OTHER)


[grammar] ~86-~86: Use correct spacing
Context: .../orm/overview/databases) section in our documentation. ## Next steps - Check out the [Prisma docs...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~88-~88: Use correct spacing
Context: ... section in our documentation. ## Next steps - Check out the [Prisma docs](https://www....

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~90-~90: Insert the missing word
Context: ... ## Next steps - Check out the Prisma docs - [Join ou...

(QB_NEW_EN_OTHER_ERROR_IDS_32)

🪛 markdownlint-cli2 (0.17.2)
orm/ai-sdk-nextjs/README.md

21-21: Inline HTML
Element: details

(MD033, no-inline-html)


21-21: Inline HTML
Element: summary

(MD033, no-inline-html)


21-21: Inline HTML
Element: strong

(MD033, no-inline-html)


50-50: Ordered list item prefix
Expected: 1; Actual: 2; Style: 1/1/1

(MD029, ol-prefix)


62-62: Ordered list item prefix
Expected: 1; Actual: 2; Style: 1/1/1

(MD029, ol-prefix)

🔇 Additional comments (2)
orm/ai-sdk-nextjs/README.md (2)

1-19: Solid README and prior nitpicks addressed

Good job fixing prior feedback: vendor spelling, fenced code languages, URL protocol, OpenAI link, and localhost formatting are all corrected. Content is clear and actionable.


17-19: Confirm whether dependencies are auto-installed with try-prisma

Does npx try-prisma auto-install dependencies for this template? If not, add an “Install dependencies” step here for parity with the clone path.

Proposed addition if needed:

 Then, navigate into the project directory:
 
 ```bash
 cd ai-sdk-nextjs

+Install npm dependencies:
+
+bash +npm install +


</details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

@aidankmcalister aidankmcalister merged commit c903af8 into latest Aug 13, 2025
40 of 43 checks passed
@aidankmcalister aidankmcalister deleted the DC-4745-ai-sdk-example-project branch August 13, 2025 11:18
@coderabbitai coderabbitai bot mentioned this pull request Oct 27, 2025
6 tasks
@coderabbitai coderabbitai bot mentioned this pull request Jan 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants