Apps
Prisma.Compute deploys an application onto Prisma’s managed
runtime. One resource covers the whole path: build (optional),
upload, deploy, health-check, promote — see
Deployments for the lifecycle.
Framework apps
Section titled “Framework apps”Point path at the app and describe its build. The command runs
locally, the output directory is archived and uploaded, and the
entrypoint starts the server:
import * as Prisma from "alchemy/Prisma";
const app = yield* Prisma.Compute("api", { project, path: "./app", build: { command: "bun run build", outdir: ".output", entrypoint: "server/index.mjs", }, port: 3000, healthCheck: { path: "/api/health" }, env: { DATABASE_URL: connection.databaseUrl, }, destroyOldDeployment: true,});The server must listen on PORT (injected at runtime). With
build: "auto" — the default when path points at a recognizable
app — alchemy detects the framework (Bun, Next.js, Nuxt, Astro,
TanStack Start, NestJS) and derives the build for you.
app.url is the deployed endpoint.
Effect-native apps
Section titled “Effect-native apps”Pass main and an Effect body instead of a build, and the app is
bundled from your Stack file — same shape as an Effect-native
Cloudflare Worker or Lambda:
export default Prisma.Compute( "api", { project, main: import.meta.filename }, Effect.gen(function* () { const db = yield* Prisma.Connect(connection); const sql = yield* SQL.Postgres({ url: db.databaseUrl });
return { fetch: Effect.gen(function* () { const users = yield* sql`SELECT * FROM users`; return yield* HttpServerResponse.json(users); }), }; }).pipe(Effect.provide(Prisma.ConnectBinding)),);Custom domains
Section titled “Custom domains”const domain = yield* Prisma.CustomDomain("api-domain", { app, hostname: "api.example.com",});Local dev
Section titled “Local dev”Under bun alchemy dev, dev.command runs your app locally (e.g.
vite dev) with the same env the deployed app would see — including
connection bindings, which resolve to the local
dev database:
const app = yield* Prisma.Compute("web", { project, path: ".", dev: { command: "bun run dev" }, env: { DATABASE_URL: connection.databaseUrl },});Where next
Section titled “Where next”- Deployments — health-checked promotion, rollback, and deployment reuse.
- Connections — the env and binding wiring in detail.
Reference: