Farm.js beta is building in public
00App Router / Typed APIs / One Runtime

A Framework forProduct integrated Apps

Bring the stack you already use. Farm.js connects your app router, typed APIs, middleware, integrations, docs, and deployment so they work together as one product.

Use Farm.js to build this production-ready React product app. Read the project docs first, then follow its App Router, typed APIs, server functions, middleware, integrations, environment boundaries, data loading, and deployment conventions. Preserve existing patterns, validate external input, keep secrets server-only, add focused tests, and run type checks plus a production build before finishing.
01Product stack
React 19
Vite
Nitro
Prisma
Better Auth
Stripe
01.1Development

A blazingly fast dev server

Start the whole app once, then see every page request and response time as you work.

pnpm dev
$ pnpm devFarm.js v1.0.0 ready in 84ms➜ Local:http://localhost:3000/➜ Network:http://192.168.1.24:3000/[FARM] [PAGE] [GET] /contact - 200 (8ms)[FARM] [API] [POST] /api/waitlist - 200 (5ms)[FARM] [PAGE] [GET] /docs - 200 (11ms)
01.2Typed APIs

Types from route to client

Define an API route once. Farm.js generates a client with typed inputs and responses.

GET/api/userstsx
const { data, error } = await api.users.get({  query: { limit: "5" },});if (error) throw error;data?.users[0]?.name;//   ^? string | undefined
01.3Integrations

Add product features as integrations

Bring in auth, billing, email, jobs, storage, and docs through one integration system.

farm.config.tsts
import { defineConfig } from "@farmjs/core";import { auth, billing, jobs } from "./src/lib/integrations";export default defineConfig({    extends: ["./layers/commerce"],    integrations: { auth, billing, jobs },    routeRules: { "/store/**": { swr: 300 } },    serverActions: { bodySizeLimit: "1mb" },    deploy: { target: "vercel" },});
01.4Production

Build once. Deploy together.

Farm.js packages routes, middleware, typed clients, and deployment config into one production build.

production buildbash
$ farm build --preset vercel[info] 🚜 Building Farm.js application with preset: vercel...[info] 🔍 Discovering routes and API endpoints...[info] 📦 Building client and SSR bundles in parallel...[success] ✅ Build completed in 1.24s[info] 📁 Output directory: .vercel/output
01Connected systems

Bring the tools you already use

Choose built-in integrations for auth, billing, email, jobs, storage, API keys, and UI, or connect your own.

02.1Routing

The app router you know

Build pages, layouts, API routes, loading states, and typed links in one app directory.

approute explorer
04 routesmanifest synced
02.3Documentation

Docs for people and agents

Enable docs in your app config, then serve pages, Markdown, search, and agent-ready endpoints from the same source.

farm.config.tsts
import { defineConfig } from "@farmjs/core";export default defineConfig({    docs: {        enabled: true,        entry: "/docs",        search: true,        mcp: true,    },});
02.4Layers

Share architecture, not boilerplate

Compose routes, middleware, integrations, components, and config from local or package layers. Project files always win.

ts
import { defineConfig } from "@farmjs/core";export default defineConfig({    routeRules: {        "/products/**": { swr: 300 },    },});
02.5Storage

Storage built into the runtime

Mount SQLite, Redis, S3, or any supported driver once, then reuse the storage layer across server code, middleware, rate limits, and integrations.

ts
export default defineConfig({    storage: {        mounts: {            app: sqliteStorage({ path: "./data.sqlite" }),            cache: redisStorage({ url: process.env.REDIS_URL! }),        },    },});
02.6Advanced routes

Configure the whole route in one place

Validate params, prepare request data, load the page, and run post-load work in one typed route definition.

ts
export const ProductRoute = createRoute("/products/[id]", {    params: ProductParams,    data: {        before: ({ context }) => requireUser(context.session),        main: ({ params, before }) => getProduct(params.id, before.id),        after: ({ data }) => recordView(data.id),    },    pending: ProductSkeleton,    error: ProductError,    component: ProductPage,});

One framework. The whole product.

Build routing, APIs, integrations, docs, and deployment together in one React framework.