-
Notifications
You must be signed in to change notification settings - Fork 947
feat(docs): add Prisma Compute docs section and integrate into the docs experience #7931
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ankur-arch
wants to merge
24
commits into
main
Choose a base branch
from
compute-docs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
f0f3afb
feat(docs): add Prisma Compute docs section and integrate into docs n…
ankur-arch 2b8c66c
docs(compute): align with authoritative product docs and Public Beta …
ankur-arch 50caf33
docs(compute): add @prisma/cli reference page and clean up sidebar
ankur-arch 1e79585
docs(compute): verify against @prisma/cli 3.0.0-beta.3 and rewrite fo…
ankur-arch f8fe791
docs(compute): add Code Hike concept animations and tighten copy
ankur-arch 4a5ea54
docs(compute): refine Compute pitch and tighten copy voice
ankur-arch 0b8e19d
docs(compute): remove product-specific beta section from feature-matu…
ankur-arch f504aa8
docs(compute): fix production deploy contract, positioning, and badge…
ankur-arch 6d107db
Merge branch 'main' into compute-docs
ankur-arch 6ee34cc
docs(compute): sharpen overview lead — make deploy job explicit, bala…
ankur-arch e3d1856
docs(compute): rewrite overview in docs voice, cut markety phrasing
ankur-arch 796e483
docs(compute): rework overview flow, hand-holdey quickstart, richer c…
ankur-arch 3698aaf
docs(compute): apply PDP terminology and trim fillers across the section
ankur-arch c8ced78
Merge remote-tracking branch 'origin/main' into compute-docs
ankur-arch 44f5594
blog: launching Prisma Compute in public beta
ankur-arch eb801ba
docs(compute): render concept animations as visual flow diagrams
ankur-arch 67c1be0
docs(compute): make env var composition explicit in the flow
ankur-arch 7df983d
docs(compute): fix scope-box overflow, make var default explicit
ankur-arch 0816e92
docs(compute): align animations with docs content and positioning
ankur-arch d91e116
docs(blog): tweak compute launch post copy
ankur-arch e064f18
docs(compute): give parallel flow edges separate bend lanes
ankur-arch 0412bc7
docs(compute): rewrite deploy quickstart and tighten FAQ wording
ankur-arch 40a4499
docs(blog): refine Compute launch "Try it" section
ankur-arch bc16662
docs: align getting-started and overview entry points with Compute
ankur-arch File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
apps/docs/content/docs/(index)/prisma-compute/connect-to-prisma-postgres.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| --- | ||
| title: Connect to Prisma Postgres | ||
| description: Connect your Compute app to a Prisma Postgres database with a single environment variable. | ||
| url: /prisma-compute/connect-to-prisma-postgres | ||
| metaTitle: 'Quickstart: Connect Prisma Compute to Prisma Postgres' | ||
| metaDescription: Create a Prisma Postgres database, set its connection string on your Compute app, and verify the connection. | ||
| --- | ||
|
|
||
| An app on Compute reads its database connection from an environment variable, typically `DATABASE_URL`. In this guide, you will create a [Prisma Postgres](/postgres) database, set its connection string on your app, and verify the connection. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - A deployed app on Compute. If you don't have one, follow [Deploy your first app](/prisma-compute/deploy). | ||
|
|
||
| ## 1. Create a database | ||
|
|
||
| Create a Prisma Postgres database from the terminal: | ||
|
|
||
| ```npm | ||
| npx create-db | ||
| ``` | ||
|
|
||
| Copy the `postgres://...` connection string from the output. Alternatively, create the database in [Prisma Console](https://console.prisma.io), open it, and click **Connect to your database** to copy a connection URL. | ||
|
|
||
| ## 2. Set the connection string | ||
|
|
||
| Add the connection string to the scope your app runs in: | ||
|
|
||
| ```npm | ||
| npx @prisma/cli@latest project env add DATABASE_URL=postgres://... --role preview | ||
| ``` | ||
|
|
||
| Use `--role production` instead when configuring your production branch. | ||
|
|
||
| ## 3. Deploy | ||
|
|
||
| Variables are resolved at deploy time, so they apply on the next deploy: | ||
|
|
||
| ```npm | ||
| npx @prisma/cli@latest app deploy | ||
| ``` | ||
|
|
||
| ## 4. Verify | ||
|
|
||
| Open the app and exercise a code path that queries the database, then check the logs for connection errors: | ||
|
|
||
| ```npm | ||
| npx @prisma/cli@latest app open | ||
| npx @prisma/cli@latest app logs | ||
| ``` | ||
|
|
||
| If queries succeed, your app is connected. | ||
|
|
||
| ## What's next | ||
|
|
||
| - [Connect to a Prisma Postgres database](/compute/database/connect-to-prisma-postgres) for per-branch databases and troubleshooting | ||
| - [Environment variables](/compute/environment-variables) for scopes, write-only behavior, and limits | ||
| - [Prisma Postgres documentation](/postgres) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| --- | ||
| title: Deploy your first app | ||
| description: Take an existing TypeScript app from your terminal to a live URL on Prisma Compute. | ||
| url: /prisma-compute/deploy | ||
| metaTitle: 'Quickstart: Deploy your first app on Prisma Compute' | ||
| metaDescription: Deploy a TypeScript app to Prisma Compute with the @prisma/cli beta package and verify it at a live URL. | ||
| --- | ||
|
|
||
| [Prisma Compute](/compute) runs your app next to your Prisma Postgres database. In this guide, you will deploy an existing app to Compute and open it at a live URL. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - A JavaScript runtime: Node.js 22.12 or newer for `npx`/`pnpm`, or Bun for `bunx`. | ||
| - A Prisma developer platform account ([console.prisma.io](https://console.prisma.io)). | ||
| - An app built with **Next.js**, **Hono**, **TanStack Start**, or a plain **Bun** HTTP server. | ||
|
|
||
| :::info | ||
|
|
||
| Next.js apps must set `output: "standalone"` in their Next.js config before deploying. | ||
|
|
||
| ::: | ||
|
|
||
| ## 1. Deploy | ||
|
|
||
| From your app directory: | ||
|
|
||
| ```npm | ||
| npx @prisma/cli@latest app deploy | ||
| ``` | ||
|
|
||
| If you're not signed in yet, the CLI walks you through it, then sets up the project, builds your app, and deploys it. When it finishes, you get a live URL. Your first deployment is promoted to production automatically. | ||
|
|
||
| ## 2. Verify | ||
|
|
||
| Open the deployed app in your browser: | ||
|
|
||
| ```npm | ||
| npx @prisma/cli@latest app open | ||
| ``` | ||
|
|
||
| If something looks off, stream the logs: | ||
|
|
||
| ```npm | ||
| npx @prisma/cli@latest app logs | ||
| ``` | ||
|
|
||
| ## 3. Keep shipping | ||
|
|
||
| After your app is live, you can keep deploying with the Prisma CLI or inspect your resources in the [Prisma Console](https://console.prisma.io): projects, branches, apps, deployments, integrations, and domains. | ||
|
|
||
| Deploys from a Git feature branch create isolated [preview deployments](/compute/branching); deploying to production again is explicit: | ||
|
|
||
| ```npm | ||
| npx @prisma/cli@latest app deploy --prod | ||
| ``` | ||
|
|
||
| ## Hand it to your agent | ||
|
|
||
| You can also let your coding agent do the deploying. Sign in once yourself, because the browser step needs a human: | ||
|
|
||
| ```npm | ||
| npx @prisma/cli@latest auth login | ||
| ``` | ||
|
|
||
| After that, anything running in your environment inherits the session, including your agent. Paste this into your agent and fill in the blanks: | ||
|
|
||
| ```text | ||
| Build [what you want] in [framework] and deploy it to Prisma Compute using `npx @prisma/cli@latest`. | ||
| ``` | ||
|
|
||
| For example: | ||
|
|
||
| ```text | ||
| Build a Hono API with a /todos endpoint backed by an in-memory list. Deploy it to Prisma Compute using `npx @prisma/cli@latest`. | ||
| ``` | ||
|
|
||
| Notes worth giving your agent: | ||
|
|
||
| - Run every CLI command as `npx @prisma/cli@latest <command>`, and add `--json` for structured output. | ||
| - Check login state with `npx @prisma/cli@latest auth whoami`. | ||
| - On the first deploy, the CLI creates the project and prints a live URL. Open it and confirm the app responds. | ||
| - If the app needs config or secrets, add them with `npx @prisma/cli@latest project env add KEY=value --role preview`, then redeploy. Variables apply on the next deploy. | ||
|
|
||
| ## What's next | ||
|
|
||
| - [Connect your app to Prisma Postgres](/prisma-compute/connect-to-prisma-postgres) | ||
| - [Add environment variables](/compute/environment-variables) for configuration and secrets | ||
| - [Connect a GitHub repository](/compute/github) to deploy on push | ||
| - [Read the full CLI getting-started guide](/compute/getting-started) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "title": "Prisma Compute", | ||
| "defaultOpen": true, | ||
| "pages": ["deploy", "connect-to-prisma-postgres"] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| --- | ||
| title: Branching | ||
| description: Branches are isolated infrastructure boundaries that map to your Git branches, so preview work never touches production. | ||
| url: /compute/branching | ||
| metaTitle: Branching | Prisma Compute | ||
| metaDescription: How production and preview branches work in Prisma Compute, how the CLI picks a branch, and how branches are created and cleaned up. | ||
| --- | ||
|
|
||
| A branch is an isolated infrastructure boundary. Every branch in a project gets its own apps, databases, and deployments, so work on a preview never touches production. | ||
|
|
||
| A platform branch maps to a Git branch, but it's more than a name: it's a real resource that owns the infrastructure for one line of work. | ||
|
|
||
| ```text | ||
| workspace → project → branch → { apps, databases } | ||
| ``` | ||
|
|
||
| ## Production and preview | ||
|
|
||
| Every branch has a role. | ||
|
|
||
| - The **first branch** in a project is your production branch, usually `main`. It's protected and durable. | ||
| - **Every other branch** is a preview by default: disposable infrastructure for testing changes before they merge. | ||
|
|
||
| Production deploys get a guardrail; previews don't. See [Deployments](/compute/deployments). | ||
|
|
||
| ## How the CLI picks a branch | ||
|
|
||
| When you deploy, the CLI resolves the branch in this order: | ||
|
|
||
| 1. `--branch <name>`, if you pass it. | ||
| 2. Your active Git branch. | ||
| 3. `main`. | ||
|
|
||
| So inside a Git repo, deploying from `feature/search` targets the `feature/search` branch automatically. To be explicit: | ||
|
|
||
| ```npm | ||
| npx @prisma/cli@latest app deploy --branch feature/search | ||
| ``` | ||
|
|
||
| Inspect platform branches: | ||
|
|
||
| ```npm | ||
| npx @prisma/cli@latest branch list | ||
| npx @prisma/cli@latest branch show | ||
| ``` | ||
|
|
||
| `branch use` switches your local branch context without creating anything remote: | ||
|
|
||
| ```npm | ||
| npx @prisma/cli@latest branch use feature/search | ||
| ``` | ||
|
|
||
| Listing a branch doesn't expand the apps and databases inside it. Use the `app` commands to inspect those. | ||
|
|
||
| ## Creating branches | ||
|
|
||
| You rarely create branches by hand. They appear when work needs them: | ||
|
|
||
| - **On deploy** — `app deploy --branch feature/search` creates the branch if it doesn't exist. | ||
| - **From GitHub** — when a repo is connected, branch and push events create or update the matching platform branch automatically. See [GitHub integration](/compute/github). | ||
|
|
||
| Connecting GitHub doesn't create branches retroactively; it wires up automation for future events. | ||
|
|
||
| ## Cleaning up | ||
|
|
||
| When GitHub is connected, deleting a Git branch tears down the matching platform branch, as long as it isn't your production or default branch. Those are always left alone. | ||
|
|
||
| ## Next steps | ||
|
|
||
| - [Environment variables](/compute/environment-variables) — preview values and per-branch overrides. | ||
| - [GitHub integration](/compute/github) — keep platform branches in sync with your repo. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.