# Build and deploy the full Prisma stack (/docs/next/full-stack-tutorial)

> For the complete Prisma documentation index, see [llms.txt](https://www.prisma.io/docs/llms.txt). A markdown version of any docs page is available by appending `.md` to its URL.

A single tutorial from empty directory to live URL, with Prisma Next, Prisma Postgres, and Prisma Compute.

Location: Next > Build and deploy the full Prisma stack

This tutorial takes you through the whole recommended stack in one sitting: scaffold an app with [Prisma Next](https://www.prisma.io/docs/next), store data in [Prisma Postgres](https://www.prisma.io/docs/postgres), query it over HTTP, and deploy to [Prisma Compute](https://www.prisma.io/docs/compute) for a live URL. About 15 minutes.

It uses the `hono` template so you get a small API you can verify with curl at every step. The same journey works for the other templates; the [framework guides](https://www.prisma.io/docs/guides/next) cover each one.

## Prerequisites [#prerequisites]

* Node.js 24 or later (or Bun)
* A [Prisma Data Platform account](https://pris.ly/pdp) for the deploy step, free to create
* No database needed: setup provisions Prisma Postgres for you

## Use with your agent [#use-with-your-agent]

Prefer to delegate? This is the same journey as the prompt on the [getting started page](https://www.prisma.io/docs), with the `hono` template chosen for you:

```text
Create a new Hono API with Prisma Next, seed it, and deploy it to Prisma Compute.

1. Scaffold: `npx create-prisma@next create my-app --template hono --provider postgres --prisma-postgres --yes` (or pass `--database-url "<url>"` instead of `--prisma-postgres` if I give you a connection string).
2. In `my-app`, run `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` and `src/prisma/users.ts`, then rerun.
3. Start `npm run dev` in the background and verify `curl http://localhost:3000/users` returns the seeded users.
4. Deploy: 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`. Then run `npx @prisma/cli@latest app deploy --create-project my-app --env .env` and verify the live URL's /users endpoint with curl.

Use the installed Prisma Next skills.
```

## 1. Scaffold the app [#1-scaffold-the-app]

One command creates the app, wires up Prisma Next, and can provision the database:

  

#### bun

```bash
bunx create-prisma@next create my-app --template hono --provider postgres
```

#### pnpm

```bash
pnpm dlx create-prisma@next create my-app --template hono --provider postgres
```

#### yarn

```bash
yarn dlx create-prisma@next create my-app --template hono --provider postgres
```

#### npm

```bash
npx create-prisma@next create my-app --template hono --provider postgres
```

Pick **Prisma Postgres** at the database prompt to have a database created for you, or paste your own connection string. Then enter the project:

  

#### bun

```bash
cd my-app
```

#### pnpm

```bash
cd my-app
```

#### yarn

```bash
cd my-app
```

#### npm

```bash
cd my-app
```

The scaffold writes `DATABASE_URL` to `.env`, generates a Hono server in `src/index.ts` with `GET /` and `GET /users` routes, puts the Prisma Next setup under `src/prisma/`, and installs [Prisma Next skills](https://www.prisma.io/docs/ai/tools/skills) for your coding agent. If the database was provisioned without a signed-in CLI, `.env` also contains a `CLAIM_URL`; open it within 24 hours to claim the database into your account and keep it.

## 2. Initialize and seed the database [#2-initialize-and-seed-the-database]

`db:init` applies the starter contract to Prisma Postgres and signs the database; `db:seed` inserts sample users:

  

#### bun

```bash
bun run db:init
bun run db:seed
```

#### pnpm

```bash
pnpm run db:init
pnpm run db:seed
```

#### yarn

```bash
yarn db:init
yarn db:seed
```

#### npm

```bash
npm run db:init
npm run db:seed
```

```text no-copy
"summary": "Applied 5 operation(s) across 1 space(s), database signed"
Seeded 3 users.
```

> [!NOTE]
> Seeing `Cannot read properties of undefined (reading 'where')`? The current template still generates the older unqualified query form. Update `db.orm.User` to `db.orm.public.User` in `src/prisma/seed.ts` and `src/prisma/users.ts`, then rerun `db:seed`.

## 3. Run it and query your data [#3-run-it-and-query-your-data]

  

#### bun

```bash
bun run dev
```

#### pnpm

```bash
pnpm run dev
```

#### yarn

```bash
yarn dev
```

#### npm

```bash
npm run dev
```

The server starts on port 3000 (set `PORT` if something else is already using it). Confirm the API serves the seeded rows from Prisma Postgres:

```bash
curl http://localhost:3000/users
```

```json no-copy
[
  { "id": "1", "email": "alice@prisma.io", "username": "alice", "name": "Alice", "createdAt": "2026-07-27T13:31:56.993Z" },
  { "id": "2", "email": "bob@prisma.io", "username": "bob", "name": "Bob", "createdAt": "2026-07-27T13:31:57.021Z" },
  { "id": "3", "email": "carol@prisma.io", "username": "carol", "name": "Carol", "createdAt": "2026-07-27T13:31:57.049Z" }
]
```

The route handler in `src/index.ts` is ordinary Hono code calling an ordinary Prisma Next query. Change the starter contract in `src/prisma/` when you are ready to model your own data; the [fundamentals](https://www.prisma.io/docs/orm/next/fundamentals/reading-data) cover the query patterns.

## 4. Deploy to Prisma Compute [#4-deploy-to-prisma-compute]

Sign in once (it opens your browser):

  

#### bun

```bash
bunx @prisma/cli@latest auth login
```

#### pnpm

```bash
pnpm dlx @prisma/cli@latest auth login
```

#### yarn

```bash
yarn dlx @prisma/cli@latest auth login
```

#### npm

```bash
npx @prisma/cli@latest auth login
```

Deploy from the project directory. The first deploy asks you to pick or create a project; pass `--create-project my-app` to skip the prompt (agents and CI need it, since there is no interactive picker). The `--env .env` flag passes your `DATABASE_URL` to the deployment, so the live API talks to the same database:

  

#### bun

```bash
bunx @prisma/cli@latest app deploy --env .env
```

#### pnpm

```bash
pnpm dlx @prisma/cli@latest app deploy --env .env
```

#### yarn

```bash
yarn dlx @prisma/cli@latest app deploy --env .env
```

#### npm

```bash
npx @prisma/cli@latest app deploy --env .env
```

```text no-copy
First deploy of "my-app" -- promoting to production.
Building locally...
  Built      0.9 MB
Uploading...
Deploying...
Live in 7.5s
https://<your-app>.ewr.prisma.build
```

## 5. Verify the live URL [#5-verify-the-live-url]

```bash
curl https://<your-app>.ewr.prisma.build/users
```

The same three users come back, now served from production next to your database. The first deploy pins the directory to your project in a gitignored `.prisma/local.json` and promotes to production automatically.

## Next steps [#next-steps]

* [Pick your framework](https://www.prisma.io/docs/guides/next): the same journey for Next.js, Nuxt, Astro, NestJS, TanStack Start, and more.
* [Branching and previews](https://www.prisma.io/docs/compute/branching): every Git branch gets an isolated deployment.
* [Learn the fundamentals](https://www.prisma.io/docs/orm/next/fundamentals/reading-data): reading, writing, relations, and transactions.
* [Deploy on push](https://www.prisma.io/docs/compute/github): connect GitHub so every commit deploys itself.

## Related pages

- [`Choose a Prisma Next setup path`](https://www.prisma.io/docs/next/getting-started): Choose the fastest path to try Prisma Next in a new or existing project.