Farm.js
farmjs.dev- Category
- Developer Tools
- Rank
- No. 1077Tools index
- Pricing
- Open Source
- Type
- TOOL
- Use case
- Coding
- GitHub
- 657 stars
- Latest release
- v0.1.65
- Date
About
Farm.js is an open-source full-stack React framework that unifies app routing, typed API routes with an auto-generated typed client, middleware, and first-party integrations (Stripe, Auth.js, Prisma, Cloudflare, and others) into one build and deployment pipeline. It ships an ahead-of-time compiler and dev server, and publishes machine-readable docs (a skill file, agent working rules, and a compact framework map) intended to keep AI coding agents working against its current API instead of guessing from stale training data.
What it does
A web application framework built on Vite that copies the Next.js App Router layout: folders of page and layout files become URLs, each folder can carry its own loading and error screens, and pages render on the server and stream to the browser. Forms can call server code directly through server actions. React is the default renderer, with beta adapters for Preact, Solid, Vue and Svelte. A command line tool runs the dev server, builds, deploys, opens preview tunnels and scaffolds starters wired to services such as Clerk, Resend or Supabase.
Why it's ranked here
The scope is real and visible in the code. One core package exports routing, caching, cron jobs, schema migrations, translations, OpenAPI output and an MCP (Model Context Protocol) server for AI agents, and the root manifest wires separate browser test suites for production builds, server components, WebAssembly and devtools. Against that, the README scopes support to a 0.1 line, the compiler and native renderer are labelled experimental, and the architecture document still lists server actions and middleware as planned when the README says both ship. A wide, MIT licensed framework at an early version: worth a trial project before a production bet.
What's good
The MCP plugin is built with care. It creates a fresh server for every request, so a tool the caller is not authorised for is neither listed nor callable. It refuses to forward credential and proxy headers such as cookies, API keys, forwarded-for and Cloudflare or Vercel headers, rejects a batch whose messages resolve to different identities, and returns validation messages to the caller while treating other exceptions as private. Release rules are written down in detail, including that a prior green commit is not evidence for later changes, and a test installs the starter generator from packed tarballs outside the workspace.
Tradeoffs
Telemetry and analytics are on unless the config switches them off, and the command line tool ships commands to report and toggle that status, so teams with data policies have to opt out deliberately. The project is young: the README frames support around 0.1, and the root manifest depends on beta and release-candidate builds of its server layer, Nitro and h3. The architecture document lags the code and opens with stray characters before its title. Node 22.13 or newer is required. The headline compiler speedups come from the project's own benchmark, not an outside one.
How to use it well
Pick it if you like the Next.js App Router model but want Vite's dev server, or want Vue, Svelte or Solid behind the same routing and server functions. Start from the browser playground or a scaffolded starter, keep the experimental compiler and native rendering off until the basics hold, and turn telemetry off in config if that matters to you. It suits products that need billing, auth or email wired in early. It is the wrong choice where a stable 1.x interface and long support windows are requirements; pin exact versions and read the stability page before each upgrade.
Technical notes+
packages/farm/src/app.ts: FarmApp normalizes config with telemetry and analytics defaulting on (config.telemetry !== false, config.analytics !== false), preset node-server, srcDir src, outDir dist; initialize() runs initStorage, configureFarmCache, i18n init and renderer init, then verifyAppStructure (throws when no app directory and no programmatic route files exist, only warns on a missing root layout), discoverRoutes, and generateClientManifest once at startup so navigation reads a precomputed hydration and island manifest. packages/farm/src/index.ts re-exports schema migrate/check/rename, cron, workflows, openapi, server-fn, server-action-security, MCP config types and a renderer abstraction (defineRenderer, REACT_RENDERER); packages/farm-react/src/server.ts is a one-line re-export of the core React renderer. packages/farm-mcp/src/index.ts: apiMcp mounts GET/POST/DELETE on one path, builds a McpServer per request filtered by farmAllowedTools, blocks forwarding via the PROTECTED_HEADER regex (authorization, cookie, x-api-key, x-forwarded-*, cf-*, x-vercel-*), requires authorize() results to share one identity across batched messages, and rejects endpoint tools that return non-JSON. packages/farm-cli/src/index.ts exports deploy, start, preview tunnel and gateway, doctor, explain, framework migration, upgrade and telemetry toggles. package.json sets engines node >=22.13.0 and pins nitro 3.0.260903-beta and h3 2.0.1-rc.32. ARCHITECTURE.md lists Server Actions and a middleware system under planned features; RELEASING.md versions the React compiler package independently of the shared release group.
Observed
- License
- MIT
- Language
- TypeScript
- Packaging
- npm packages under the @farm.js scope, built as a pnpm monorepo
- Interfaces
- Library, CLI (dev, build, deploy, preview, doctor, upgrade), MCP server plugin
- Runtime requirement
- Node.js 22.13 or newer
- Renderers
- React by default; Preact, Solid, Vue and Svelte adapters marked beta
- Telemetry
- Enabled by default; disabled by setting telemetry to false in config
- Test setup
- Node test runner scripts plus Playwright end-to-end suites declared in package.json
- Experimental features
- AOT React compiler and Strata native rendering, both labelled experimental in the README
Read from README.md, package.json, LICENSE, ARCHITECTURE.md, packages/farm/src/index.ts, packages/farm/src/app.ts, packages/farm/src/server.ts, packages/farm-cli/src/index.ts, packages/farm-react/src/server.ts, packages/farm-mcp/src/index.ts, RELEASING.md.
Tags
Tech Stack
Media
Comments (0)
No comments yet
Editorially curated, with community endorsements as a secondary signal. Corrections welcome.