← Back to archive

Repo of the Day

farming-labs/farm.js

Published: Nov 5, 2026

Open repository ↗

a full-stack, renderer-agnostic framework with experimental AOT React compiler

Summary

Farm.js is a TypeScript full-stack framework built on Vite and Nitro, with React as its default renderer and adapters for other UI libraries. It supports typed file-based routes, React Server Components, Server Actions, streaming SSR, and agent-facing delivery: pages include server-rendered HTML, a Markdown copy, and llms.txt by default, while MCP can expose server functions as agent tools.

What it is useful for

Farm.js is useful for building web applications whose pages need to work for both people and automated agents.

  • Application routing: The src/app directory supports pages, layouts, dynamic and catch-all segments, middleware, loading states, and error boundaries. For example, a dashboard can have loading.tsx and error.tsx beside its page.tsx.
  • Server-side application code: Async Server Components can access databases, file systems, and other server-only resources directly. Mutations can live next to components using "use server" and form actions.
  • Agent integration: Server functions can become MCP tools. Farm also documents an open runtime contract, integrations for Eve and Cloudflare Agents, and ways to run AI SDK, Mastra, LangGraph, or the OpenAI Agents SDK from a plain API route.
  • Renderer flexibility: React is the default, while Preact, Solid, Vue, and Svelte adapters are documented as beta alternatives that retain the same routing and server contracts.
  • Extensibility: Plugins can intercept requests, transform rendered HTML, hook into builds and development, and expose typed API routes. The README also lists integrations for authentication, billing, databases, email, jobs, and AI services.

The experimental AOT React compiler handles eligible components by generating direct DOM updates, but falls back to normal React when eligibility cannot be established. Because Farm is still at version 0.1, engineers should consult its stability documentation before relying on a particular feature in production.

How engineers can use it

The README documents this setup for a new application:

pnpm create @farm.js/app my-app --template basic --typescript
cd my-app
pnpm dev

The development server then runs at http://localhost:3000. Templates are also available for integrations such as Auth0, Clerk, Inngest, Stripe, Supabase, Resend, WorkOS, and AI.

For an existing project, install the core package and React:

npm install @farm.js/core react react-dom

Then create farm.config.ts, a root src/app/layout.tsx, and a page such as src/app/page.tsx, and run:

npx farm dev

Engineers contributing to Farm.js itself need Node.js 22.13 or newer and pnpm 8 or newer. The documented repository workflow is:

git clone https://github.com/farming-labs/farm.js.git
cd farm.js
./scripts/setup.sh

Examples under examples/ demonstrate routing, Server Components and Actions, the experimental compiler, typed billing integration, and the non-React renderers.