Skip to content

TanStackStart

Source: src/Railway/Website/TanStackStart.ts

Deploy a TanStack Start application to Railway: the SSR server plus client assets on one Railway.Service.

The build runs through @alchemy.run/frontend-frameworks/tanstack-start with the @alchemy.run/frontend-frameworks/tanstack-start/node deploy target — both must be installed in your project, alongside @tanstack/react-start (or @tanstack/solid-start) and vite.

Your vite.config.ts needs no adapter wiring: TanStack Start is pure Vite, so the integration drives the project’s own vite build, forces the SSR bundle to be self-contained, and wraps its fetch handler as a Node HTTP server on port 3000.

During alchemy dev the site is TanStack Start’s own Vite dev server and no cloud resources are created. Alchemy.remote() opts back into the live Service path.

Basic TanStack Start App

const site = yield* Railway.Website.TanStackStart("Web", {
rootDir: "./app",
});

Custom Domain

const site = yield* Railway.Website.TanStackStart("Web", {
rootDir: "./app",
domain: "app.example.com",
});

Process Environment

const site = yield* Railway.Website.TanStackStart("Web", {
rootDir: "./app",
env: {
GREETING: "Hello from TanStack Start on Railway!",
},
});

Read An Environment Variable From A Server Function

src/routes/index.tsx
const getApiBase = createServerFn({ method: "GET" }).handler(() => ({
apiBase: process.env.API_BASE,
}));