Vinext
Prisma.Website.Vinext builds with the Vinext Vite API, then hosts vinext’s production
Node server on Bun in Prisma Compute. Alchemy packages dist/, public
assets, and locally installed runtime dependencies into a tar.gz artifact.
There is no Dockerfile, registry, Wrangler configuration, or OpenNext build.
Install
Section titled “Install”Keep vinext, react, react-dom, and react-server-dom-webpack in your
application dependencies, and install vite and @vitejs/plugin-rsc for
building. Add the Alchemy integration and dependency tracer:
bun add -d @alchemy.run/frontend-frameworks @vercel/nftnpm install -D @alchemy.run/frontend-frameworks @vercel/nftpnpm add -D @alchemy.run/frontend-frameworks @vercel/nftyarn add -D @alchemy.run/frontend-frameworks @vercel/nftConfigure vinext
Section titled “Configure vinext”import { defineConfig } from "vite";import vinext from "vinext";
export default defineConfig({ plugins: [vinext({ prerender: true })],});Alchemy injects the Node data-cache adapter during deployment. No Alchemy plugin
is required in vite.config.ts. Configure deployment settings on
Prisma.Website.Vinext and leave Cloudflare plugins out of the Vite config.
Declare the Website
Section titled “Declare the Website”import * as Prisma from "alchemy/Prisma";
export const Website = Prisma.Website.Vinext("Website", { rootDir: ".",});A live deployment creates a database-less project when project is omitted.
Pass an existing project to share it with other applications.
Add it to the Stack
Section titled “Add it to the Stack”import * as Alchemy from "alchemy";import * as Effect from "effect/Effect";
export default Alchemy.Stack( "MyVinextSite", { providers: Prisma.providers(), state: Alchemy.localState() }, Effect.gen(function* () { const site = yield* Website; return { url: site.url }; }),);site.url is the Compute endpoint on deploy and the native dev-server URL locally.
The result also exposes compute, project, and domain, matching other
Prisma Website constructors.
Add environment variables
Section titled “Add environment variables”export const Website = Prisma.Website.Vinext("Website", { env: { GREETING: "Hello from vinext on Prisma!" },});env is available during build, development, and production. Server components,
route handlers, and server actions read process.env. Public framework variables
can be compiled into browser assets; keep secrets out of public keys.
Configure the data cache
Section titled “Configure the data cache”The default cache is process-local and does not survive a Compute restart or
provide cross-instance consistency. For persistent ISR and "use cache", provide
an existing Redis endpoint:
import * as Redacted from "effect/Redacted";
export const Website = Prisma.Website.Vinext("Website", { env: { REDIS_URL: Redacted.make("rediss://user:password@cache.example.com:6379"), },});The injected cache adapter uses Redis when REDIS_URL is set and memory
otherwise. Prisma.Website does not provision Redis. The same Node adapter is
used by Fly, Hetzner, and Railway.
Local development
Section titled “Local development”bun alchemy devThe Website runs vinext dev with native HMR without creating a Prisma project,
Compute service, or custom domain. Other resources declared in the Stack retain
their own provider behavior. Apply .pipe(Alchemy.remote()) to deploy the
Website to Compute during development.
Custom domains
Section titled “Custom domains”const site = yield* Prisma.Website.Vinext("Web", { domain: "app.example.com",});The app must use the project’s default branch. Configure the returned DNS records and verify domain status before routing traffic; see Custom domains.
Packaging
Section titled “Packaging”Prisma runs the uploaded artifact without installing dependencies. @vercel/nft
traces the installed application’s runtime graph. Native addons require a
Linux-compatible build environment; a macOS deployment does not cross-compile them.
Where next
Section titled “Where next”- vinext API reference.
- Runnable example.
- Websites and Compute apps.
- vinext on Cloudflare, AWS, Fly, Hetzner, and Railway.