Skip to content

Commit cf4dcbc

Browse files
docs(guides): add create-prisma quick start to framework guides (#7787)
* docs(guides): add create-prisma quick start to framework guides Adds a ## Quick start section at the top of each framework guide and the guides index, so users can scaffold a working project in one command with npx create-prisma@latest --template <framework>. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * docs(guides): use npm code blocks for create-prisma commands Switches quick start code blocks from bash to npm so the docs auto-generate pnpm/yarn/bun equivalents. Updates commands to npm create prisma@latest --template <framework>. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(guides): restore -- separator in npm create prisma commands npm passes args before -- to itself; the -- is required for --template to reach create-prisma correctly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(source-config): correct npm create conversions for non-npm package managers Bypass npm-to-yarn for `npm create X@latest` since the library strips @latest and handles the -- separator inconsistently. Now produces: - pnpm: pnpm create prisma@latest --template <x> - yarn: yarn create prisma@latest --template <x> - bun: bun create prisma@latest --template <x> Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 57a12fa commit cf4dcbc

10 files changed

Lines changed: 107 additions & 2 deletions

File tree

‎apps/docs/content/docs/guides/frameworks/astro.mdx‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ Prisma ORM offers type-safe database access, and [Astro](https://astro.build/) i
1313

1414
In this guide, you'll learn to integrate Prisma ORM with a Prisma Postgres database in an Astro project from scratch. You can find a complete example of this guide on [GitHub](https://github.com/prisma/prisma-examples/tree/latest/orm/astro).
1515

16+
## Quick start
17+
18+
Run one command to scaffold an Astro project with Prisma ORM and Prisma Postgres ready to go:
19+
20+
```npm
21+
npm create prisma@latest -- --template astro
22+
```
23+
24+
Or follow the steps below to set it up manually.
25+
1626
## Prerequisites
1727

1828
- [Node.js 20+](https://nodejs.org)

‎apps/docs/content/docs/guides/frameworks/elysia.mdx‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ metaDescription: Learn how to use Prisma ORM in an Elysia app
1313

1414
In this guide, you'll learn to integrate Prisma ORM with a Prisma Postgres database in an Elysia application. You can find a complete example of this guide on [GitHub](https://github.com/prisma/prisma-examples/tree/latest/orm/elysia).
1515

16+
## Quick start
17+
18+
Run one command to scaffold an Elysia project with Prisma ORM and Prisma Postgres ready to go:
19+
20+
```npm
21+
npm create prisma@latest -- --template elysia
22+
```
23+
24+
Or follow the steps below to set it up manually.
25+
1626
## Prerequisites
1727

1828
- [Bun](https://bun.sh/docs/installation) installed on your system

‎apps/docs/content/docs/guides/frameworks/hono.mdx‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ Prisma ORM offers type-safe database access, and [Hono](https://hono.dev/) is bu
1313

1414
In this guide, you'll learn to integrate Prisma ORM with a Prisma Postgres database in a Hono backend application. You can find a complete example of this guide on [GitHub](https://github.com/prisma/prisma-examples/tree/latest/orm/hono).
1515

16+
## Quick start
17+
18+
Run one command to scaffold a Hono project with Prisma ORM and Prisma Postgres ready to go:
19+
20+
```npm
21+
npm create prisma@latest -- --template hono
22+
```
23+
24+
Or follow the steps below to set it up manually.
25+
1626
## Prerequisites
1727

1828
- [Node.js 20+](https://nodejs.org)

‎apps/docs/content/docs/guides/frameworks/nestjs.mdx‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@ While Prisma can be used with plain JavaScript, it embraces TypeScript and provi
1717

1818
You can find a ready-to-run example [here](https://github.com/prisma/prisma-examples/tree/latest/orm/nest)
1919

20+
## Quick start
21+
22+
Run one command to scaffold a NestJS project with Prisma ORM and Prisma Postgres ready to go:
23+
24+
```npm
25+
npm create prisma@latest -- --template nestjs
26+
```
27+
28+
Or follow the steps below to set it up manually.
29+
2030
## Prerequisites
2131

2232
- [Node.js 20+](https://nodejs.org)

‎apps/docs/content/docs/guides/frameworks/nextjs.mdx‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@ This guide shows you how to use Prisma with Next.js, a fullstack React framework
1414

1515
You can find a [deployment-ready example on GitHub](https://github.com/prisma/prisma-examples/blob/latest/orm/nextjs).
1616

17+
## Quick start
18+
19+
Run one command to scaffold a Next.js project with Prisma ORM and Prisma Postgres ready to go:
20+
21+
```npm
22+
npm create prisma@latest -- --template next
23+
```
24+
25+
Or follow the steps below to set it up manually.
26+
1727
## Prerequisites
1828

1929
- [Node.js](https://nodejs.org) v20.19+, v22.12+, or v24.0+

‎apps/docs/content/docs/guides/frameworks/nuxt.mdx‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@ aiPrompt: "nuxt"
1010

1111
This guide shows you how to set up Prisma ORM in a Nuxt application with [Prisma Postgres](https://prisma.io/postgres).
1212

13+
## Quick start
14+
15+
Run one command to scaffold a Nuxt project with Prisma ORM and Prisma Postgres ready to go:
16+
17+
```npm
18+
npm create prisma@latest -- --template nuxt
19+
```
20+
21+
Or follow the steps below to set it up manually.
22+
1323
## Prerequisites
1424

1525
- Node.js 18+

‎apps/docs/content/docs/guides/frameworks/sveltekit.mdx‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ Prisma ORM simplifies database access with type-safe queries, and when paired wi
1313

1414
In this guide, you'll learn to integrate Prisma ORM with a Prisma Postgres database in a SvelteKit project from scratch. You can find a complete example of this guide on [GitHub](https://github.com/prisma/prisma-examples/tree/latest/orm/sveltekit).
1515

16+
## Quick start
17+
18+
Run one command to scaffold a SvelteKit project with Prisma ORM and Prisma Postgres ready to go:
19+
20+
```npm
21+
npm create prisma@latest -- --template svelte
22+
```
23+
24+
Or follow the steps below to set it up manually.
25+
1626
## Prerequisites
1727

1828
- [Node.js 20+](https://nodejs.org)

‎apps/docs/content/docs/guides/frameworks/tanstack-start.mdx‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ Prisma ORM simplifies database interactions, and [TanStack Start](https://tansta
1313

1414
This guide will walk you through integrating Prisma ORM with a Prisma Postgres database in a TanStack Start project from scratch.
1515

16+
## Quick start
17+
18+
Run one command to scaffold a TanStack Start project with Prisma ORM and Prisma Postgres ready to go:
19+
20+
```npm
21+
npm create prisma@latest -- --template tanstack-start
22+
```
23+
24+
Or follow the steps below to set it up manually.
25+
1626
## Prerequisites
1727

1828
- [Node.js 20+](https://nodejs.org)

‎apps/docs/content/docs/guides/index.mdx‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,15 @@ metaDescription: A collection of guides for various tasks and workflows.
88

99
Welcome to the Guides section! Here you'll find practical, step-by-step guides to help you accomplish specific tasks with Prisma products, including Prisma ORM, Prisma Accelerate, Prisma Postgres, and more.
1010

11-
Browse through our guides using the sidebar navigation or use the search to find specific topics.
11+
## Quick start
12+
13+
Scaffold a new project with Prisma ORM and Prisma Postgres already set up:
14+
15+
```npm
16+
npm create prisma@latest
17+
```
18+
19+
Pick your framework and options from the prompts. To skip prompts use `--yes`, to set a framework upfront use `--template` (`next`, `hono`, `svelte`, `astro`, `nuxt`, `tanstack-start`, `nestjs`, `elysia`, `turborepo`).
1220

1321
## Getting started
1422

‎apps/docs/source.config.ts‎

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,24 @@ import remarkConsoleUtm from "@/lib/remark-console-utm";
1212
function convertLine(cmd: string, pm: "npm" | "pnpm" | "yarn" | "bun"): string {
1313
return cmd
1414
.split("\n")
15-
.map((line) => convert(line.replace(/^npm init -y$/, "npm init"), pm))
15+
.map((line) => {
16+
// npm-to-yarn strips @latest from `npm create X@latest` and handles the
17+
// npm-specific `--` separator inconsistently across PMs. Handle this
18+
// pattern directly instead of fighting the library's output.
19+
const m = line.match(/^npm create ([^\s]+@latest)((?:\s+--\s*.*)?)$/);
20+
if (m) {
21+
const pkg = m[1]; // e.g. "prisma@latest"
22+
const flags = m[2].replace(/^\s+--\s*/, " ").trim(); // strip -- separator
23+
const f = flags ? ` ${flags}` : "";
24+
switch (pm) {
25+
case "npm": return line;
26+
case "pnpm": return `pnpm create ${pkg}${f}`;
27+
case "yarn": return `yarn create ${pkg}${f}`;
28+
case "bun": return `bun create ${pkg}${f}`;
29+
}
30+
}
31+
return convert(line.replace(/^npm init -y$/, "npm init"), pm);
32+
})
1633
.join("\n");
1734
}
1835

0 commit comments

Comments
 (0)