diff --git a/apps/docs/content/docs/compute-internal/cli.mdx b/apps/docs/content/docs/compute-internal/cli.mdx new file mode 100644 index 0000000000..b9585769ec --- /dev/null +++ b/apps/docs/content/docs/compute-internal/cli.mdx @@ -0,0 +1,78 @@ +--- +title: CLI reference +url: /compute-internal/cli +metaTitle: CLI reference | Prisma Compute (Internal) +metaDescription: Command inventory for deploying and managing Prisma Compute apps with @looma/prisma-cli or @prisma/compute-cli. +--- + +:::warning +Internal team reference. Not for users. This section will be removed after the public beta launch on 2026-05-13. The public docs live at [/compute](/compute). +::: + +Two CLIs are usable today. Pick whichever fits your workflow. Both authenticate the same way and target the same backend. + +- [`@looma/prisma-cli`](https://www.npmjs.com/package/@looma/prisma-cli): unified `prisma app` surface. +- [`@prisma/compute-cli`](https://www.npmjs.com/package/@prisma/compute-cli): original `compute` surface. + +## Inspect a deployment + + + + @looma/prisma-cli + @prisma/compute-cli + + + +```bash +npx @looma/prisma-cli app list-deploys +npx @looma/prisma-cli app show-deploy +``` + + + + +```bash +bunx @prisma/compute-cli versions list +bunx @prisma/compute-cli versions show +``` + + + + +## Command inventory + + + + @looma/prisma-cli + @prisma/compute-cli + + + +```bash +prisma auth login | logout | whoami +prisma project ... +prisma app build | run | deploy | update-env | list-env +prisma app show | open | logs +prisma app list-deploys | show-deploy | promote | rollback | remove +``` + + + + +```bash +compute login | logout +compute deploy [--project --service --service-name --region --path + --entrypoint --build-type auto|bun|nextjs --http-port + --env KEY=VALUE --unset-env KEY + --skip-build --skip-promote --destroy-old-version --json] +compute logs [--tail --from-start --cursor --json] +compute env update [--env --unset-env --http-port] +compute versions list | show | start | stop | promote | delete | destroy +compute services list +compute projects list +``` + + + + +Need a flag that is not listed here? Run `--help` on the relevant command. Both CLIs have stable, browsable help output. diff --git a/apps/docs/content/docs/compute-internal/environment-variables.mdx b/apps/docs/content/docs/compute-internal/environment-variables.mdx new file mode 100644 index 0000000000..5eda27c116 --- /dev/null +++ b/apps/docs/content/docs/compute-internal/environment-variables.mdx @@ -0,0 +1,106 @@ +--- +title: Environment variables +url: /compute-internal/environment-variables +metaTitle: Environment variables | Prisma Compute (Internal) +metaDescription: Set environment variables on a Prisma Compute deployment, either inline on deploy or without rebuilding. Supports KEY=VALUE, comma-separated assignments, and dotenv file paths. +--- + +:::warning +Internal team reference. Not for users. This section will be removed after the public beta launch on 2026-05-13. The public docs live at [/compute](/compute). +::: + +Set environment variables inline when deploying, or update them later without rebuilding. Either path cuts a new compute version. The old version stays live until the new one is healthy. + +## During a deploy + +Repeat `--env` per variable: + + + + @looma/prisma-cli + @prisma/compute-cli + + + +```bash +npx @looma/prisma-cli app deploy \ + --env DATABASE_URL=postgresql://example \ + --env NODE_ENV=production +``` + + + + +```bash +bunx @prisma/compute-cli deploy \ + --env DATABASE_URL=postgresql://example \ + --env NODE_ENV=production +``` + + + + +## Without rebuilding + +Same flag shape, dedicated command: + + + + @looma/prisma-cli + @prisma/compute-cli + + + +```bash +npx @looma/prisma-cli app update-env --env STRIPE_KEY=sk_live_xxx +npx @looma/prisma-cli app list-env +``` + + + + +```bash +bunx @prisma/compute-cli env update --env STRIPE_KEY=sk_live_xxx +bunx @prisma/compute-cli env update --unset-env LEGACY_FLAG +``` + + + + +## Bulk input with `@prisma/compute-cli` + +`@prisma/compute-cli` accepts three `--env` input formats. They can be combined on the same command and `--env` is repeatable. When a key appears more than once, the later value wins. + +**Load a `.env` file:** + +```bash +bunx @prisma/compute-cli deploy --env ./.env.production +``` + +The file is parsed with standard dotenv rules (comments, `export KEY=VALUE`, quoted values, inline comments). Malformed lines fail fast. + +**Comma-separated assignments in one flag:** + +```bash +bunx @prisma/compute-cli deploy --env FOO=1,BAR=2 +``` + +**Values that contain commas:** wrap the whole assignment in single quotes and the value in double quotes: + +```bash +bunx @prisma/compute-cli deploy --env 'DB_URL="postgres://user:pass@host/db?options=a,b"' +``` + +For complex values (URLs with query params, multi-line secrets), a `.env` file is easier to get right than inline quoting. + +**Mix them:** + +```bash +bunx @prisma/compute-cli env update \ + --env ./.env \ + --env API_URL=https://example.com +``` + +:::note +The `.env` file path and comma-separated formats are currently only supported by `@prisma/compute-cli`. With `@looma/prisma-cli`, pass one `KEY=VALUE` per `--env` flag. +::: diff --git a/apps/docs/content/docs/compute-internal/index.mdx b/apps/docs/content/docs/compute-internal/index.mdx new file mode 100644 index 0000000000..3b28cb2bb9 --- /dev/null +++ b/apps/docs/content/docs/compute-internal/index.mdx @@ -0,0 +1,79 @@ +--- +title: Prisma Compute +url: /compute-internal +metaTitle: Prisma Compute (Internal) +metaDescription: Internal one-stop reference for deploying Next.js, Astro, Nuxt, TanStack Start, and Bun apps to Prisma Compute, managing environment variables, and streaming logs. +--- + +:::warning +Internal team reference. Not for users. This section will be removed after the public beta launch on 2026-05-13. The public docs live at [/compute](/compute). +::: + +Prisma Compute is app hosting for Node.js and Bun apps, driven from the CLI. First-class support for Next.js, Astro, Nuxt, TanStack Start, and Bun. Deploys are zero-flag on the SDK side: the framework is auto-detected from your `package.json` and config. + +Two CLIs are usable today, pick whichever you prefer: + +- [`@looma/prisma-cli`](https://www.npmjs.com/package/@looma/prisma-cli): unified `prisma app` surface. +- [`@prisma/compute-cli`](https://www.npmjs.com/package/@prisma/compute-cli): original `compute` surface. + +See the full [CLI reference](/compute-internal/cli) for both. + +## Pick a quickstart + +Each quickstart walks you from a fresh app to a live deployment. Pick the one that matches your stack. + + + Next.js} + > + Scaffold, enable standalone output, and deploy. + + Astro} + > + Set up the Node adapter in standalone mode and deploy on port 4321. + + Nuxt} + > + Scaffold and deploy with the default Nitro node-server preset. + + TanStack Start} + > + Deploy the official Vite plus Nitro starter. + + Bun} + > + Deploy a Bun.serve HTTP server directly. + + + +## Manage a deployment + +After the first deploy, use these references day-to-day. + + + + Set secrets and config inline on deploy, or update later without rebuilding. + + + Stream runtime logs per compute version or deployment. + + + Full command inventory for both `@looma/prisma-cli` and `@prisma/compute-cli`. + + + Known caveats around framework support, env updates, and log streaming. + + + +## Support + +Questions or breakage: `#product-compute`. diff --git a/apps/docs/content/docs/compute-internal/limitations.mdx b/apps/docs/content/docs/compute-internal/limitations.mdx new file mode 100644 index 0000000000..8bd6f4ebfa --- /dev/null +++ b/apps/docs/content/docs/compute-internal/limitations.mdx @@ -0,0 +1,36 @@ +--- +title: Limitations +url: /compute-internal/limitations +metaTitle: Limitations | Prisma Compute (Internal) +metaDescription: Known Prisma Compute limitations covering framework support, env updates, and log streaming. +--- + +:::warning +Internal team reference. Not for users. This section will be removed after the public beta launch on 2026-05-13. The public docs live at [/compute](/compute). +::: + +Known caveats. + +## Framework support + +First-class support: **Next.js**, **Astro**, **Nuxt**, **TanStack Start**, and **Bun**. Other Node.js frameworks may build via auto-detection, but are not explicitly tested. + +Framework-specific requirements: + +- **Next.js**: must use `output: "standalone"` in `next.config.ts`. +- **Astro**: needs `@astrojs/node` in standalone mode via the adapter. + +## Environment updates + +`env update` (compute) and `app update-env` (looma) each cut a new compute version. The old version stays live until the new one is healthy. + +`@looma/prisma-cli` accepts only one `KEY=VALUE` per `--env` flag. `.env` file paths and comma-separated assignments are currently only supported by `@prisma/compute-cli` (see [Environment variables](/compute-internal/environment-variables)). + +## Logs + +- Stream caps at around 10 minutes. Reconnect with `--cursor `. +- One concurrent log stream per compute version. + +## Support + +Questions or breakage: `#product-compute`. diff --git a/apps/docs/content/docs/compute-internal/logs.mdx b/apps/docs/content/docs/compute-internal/logs.mdx new file mode 100644 index 0000000000..33e443ac36 --- /dev/null +++ b/apps/docs/content/docs/compute-internal/logs.mdx @@ -0,0 +1,45 @@ +--- +title: Logs +url: /compute-internal/logs +metaTitle: Logs | Prisma Compute (Internal) +metaDescription: Stream runtime logs from a Prisma Compute deployment. +--- + +:::warning +Internal team reference. Not for users. This section will be removed after the public beta launch on 2026-05-13. The public docs live at [/compute](/compute). +::: + +Stream logs for a specific compute version or deployment. + +## Stream logs + + + + @prisma/compute-cli + @looma/prisma-cli + + + +```bash +bunx @prisma/compute-cli logs +bunx @prisma/compute-cli logs --tail 200 +bunx @prisma/compute-cli logs --from-start +bunx @prisma/compute-cli logs --cursor +``` + + + + +```bash +npx @looma/prisma-cli app logs +npx @looma/prisma-cli app logs --deployment +npx @looma/prisma-cli app logs --tail 200 +``` + + + + +## Limits + +- Stream caps at around 10 minutes. Reconnect with `--cursor ` to resume from where the last stream ended. +- Only one concurrent log stream per compute version. diff --git a/apps/docs/content/docs/compute-internal/meta.json b/apps/docs/content/docs/compute-internal/meta.json new file mode 100644 index 0000000000..daba0a7aaf --- /dev/null +++ b/apps/docs/content/docs/compute-internal/meta.json @@ -0,0 +1,17 @@ +{ + "title": "Compute (Internal)", + "root": true, + "icon": "Cpu", + "pages": [ + "---Introduction---", + "index", + "---Quickstart---", + "...quickstart", + "---Reference---", + "environment-variables", + "logs", + "cli", + "---More---", + "limitations" + ] +} diff --git a/apps/docs/content/docs/compute-internal/quickstart/astro.mdx b/apps/docs/content/docs/compute-internal/quickstart/astro.mdx new file mode 100644 index 0000000000..6228ec7088 --- /dev/null +++ b/apps/docs/content/docs/compute-internal/quickstart/astro.mdx @@ -0,0 +1,82 @@ +--- +title: Astro +url: /compute-internal/quickstart/astro +metaTitle: "Quickstart: Deploy an Astro app to Prisma Compute (Internal)" +metaDescription: Scaffold an Astro app with the Node adapter in standalone mode and deploy it to Prisma Compute. +--- + +:::warning +Internal team reference. Not for users. This section will be removed after the public beta launch on 2026-05-13. The public docs live at [/compute](/compute). +::: + +Deploy an Astro app to Prisma Compute using the `@astrojs/node` adapter in standalone mode. Astro serves on port `4321` by default, so the first deploy command sets `--http-port 4321`. + +## Prerequisites + +- Node.js 20+ +- A Prisma account logged in via CLI (covered in step 4) + +## 1. Scaffold the app + +```bash +pnpm create astro@latest my-app +cd my-app +``` + +## 2. Add the Node adapter + +```bash +pnpm add @astrojs/node +``` + +## 3. Enable SSR with the Node adapter + +Edit `astro.config.mjs`: + +```typescript title="astro.config.mjs" +import { defineConfig } from "astro/config"; +import node from "@astrojs/node"; + +export default defineConfig({ + output: "server", + adapter: node({ mode: "standalone" }), +}); +``` + +Compute deploys Astro apps in standalone mode. Without this adapter config, the build does not emit a Node server entry Compute can run. + +## 4. Authenticate and deploy + + + + @looma/prisma-cli + @prisma/compute-cli + + + +```bash +npx @looma/prisma-cli auth login +npx @looma/prisma-cli app deploy --app my-app --http-port 4321 +``` + + + + +```bash +bunx @prisma/compute-cli login +bunx @prisma/compute-cli deploy --service-name my-app --http-port 4321 +``` + + + + +The first deploy bootstraps project context. Re-deploys reuse the saved selection, so `app deploy` (or `deploy`) is enough. + +In CI, set `PRISMA_API_TOKEN` instead of running `auth login`. + +## Next steps + +- [Environment variables](/compute-internal/environment-variables): set secrets and config at deploy time or after. +- [Logs](/compute-internal/logs): stream runtime logs per deployment. +- [CLI reference](/compute-internal/cli): full command inventory for both CLIs. +- [Limitations](/compute-internal/limitations): known caveats. diff --git a/apps/docs/content/docs/compute-internal/quickstart/bun.mdx b/apps/docs/content/docs/compute-internal/quickstart/bun.mdx new file mode 100644 index 0000000000..3381f0115f --- /dev/null +++ b/apps/docs/content/docs/compute-internal/quickstart/bun.mdx @@ -0,0 +1,72 @@ +--- +title: Bun +url: /compute-internal/quickstart/bun +metaTitle: "Quickstart: Deploy a Bun app to Prisma Compute (Internal)" +metaDescription: Scaffold a Bun HTTP server and deploy it to Prisma Compute. +--- + +:::warning +Internal team reference. Not for users. This section will be removed after the public beta launch on 2026-05-13. The public docs live at [/compute](/compute). +::: + +Deploy a Bun HTTP server to Prisma Compute. Bun.serve apps are supported directly, no bundler or adapter required. + +## Prerequisites + +- [Bun](https://bun.sh) installed locally +- A Prisma account logged in via CLI (covered in step 3) + +## 1. Initialize the app + +```bash +mkdir my-app && cd my-app && bun init --yes +``` + +## 2. Replace `index.ts` + +```typescript title="index.ts" +Bun.serve({ + port: Number(process.env.PORT ?? 3000), + fetch() { + return new Response("Hello from Compute"); + }, +}); +``` + +Reading `PORT` from the environment keeps the server aligned with Compute's injected port. + +## 3. Authenticate and deploy + + + + @looma/prisma-cli + @prisma/compute-cli + + + +```bash +npx @looma/prisma-cli auth login +npx @looma/prisma-cli app deploy --app my-app --http-port 3000 +``` + + + + +```bash +bunx @prisma/compute-cli login +bunx @prisma/compute-cli deploy --service-name my-app --http-port 3000 +``` + + + + +The first deploy bootstraps project context. Re-deploys reuse the saved selection, so `app deploy` (or `deploy`) is enough. + +In CI, set `PRISMA_API_TOKEN` instead of running `auth login`. + +## Next steps + +- [Environment variables](/compute-internal/environment-variables): set secrets and config at deploy time or after. +- [Logs](/compute-internal/logs): stream runtime logs per deployment. +- [CLI reference](/compute-internal/cli): full command inventory for both CLIs. +- [Limitations](/compute-internal/limitations): known caveats. diff --git a/apps/docs/content/docs/compute-internal/quickstart/meta.json b/apps/docs/content/docs/compute-internal/quickstart/meta.json new file mode 100644 index 0000000000..8f77f50952 --- /dev/null +++ b/apps/docs/content/docs/compute-internal/quickstart/meta.json @@ -0,0 +1,4 @@ +{ + "title": "Quickstart", + "pages": ["nextjs", "astro", "nuxt", "tanstack-start", "bun"] +} diff --git a/apps/docs/content/docs/compute-internal/quickstart/nextjs.mdx b/apps/docs/content/docs/compute-internal/quickstart/nextjs.mdx new file mode 100644 index 0000000000..acc323a48d --- /dev/null +++ b/apps/docs/content/docs/compute-internal/quickstart/nextjs.mdx @@ -0,0 +1,71 @@ +--- +title: Next.js +url: /compute-internal/quickstart/nextjs +metaTitle: "Quickstart: Deploy a Next.js app to Prisma Compute (Internal)" +metaDescription: Scaffold a Next.js app, enable standalone output, and deploy it to Prisma Compute. +--- + +:::warning +Internal team reference. Not for users. This section will be removed after the public beta launch on 2026-05-13. The public docs live at [/compute](/compute). +::: + +Deploy a Next.js app to Prisma Compute. This quickstart walks through scaffolding a fresh app, enabling standalone output (required by Compute), and running the first deploy with either `@looma/prisma-cli` or `@prisma/compute-cli`. + +## Prerequisites + +- Node.js 20+ +- A Prisma account logged in via CLI (covered in step 3) + +## 1. Scaffold the app + +```bash +pnpm create next-app@latest my-app --yes +cd my-app +``` + +## 2. Enable standalone output + +Edit `next.config.ts`: + +```typescript title="next.config.ts" +const nextConfig = { output: "standalone" }; +export default nextConfig; +``` + +Compute deploys Next.js apps in standalone mode. Without this flag, the build output does not include the server entry Compute expects. + +## 3. Authenticate and deploy + + + + @looma/prisma-cli + @prisma/compute-cli + + + +```bash +npx @looma/prisma-cli auth login +npx @looma/prisma-cli app deploy --app my-app --http-port 3000 +``` + + + + +```bash +bunx @prisma/compute-cli login +bunx @prisma/compute-cli deploy --service-name my-app --http-port 3000 +``` + + + + +The first deploy bootstraps project context. Re-deploys reuse the saved selection, so `app deploy` (or `deploy`) is enough. + +In CI, set `PRISMA_API_TOKEN` instead of running `auth login`. + +## Next steps + +- [Environment variables](/compute-internal/environment-variables): set secrets and config at deploy time or after. +- [Logs](/compute-internal/logs): stream runtime logs per deployment. +- [CLI reference](/compute-internal/cli): full command inventory for both CLIs. +- [Limitations](/compute-internal/limitations): known caveats. diff --git a/apps/docs/content/docs/compute-internal/quickstart/nuxt.mdx b/apps/docs/content/docs/compute-internal/quickstart/nuxt.mdx new file mode 100644 index 0000000000..b8a98c4aa6 --- /dev/null +++ b/apps/docs/content/docs/compute-internal/quickstart/nuxt.mdx @@ -0,0 +1,62 @@ +--- +title: Nuxt +url: /compute-internal/quickstart/nuxt +metaTitle: "Quickstart: Deploy a Nuxt app to Prisma Compute (Internal)" +metaDescription: Scaffold a Nuxt app and deploy it to Prisma Compute. No extra config, Nuxt uses the Nitro node-server preset by default. +--- + +:::warning +Internal team reference. Not for users. This section will be removed after the public beta launch on 2026-05-13. The public docs live at [/compute](/compute). +::: + +Deploy a Nuxt app to Prisma Compute. Nuxt builds with the Nitro `node-server` preset by default, so no adapter config is required. + +## Prerequisites + +- Node.js 20+ +- A Prisma account logged in via CLI (covered in step 2) + +## 1. Scaffold the app + +```bash +pnpm create nuxt my-app +cd my-app +``` + +No extra config is needed. The default build output targets Node. + +## 2. Authenticate and deploy + + + + @looma/prisma-cli + @prisma/compute-cli + + + +```bash +npx @looma/prisma-cli auth login +npx @looma/prisma-cli app deploy --app my-app --http-port 3000 +``` + + + + +```bash +bunx @prisma/compute-cli login +bunx @prisma/compute-cli deploy --service-name my-app --http-port 3000 +``` + + + + +The first deploy bootstraps project context. Re-deploys reuse the saved selection, so `app deploy` (or `deploy`) is enough. + +In CI, set `PRISMA_API_TOKEN` instead of running `auth login`. + +## Next steps + +- [Environment variables](/compute-internal/environment-variables): set secrets and config at deploy time or after. +- [Logs](/compute-internal/logs): stream runtime logs per deployment. +- [CLI reference](/compute-internal/cli): full command inventory for both CLIs. +- [Limitations](/compute-internal/limitations): known caveats. diff --git a/apps/docs/content/docs/compute-internal/quickstart/tanstack-start.mdx b/apps/docs/content/docs/compute-internal/quickstart/tanstack-start.mdx new file mode 100644 index 0000000000..7de63090e5 --- /dev/null +++ b/apps/docs/content/docs/compute-internal/quickstart/tanstack-start.mdx @@ -0,0 +1,75 @@ +--- +title: TanStack Start +url: /compute-internal/quickstart/tanstack-start +metaTitle: "Quickstart: Deploy a TanStack Start app to Prisma Compute (Internal)" +metaDescription: Scaffold a TanStack Start app (Vite + Nitro node preset) and deploy it to Prisma Compute. +--- + +:::warning +Internal team reference. Not for users. This section will be removed after the public beta launch on 2026-05-13. The public docs live at [/compute](/compute). +::: + +Deploy a TanStack Start app to Prisma Compute. TanStack Start builds with Vite and the Nitro `node` preset, both already wired in the official starter. + +## Prerequisites + +- Node.js 20+ +- A Prisma account logged in via CLI (covered in step 2) + +## 1. Scaffold the app + +Scaffold from the [official TanStack Start starter](https://tanstack.com/start/latest/docs/framework/react/getting-started) and `cd` into the project. Ensure `vite.config.ts` includes the `tanstackStart()` and `nitro()` plugins, which match the detection the Compute SDK expects. + +Example `vite.config.ts`: + +```typescript title="vite.config.ts" +import { defineConfig } from "vite"; +import { tanstackStart } from "@tanstack/react-start/plugin/vite"; +import viteReact from "@vitejs/plugin-react"; +import { nitro } from "nitro/vite"; + +export default defineConfig({ + server: { port: 3000 }, + plugins: [ + tanstackStart(), + nitro(), + viteReact(), + ], +}); +``` + +## 2. Authenticate and deploy + + + + @looma/prisma-cli + @prisma/compute-cli + + + +```bash +npx @looma/prisma-cli auth login +npx @looma/prisma-cli app deploy --app my-app --http-port 3000 +``` + + + + +```bash +bunx @prisma/compute-cli login +bunx @prisma/compute-cli deploy --service-name my-app --http-port 3000 +``` + + + + +The first deploy bootstraps project context. Re-deploys reuse the saved selection, so `app deploy` (or `deploy`) is enough. + +In CI, set `PRISMA_API_TOKEN` instead of running `auth login`. + +## Next steps + +- [Environment variables](/compute-internal/environment-variables): set secrets and config at deploy time or after. +- [Logs](/compute-internal/logs): stream runtime logs per deployment. +- [CLI reference](/compute-internal/cli): full command inventory for both CLIs. +- [Limitations](/compute-internal/limitations): known caveats. diff --git a/apps/docs/content/docs/compute/environment-variables.mdx b/apps/docs/content/docs/compute/environment-variables.mdx new file mode 100644 index 0000000000..488a7348de --- /dev/null +++ b/apps/docs/content/docs/compute/environment-variables.mdx @@ -0,0 +1,27 @@ +--- +title: Environment variables +url: /compute/environment-variables +metaTitle: Environment variables | Prisma Compute +metaDescription: Set environment variables on a Prisma Compute deployment, either inline on deploy or without rebuilding. +--- + +Set environment variables inline when deploying, or update them later without rebuilding. Either path cuts a new deployment. The old deployment stays live until the new one is healthy. + +## During a deploy + +Repeat `--env` per variable: + +```bash +prisma app deploy \ + --env DATABASE_URL=postgresql://example \ + --env NODE_ENV=production +``` + +## Without rebuilding + +Update environment variables on an existing deployment: + +```bash +prisma app update-env --env STRIPE_KEY=sk_live_xxx +prisma app list-env +``` diff --git a/apps/docs/content/docs/compute/index.mdx b/apps/docs/content/docs/compute/index.mdx new file mode 100644 index 0000000000..5a07d55c13 --- /dev/null +++ b/apps/docs/content/docs/compute/index.mdx @@ -0,0 +1,59 @@ +--- +title: Prisma Compute +url: /compute +metaTitle: Prisma Compute +metaDescription: Deploy Next.js, Astro, Nuxt, TanStack Start, and Bun apps to Prisma Compute with a single command. +--- + +Prisma Compute is app hosting for Node.js and Bun apps. Deploy from the command line with a single command. Framework detection is automatic for Next.js, Astro, Nuxt, TanStack Start, and Bun. + +## Pick a quickstart + +Each quickstart walks you from a fresh app to a live deployment. + + + Next.js} + > + Scaffold a Next.js app, enable standalone output, and deploy. + + Astro} + > + Deploy an Astro app with the Node adapter in standalone mode. + + Nuxt} + > + Deploy a Nuxt app with the default Nitro node-server preset. + + TanStack Start} + > + Deploy a TanStack Start app built with Vite and Nitro. + + Bun} + > + Deploy a Bun HTTP server directly. + + + +## Manage a deployment + + + + Set secrets and configuration inline on deploy, or update later without rebuilding. + + + Stream runtime logs per deployment. + + + Known caveats around framework support, environment updates, and log streaming. + + diff --git a/apps/docs/content/docs/compute/limitations.mdx b/apps/docs/content/docs/compute/limitations.mdx new file mode 100644 index 0000000000..60ed54d5da --- /dev/null +++ b/apps/docs/content/docs/compute/limitations.mdx @@ -0,0 +1,24 @@ +--- +title: Limitations +url: /compute/limitations +metaTitle: Limitations | Prisma Compute +metaDescription: Known Prisma Compute limitations covering framework support, environment updates, and log streaming. +--- + +## Framework support + +First-class support: **Next.js**, **Astro**, **Nuxt**, **TanStack Start**, and **Bun**. Other Node.js frameworks may build via auto-detection but are not explicitly tested. + +Framework-specific requirements: + +- **Next.js**: must use `output: "standalone"` in `next.config.ts`. +- **Astro**: needs `@astrojs/node` in standalone mode. + +## Environment updates + +Updating environment variables cuts a new deployment. The old deployment stays live until the new one is healthy. + +## Logs + +- Stream caps at around 10 minutes. +- One concurrent log stream per deployment. diff --git a/apps/docs/content/docs/compute/logs.mdx b/apps/docs/content/docs/compute/logs.mdx new file mode 100644 index 0000000000..3892532644 --- /dev/null +++ b/apps/docs/content/docs/compute/logs.mdx @@ -0,0 +1,21 @@ +--- +title: Logs +url: /compute/logs +metaTitle: Logs | Prisma Compute +metaDescription: Stream runtime logs from a Prisma Compute deployment. +--- + +Stream runtime logs for your deployment. + +## Stream logs + +```bash +prisma app logs +prisma app logs --deployment +prisma app logs --tail 200 +``` + +## Limits + +- Stream caps at around 10 minutes. Reconnect to resume. +- One concurrent log stream per deployment. diff --git a/apps/docs/content/docs/compute/meta.json b/apps/docs/content/docs/compute/meta.json new file mode 100644 index 0000000000..9a02c18928 --- /dev/null +++ b/apps/docs/content/docs/compute/meta.json @@ -0,0 +1,16 @@ +{ + "title": "Compute", + "root": true, + "icon": "Cpu", + "pages": [ + "---Introduction---", + "index", + "---Quickstart---", + "...quickstart", + "---Reference---", + "environment-variables", + "logs", + "---More---", + "limitations" + ] +} diff --git a/apps/docs/content/docs/compute/quickstart/astro.mdx b/apps/docs/content/docs/compute/quickstart/astro.mdx new file mode 100644 index 0000000000..2572224b52 --- /dev/null +++ b/apps/docs/content/docs/compute/quickstart/astro.mdx @@ -0,0 +1,59 @@ +--- +title: Astro +url: /compute/quickstart/astro +metaTitle: "Quickstart: Deploy an Astro app to Prisma Compute" +metaDescription: Scaffold an Astro app with the Node adapter in standalone mode and deploy it to Prisma Compute. +--- + +Deploy an Astro app to Prisma Compute using the `@astrojs/node` adapter in standalone mode. Astro serves on port `4321` by default. + +## Prerequisites + +- Node.js 20 or later +- A Prisma account + +## 1. Scaffold the app + +```bash +pnpm create astro@latest my-app +cd my-app +``` + +## 2. Add the Node adapter + +```bash +pnpm add @astrojs/node +``` + +## 3. Enable SSR with the Node adapter + +Edit `astro.config.mjs`: + +```typescript title="astro.config.mjs" +import { defineConfig } from "astro/config"; +import node from "@astrojs/node"; + +export default defineConfig({ + output: "server", + adapter: node({ mode: "standalone" }), +}); +``` + +Compute runs Astro apps from the standalone Node build. Without this adapter config, the build does not emit a server entry Compute can run. + +## 4. Authenticate and deploy + +```bash +prisma auth login +prisma app deploy --app my-app --http-port 4321 +``` + +The first deploy bootstraps project context. Re-deploys reuse the saved selection, so `prisma app deploy` is enough. + +In CI, set `PRISMA_API_TOKEN` instead of running `prisma auth login`. + +## Next steps + +- [Environment variables](/compute/environment-variables): set secrets and configuration at deploy time or after. +- [Logs](/compute/logs): stream runtime logs. +- [Limitations](/compute/limitations): known caveats. diff --git a/apps/docs/content/docs/compute/quickstart/bun.mdx b/apps/docs/content/docs/compute/quickstart/bun.mdx new file mode 100644 index 0000000000..7836857379 --- /dev/null +++ b/apps/docs/content/docs/compute/quickstart/bun.mdx @@ -0,0 +1,49 @@ +--- +title: Bun +url: /compute/quickstart/bun +metaTitle: "Quickstart: Deploy a Bun app to Prisma Compute" +metaDescription: Scaffold a Bun HTTP server and deploy it to Prisma Compute. +--- + +Deploy a Bun HTTP server to Prisma Compute. Bun.serve apps are supported directly, no bundler or adapter required. + +## Prerequisites + +- [Bun](https://bun.sh) installed locally +- A Prisma account + +## 1. Initialize the app + +```bash +mkdir my-app && cd my-app && bun init --yes +``` + +## 2. Replace `index.ts` + +```typescript title="index.ts" +Bun.serve({ + port: Number(process.env.PORT ?? 3000), + fetch() { + return new Response("Hello from Compute"); + }, +}); +``` + +Reading `PORT` from the environment keeps the server aligned with Compute's injected port. + +## 3. Authenticate and deploy + +```bash +prisma auth login +prisma app deploy --app my-app --http-port 3000 +``` + +The first deploy bootstraps project context. Re-deploys reuse the saved selection, so `prisma app deploy` is enough. + +In CI, set `PRISMA_API_TOKEN` instead of running `prisma auth login`. + +## Next steps + +- [Environment variables](/compute/environment-variables): set secrets and configuration at deploy time or after. +- [Logs](/compute/logs): stream runtime logs. +- [Limitations](/compute/limitations): known caveats. diff --git a/apps/docs/content/docs/compute/quickstart/meta.json b/apps/docs/content/docs/compute/quickstart/meta.json new file mode 100644 index 0000000000..8f77f50952 --- /dev/null +++ b/apps/docs/content/docs/compute/quickstart/meta.json @@ -0,0 +1,4 @@ +{ + "title": "Quickstart", + "pages": ["nextjs", "astro", "nuxt", "tanstack-start", "bun"] +} diff --git a/apps/docs/content/docs/compute/quickstart/nextjs.mdx b/apps/docs/content/docs/compute/quickstart/nextjs.mdx new file mode 100644 index 0000000000..752e6aaa08 --- /dev/null +++ b/apps/docs/content/docs/compute/quickstart/nextjs.mdx @@ -0,0 +1,48 @@ +--- +title: Next.js +url: /compute/quickstart/nextjs +metaTitle: "Quickstart: Deploy a Next.js app to Prisma Compute" +metaDescription: Scaffold a Next.js app, enable standalone output, and deploy it to Prisma Compute with a single command. +--- + +Deploy a Next.js app to Prisma Compute. This quickstart covers scaffolding a fresh app, enabling the standalone build output Compute requires, and running the first deploy. + +## Prerequisites + +- Node.js 20 or later +- A Prisma account + +## 1. Scaffold the app + +```bash +pnpm create next-app@latest my-app --yes +cd my-app +``` + +## 2. Enable standalone output + +Edit `next.config.ts`: + +```typescript title="next.config.ts" +const nextConfig = { output: "standalone" }; +export default nextConfig; +``` + +Compute deploys Next.js apps from the standalone build. Without this flag, the build output does not include the server entry Compute expects. + +## 3. Authenticate and deploy + +```bash +prisma auth login +prisma app deploy --app my-app --http-port 3000 +``` + +The first deploy bootstraps project context. Re-deploys reuse the saved selection, so `prisma app deploy` is enough. + +In CI, set `PRISMA_API_TOKEN` instead of running `prisma auth login`. + +## Next steps + +- [Environment variables](/compute/environment-variables): set secrets and configuration at deploy time or after. +- [Logs](/compute/logs): stream runtime logs. +- [Limitations](/compute/limitations): known caveats. diff --git a/apps/docs/content/docs/compute/quickstart/nuxt.mdx b/apps/docs/content/docs/compute/quickstart/nuxt.mdx new file mode 100644 index 0000000000..c1c7ea825e --- /dev/null +++ b/apps/docs/content/docs/compute/quickstart/nuxt.mdx @@ -0,0 +1,39 @@ +--- +title: Nuxt +url: /compute/quickstart/nuxt +metaTitle: "Quickstart: Deploy a Nuxt app to Prisma Compute" +metaDescription: Scaffold a Nuxt app and deploy it to Prisma Compute. No extra config, Nuxt uses the Nitro node-server preset by default. +--- + +Deploy a Nuxt app to Prisma Compute. Nuxt builds with the Nitro `node-server` preset by default, so no adapter config is required. + +## Prerequisites + +- Node.js 20 or later +- A Prisma account + +## 1. Scaffold the app + +```bash +pnpm create nuxt my-app +cd my-app +``` + +No extra config is needed. The default build output targets Node. + +## 2. Authenticate and deploy + +```bash +prisma auth login +prisma app deploy --app my-app --http-port 3000 +``` + +The first deploy bootstraps project context. Re-deploys reuse the saved selection, so `prisma app deploy` is enough. + +In CI, set `PRISMA_API_TOKEN` instead of running `prisma auth login`. + +## Next steps + +- [Environment variables](/compute/environment-variables): set secrets and configuration at deploy time or after. +- [Logs](/compute/logs): stream runtime logs. +- [Limitations](/compute/limitations): known caveats. diff --git a/apps/docs/content/docs/compute/quickstart/tanstack-start.mdx b/apps/docs/content/docs/compute/quickstart/tanstack-start.mdx new file mode 100644 index 0000000000..526ddca2c6 --- /dev/null +++ b/apps/docs/content/docs/compute/quickstart/tanstack-start.mdx @@ -0,0 +1,52 @@ +--- +title: TanStack Start +url: /compute/quickstart/tanstack-start +metaTitle: "Quickstart: Deploy a TanStack Start app to Prisma Compute" +metaDescription: Scaffold a TanStack Start app (Vite + Nitro node preset) and deploy it to Prisma Compute. +--- + +Deploy a TanStack Start app to Prisma Compute. TanStack Start builds with Vite and the Nitro `node` preset, both already wired in the official starter. + +## Prerequisites + +- Node.js 20 or later +- A Prisma account + +## 1. Scaffold the app + +Scaffold from the [official TanStack Start starter](https://tanstack.com/start/latest/docs/framework/react/getting-started) and `cd` into the project. Ensure `vite.config.ts` includes the `tanstackStart()` and `nitro()` plugins. + +Example `vite.config.ts`: + +```typescript title="vite.config.ts" +import { defineConfig } from "vite"; +import { tanstackStart } from "@tanstack/react-start/plugin/vite"; +import viteReact from "@vitejs/plugin-react"; +import { nitro } from "nitro/vite"; + +export default defineConfig({ + server: { port: 3000 }, + plugins: [ + tanstackStart(), + nitro(), + viteReact(), + ], +}); +``` + +## 2. Authenticate and deploy + +```bash +prisma auth login +prisma app deploy --app my-app --http-port 3000 +``` + +The first deploy bootstraps project context. Re-deploys reuse the saved selection, so `prisma app deploy` is enough. + +In CI, set `PRISMA_API_TOKEN` instead of running `prisma auth login`. + +## Next steps + +- [Environment variables](/compute/environment-variables): set secrets and configuration at deploy time or after. +- [Logs](/compute/logs): stream runtime logs. +- [Limitations](/compute/limitations): known caveats. diff --git a/apps/docs/content/docs/meta.json b/apps/docs/content/docs/meta.json index 6b7db11405..746bdf60b1 100644 --- a/apps/docs/content/docs/meta.json +++ b/apps/docs/content/docs/meta.json @@ -5,6 +5,7 @@ "(index)", "orm", "postgres", + "compute", "cli", "guides", "studio", diff --git a/apps/docs/public/img/technologies/bun.svg b/apps/docs/public/img/technologies/bun.svg new file mode 100644 index 0000000000..7ef15001d2 --- /dev/null +++ b/apps/docs/public/img/technologies/bun.svg @@ -0,0 +1 @@ +Bun Logo \ No newline at end of file diff --git a/apps/docs/src/lib/layout.shared.tsx b/apps/docs/src/lib/layout.shared.tsx index ecad3a97cc..82b38d57f7 100644 --- a/apps/docs/src/lib/layout.shared.tsx +++ b/apps/docs/src/lib/layout.shared.tsx @@ -33,6 +33,16 @@ export const links: LinkItemTypeWithActivePaths[] = [ url: "/postgres", active: "nested-url", }, + { + text: "Compute", + url: "/compute", + active: "nested-url", + }, + { + text: "Compute (Internal)", + url: "/compute-internal", + active: "nested-url", + }, { text: "CLI", url: "/cli",