# Deploy TanStack Start on forkrail

> First-class streaming SSR, Nitro v3 `scheduledTasks` crons, ISR route rules, and skew protection — forkrail’s own dashboard and website run on TanStack Start on forkrail.

- Framework: TanStack Start
- Category: Websites & full-stack
- Status: Production ready
- Adapter / Preset: nitro() Vite plugin (Nitro v3 vercel preset)
- Runtime: Node.js 24 (arm64) Web Fetch
- Detection: package.json (@tanstack/react-start)
- Memory: 1,024 MB recommended for SSR
- URL: https://www.forkrail.com/frameworks/tanstack-start

## Capabilities

| Capability | Support | Details |
| --- | --- | --- |
| Streaming SSR | Supported | Web Fetch handler with streaming HTML and server functions |
| ISR & route rules | Supported | Nitro routeRules cached by the regional router |
| Scheduled tasks | Supported | Nitro v3 scheduledTasks automatically register as crons |
| Skew protection | Supported | Enabled by default; keeps open sessions on matching assets |

## 1. Add Nitro to vite.config.ts

Include the `nitro()` plugin from `nitro/vite` alongside `tanstackStart()`. When forkrail builds your project with `VERCEL=1`, Nitro v3 outputs a Web `fetch` Build Output with immutable Vite asset caching and `context.waitUntil` support.

**vite.config.ts**

```ts
import { defineConfig } from 'vite'
import { tanstackStart } from '@tanstack/react-start/plugin/vite'
import viteReact from '@vitejs/plugin-react'
import { nitro } from 'nitro/vite'

export default defineConfig({
  plugins: [
    nitro(),
    tanstackStart(),
    viteReact(),
  ],
})
```

## 2. Deploy preview & production

**Deploy TanStack Start**

```bash
forkrail project my-start-app --memory 1024
forkrail deploy
forkrail deploy --prod
```

If your server functions talk to AWS services (DynamoDB, S3, KMS, RDS) inside the same AWS account, assign a project IAM role with `forkrail project my-start-app --role my-app-role` instead of storing long-lived AWS keys in env vars.

## 3. Nitro scheduled tasks & prebuilt deploys

- **Cron tasks:** Nitro v3 `scheduledTasks` automatically translate into forkrail schedules calling `/_vercel/cron` (authenticated with `CRON_SECRET` when configured), alongside any `crons` in `vercel.json`.
- **Prebuilt deploys:** Already ran `npm run build` in CI? Ship `.vercel/output/` directly with `forkrail deploy --prebuilt`.
- **Concurrent compute:** Up to 10 simultaneous SSR and server-function requests share one warm Lambda worker over reverse HTTP/2.

## Related documentation

- [Concurrent compute](https://www.forkrail.com/docs/concurrent-compute.md)
- [Cron schedules](https://www.forkrail.com/docs/cron-schedules.md)
- [Function regions](https://www.forkrail.com/docs/function-regions.md)
