Skip to content

Octane

Prisma.Website.Octane runs your OctaneJS project’s Vite build. Octane builds the client and SSR bundles; the shared Node target wraps the fetch handler as an HTTP program. Both outputs are uploaded as tar.gz and run on Bun in Prisma Compute, not a Docker Node container.

Install the build-time integration; the resource loads /octane and /octane/node from your project:

Terminal window
bun add -d @alchemy.run/frontend-frameworks @vercel/nft

Choose the shared Node marker adapter in octane.config.ts, not aws() or cloudflare():

octane.config.ts
import { node } from "@alchemy.run/frontend-frameworks/octane/node-adapter";
import { defineConfig, RenderRoute } from "@octanejs/vite-plugin";
export default defineConfig({
adapter: node(),
router: {
routes: [new RenderRoute({ path: "/", entry: ["App", "/src/App.tsx"] })],
},
});

A missing or foreign adapter fails the build. The adapter selects the output format; Bun is still the deployed runtime.

Put Vite plugins alongside Octane’s plugin in vite.config.ts:

vite.config.ts
import { octane } from "@octanejs/vite-plugin";
import tailwindcss from "@tailwindcss/vite";
import { defineConfig } from "vite";
export default defineConfig({
plugins: [octane(), tailwindcss()],
});
alchemy.run.ts
import * as Prisma from "alchemy/Prisma";
export const Website = Prisma.Website.Octane("Website");

rootDir defaults to ".". Omit project for a database-less project created only on live deploy, or pass a project already in your Stack.

alchemy.run.ts
import * as Alchemy from "alchemy";
import * as Effect from "effect/Effect";
export default Alchemy.Stack(
"MyOctaneSite",
{ 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 local dev URL otherwise.

export const Website = Prisma.Website.Octane("Website", {
env: {
GREETING: "Hello from Alchemy!",
API_BASE: "https://api.example.com",
},
});

Strings or Redacted values are applied before build and dev, and passed to Compute as process environment.

octane.config.ts
new ServerRoute({
path: "/api/greeting",
methods: ["GET"],
handler: async () => Response.json({
greeting: process.env.GREETING ?? "hello",
}),
});

Import ServerRoute from @octanejs/vite-plugin when adding this route. Middleware and route handlers run on Bun and read process.env.

Files in dist/client are served first without invoking the Octane handler. Requests that miss the client assets go to Octane SSR. Both paths run in Compute; static assets are not a separate CDN deployment.

bun alchemy dev starts Octane’s Vite server with its in-process SSR, server routes, RPC, and HMR. The Website creates no Prisma resources. Use .pipe(Alchemy.remote()) to opt into live deployment during dev.

const site = yield* Prisma.Website.Octane("Web", {
domain: "app.example.com",
});

Prisma.CustomDomain requires the project’s current default branch. Configure its returned DNS records yourself and verify status before cutover; see Custom domains.