Get started with Prisma Copy MarkdownOpen
Scaffold an app with Prisma Next, create or connect Prisma Postgres, and deploy on Prisma Compute. One integrated TypeScript stack, from first query to live URL.
Recommended pathPrisma is a complete TypeScript stack for building with data: Prisma ORM to model and query it, Prisma Postgres to store it, and Prisma Compute to run your app next to it. Start new projects with Prisma Next , the next major version of the ORM and soon Prisma 8: one scaffold command wires up all three, for you or your coding agent.
Prisma Compute Deploy and host your app. Public Beta.
Prisma Next Model and query your data. The next Prisma ORM, soon Prisma 8. Early Access.
Prisma Postgres Store your data, provisioned during setup.
One project. Type-safe, end to end.
The tutorial's journey, condensed: hand the prompt to your coding agent, or run the CLI steps yourself.
AI prompt and CLI steps One journey scaffolds, seeds, migrates, and deploys the whole stack. View Copy promptScaffold the app $ npx create-prisma@nextInitialize, seed, and run $ cd my-app$ npm run db:init$ npm run db:seeddb:seed failing? See the one-line fix: prisma.io/docs/next/full-stack-tutorial $ npm run devDeploy to a live URL (free account, browser sign-in) -- run after stopping dev $ npx @prisma/cli@latest app deploy --env .env
Create a new [framework] application with Prisma Next, seed it, and run it locally.
If I have not told you which framework, stop and ask before scaffolding. Valid --template values: next, hono, nuxt, astro, nest, svelte, tanstack-start, elysia.
1. Scaffold the app: `npx create-prisma@next create my-app --template [framework] --provider postgres --prisma-postgres --yes`. The `--prisma-postgres` flag provisions a Prisma Postgres database. If I give you a connection string, pass `--database-url "<url>"` instead of `--prisma-postgres`.
2. From the project directory, apply the starter contract and seed: `npm run db:init`, then `npm run db:seed`. If seeding fails with `Cannot read properties of undefined (reading 'where')`, change `db.orm.User` to `db.orm.public.User` in `src/prisma/seed.ts`, `src/prisma/users.ts`, and any route files that query `db.orm`, then rerun.
3. Edit the starter contract under `src/prisma/` into a small schema for my use case, then run `npm run contract:emit` and plan and apply the migration: `npx prisma-next migration plan`, then `npx prisma-next migrate --yes`. Migration planning diffs the emitted contract, so the emit step is required.
4. Update the seed script and the app routes to query the new schema, start `npm run dev` in the background, and verify with a request against the running app. For the `nest` template, if routes return 500s with `reading 'findAll'` in the logs, add explicit `@Inject()` tokens as shown in https://www.prisma.io/docs/guides/next/frameworks/nestjs.md.
5. Deploy with Prisma Compute. First apply the framework's deploy requirement from the guide at https://www.prisma.io/docs/guides/next/frameworks/[guide].md, where [guide] is the template name except: template `next` → guide `nextjs`, `nest` → `nestjs`, `svelte` → `sveltekit`. The requirements: Next.js needs `output: "standalone"` in `next.config.ts` (without it the deployed app returns 504s), TanStack Start needs the nitro build plugin, Astro needs the `@astrojs/node` adapter plus `--env HOST=0.0.0.0`, and Elysia needs `--framework bun --entry src/index.ts` on the deploy command. If the template is `svelte`, skip this step; Compute does not support SvelteKit yet. Check `npx @prisma/cli@latest auth whoami`. If I am not signed in, stop and ask me to run `npx @prisma/cli@latest auth login`, because that step opens a browser. Then run `npx @prisma/cli@latest app deploy --create-project my-app --env .env` so DATABASE_URL reaches the deployment, and verify the deployed URL with curl.
Use the installed Prisma Next skills and the current Prisma docs: https://www.prisma.io/docs/llms.txt (append `.md` to any docs URL for a markdown version).
Every guide runs the same journey with the same commands: scaffold, connect Prisma Postgres, run a real query, and deploy. SvelteKit and Deno don't deploy to Compute yet; their guides stop at a verified local run.
If you're using Express or another Node.js server, follow the existing-project path instead.
Prisma 7 is the current generally available release of Prisma ORM, fully supported, and npx prisma@latest init installs it. It pairs with Prisma Postgres and Prisma Compute the same way. When you're ready, Prisma Next is the path to Prisma 8.
Already have an app or a database, or need a single Prisma product on its own? Each path has a guide to follow and a prompt to hand to your agent.
Existing project, your own database, or a single product on its own Five paths: add to an existing project, bring your own Postgres, or use the ORM, Postgres, or Compute alone. ViewAdd Prisma to an existing project Copy promptAdd Prisma Next to this existing project.
This flow is for PostgreSQL. If the project uses MongoDB, follow https://www.prisma.io/docs/next/add-to-existing-project/mongodb.md instead; for other databases, stop and tell me.
1. Run `npx prisma-next@latest init`. It writes `prisma-next.config.ts`, a starter contract and `db.ts` under `src/prisma/`, and installs Prisma Next skills for you.
2. Set `DATABASE_URL` in `.env` to my database. If I did not give you one, create a Prisma Postgres database with `npx create-db@latest`, put its connection string in `.env`, and show me the claim URL it prints so I can keep the database.
3. If the database already has tables, infer the contract from it: `npx prisma-next contract infer`, then `npx prisma-next contract emit`, then sign it with `npx prisma-next db sign`. If the database is empty, keep the starter contract and run `npx prisma-next db init`.
4. Write one query with the generated `db` client in an existing code path, run it, and show me the returned rows.
Follow https://www.prisma.io/docs/next/add-to-existing-project/postgresql.md and the installed Prisma Next skills. Prisma Next with your own PostgreSQL database Quickstart View Copy promptPrisma Next with your own PostgreSQL database Copy promptCreate a new [framework] application with Prisma Next against my existing PostgreSQL database.
If I have not given you a connection string, stop and ask; do not invent one. Valid --template values: next, hono, nuxt, astro, nest, svelte, tanstack-start, elysia.
1. Scaffold: `npx create-prisma@next create my-app --template [framework] --provider postgres --database-url "<my connection string>" --yes`.
2. From the project directory: `npm run db:init`, then `npm run db:seed`, then start `npm run dev` in the background and verify the sample query returns data. If seeding fails with `Cannot read properties of undefined (reading 'where')`, change `db.orm.User` to `db.orm.public.User` in `src/prisma/seed.ts`, `src/prisma/users.ts`, and any route files that query `db.orm`, then rerun.
3. Evolve the starter contract under `src/prisma/` into my schema, then run `npm run contract:emit`, `npx prisma-next migration plan`, and `npx prisma-next migrate --yes`.
Do not provision any hosted database. Use the installed Prisma Next skills and https://www.prisma.io/docs/llms.txt for current docs. Prisma ORM only (Prisma 7) Quickstart View Copy promptPrisma ORM only (Prisma 7) Copy promptAdd Prisma ORM 7 to this project with my existing database.
If I have not given you a database connection string and none exists in the project, stop and ask.
1. Run `npx prisma@latest init` (Prisma 7). For an existing database, set DATABASE_URL in `.env` and introspect it with `npx prisma db pull`; for a new schema, define models in `prisma/schema.prisma` and run `npx prisma migrate dev --name init`. If migrate dev asks to reset the database, stop and ask me first.
2. Install the driver adapter for the database (Prisma 7 requires one), e.g. `npm install @prisma/adapter-pg` for PostgreSQL, and pass it to `new PrismaClient({ adapter })`. Generate the client with `npx prisma generate` and write one query in an existing code path.
3. Run the query (e.g. with `npx tsx`) and show me the output, the schema, and the query you added.
Current docs: https://www.prisma.io/docs/orm.md and https://www.prisma.io/docs/llms.txt. Prisma Postgres only Copy promptCreate a Prisma Postgres database for this project.
1. Run `npx create-db@latest`. It creates a temporary Prisma Postgres database without an account and prints a connection string plus a claim URL.
2. Put the connection string in `.env` as DATABASE_URL and wire it into whichever of Prisma ORM, Kysely, Drizzle, TypeORM, or node-postgres the project already uses (detect it from package.json; if none, ask me). Verify the connection with one trivial query such as `select 1`.
3. Remind me to open the claim URL to keep the database in my Prisma workspace.
Current docs: https://www.prisma.io/docs/postgres.md. Prisma Compute only Copy promptDeploy this app to Prisma Compute using `npx @prisma/cli@latest`.
Compute supports Next.js (with `output: "standalone"` in its config), Nuxt, Astro, Hono, NestJS, TanStack Start, and plain Bun servers; for a Bun or Elysia server pass `--framework bun --entry <server file>`. If the app is none of these, stop and tell me.
1. Confirm I am signed in with `npx @prisma/cli@latest auth whoami`; if not, stop and ask me to run `npx @prisma/cli@latest auth login`.
2. Run `npx @prisma/cli@latest app deploy` from the project directory. If the app reads env vars from `.env` (like DATABASE_URL), add `--env .env`. If deploy fails with `PROJECT_SETUP_REQUIRED` (the directory is not pinned to a project yet), rerun with `--create-project <app-name>`, or `--project <id>` for an existing project. Add `--db` only if it needs a brand-new database; Compute then provisions Prisma Postgres and wires the connection string.
3. Fetch the deployed URL with curl and confirm the app responds. If it does not, read `npx @prisma/cli@latest app logs` briefly (it streams; stop it after reading).
Current docs: https://www.prisma.io/docs/prisma-compute/deploy.md. If you're using MongoDB, follow the MongoDB quickstart or add Prisma Next to an existing MongoDB app . If you work with Kysely , Drizzle , or TypeORM , the Prisma Postgres quickstarts cover those tools.
This page hides the full navigation to keep the first run focused. Everything is one click away.