Deploy this app to Prisma Compute using `npx prisma@latest`.
Compute runs apps declared with Prisma Composer: your server code plus a small TypeScript declaration. Port the app following https://www.prisma.io/docs/composer/porting-an-app.md. Deno is not supported yet; if the app runs on Deno, stop and tell me.
1. Install `@prisma/composer` and `@prisma/composer-prisma-cloud`, and install `prisma` as a dev dependency. Do not pin `effect`: Composer pins it. Only if another dependency pins a different `effect` and `prisma dev` or `prisma deploy` fails with `Alchemy could not load the required peer dependency`, add the override from https://www.prisma.io/docs/composer/deploying#when-dev-or-deploy-fails-on-an-effect-version-conflict. Then install the Composer skill with `npx prisma skills sync`, and use it.
2. Declare the app in three files, as https://www.prisma.io/docs/composer/getting-started.md shows. `service.ts` declares the server as a service with `compute({ name, deps, build })`. `module.ts` is the app: its default export is built with `appRoot()` and adds the service to the app with `provision(service)`. `prisma.config.ts` has a `composer` section that names `./module.ts` as the `entry`, lists the extensions `prismaCloud()` and `nodeBuild()`, and sets `state: prismaState()`, which keeps deploy state on Prisma Compute.
- Read the port from `service.port()` and bind 0.0.0.0.
- Replace every remaining `process.env` read with a field of the service's input schema. For each credential, declare a platform secret in `module.ts` with `const key = provision(variable.secret({ name: 'API_KEY' }))`, from `@prisma/composer-prisma-cloud`, and pass it with `provision(service, { input: { apiKey: key } })`. For each value that is not a credential, declare a field in the `input` schema of `appRoot()` and pass it on as `input.NAME`; the deploy reads it from the shell every time.
- If the app talks to Postgres, choose one: to keep the database you have, declare its connection string as a platform secret under a name other than `DATABASE_URL`, which Composer reserves, such as `APP_DATABASE_URL`; to give the app a new database instead, declare `rawPostgres()` as a dependency and connect with `service.load().db.url`.
- Composer does not build. Produce one self-contained entry file per service, for example with `esbuild <server> --bundle --platform=node --format=esm --outfile=dist/server.mjs`, or use the framework's build adapter. Next.js needs the `nextjs` adapter and `output: "standalone"`.
- SvelteKit needs `@sveltejs/adapter-node` and `node({ module: import.meta.url, dir: "./build", entry: "index.js", dependencies: "external" })`, where `node` is the default export of `@prisma/composer/node`. That form ships the whole `build/` directory and the packages it imports. The adapter-node server reads the port from `PORT` itself, so do not add `service.port()` to a SvelteKit app.
3. Verify locally: run the build, then `npx prisma dev --detach`, curl each service at the URL `npx prisma dev url <app>.<service>` prints, then run `npx prisma dev stop`.
4. Confirm I am signed in with `npx prisma auth whoami`; if not, stop and ask me to run `npx prisma auth login` (it opens a browser).
5. Deploy: run the app's build script (for example `npm run build`), then `npx prisma deploy`. The deploy does not copy platform variable values from the shell or `.env` to Prisma Compute. If a service needs a variable that has no value, the first deploy creates the project, stops, and prints `prisma project env add` commands with `--role production` for that variable. Ask me for each value, or have me run those commands with `npx`, then deploy again. Verify the printed public URL with curl.
Current docs: https://www.prisma.io/docs/composer/porting-an-app.md and https://www.prisma.io/docs/prisma-compute/deploy.md.