Alloy

React over Rust-owned typed contracts

Shipping a fast React product usually forces an awkward compromise: to get shared types, server-side data loading, and atomic mutations, teams run React inside a general-purpose Node server and inherit its dependency sprawl, server-component vulnerabilities, and cache plumbing. Alloy separates the two roles. React renders at build time and in the browser with ordinary Vite and React 19, while a constrained Rust server half owns routing, data loaders, replay-safe actions, tag-epoch caching, and document assembly.

Coding agents build screens with the React tools they already know, add sign-in, payments, email, and AI as Ferrite packages, and deploy one unified application the same day. Teams with an existing Next.js App Router codebase bring their React components over unchanged.

An Alloy accounting product showing a balanced ledger, accounts, and attributed sign-in.
Alloy keeps the customer interface and the durable ledger in agreement.

One project, two halves, one contract

Agent-written web applications break most often at the seam between backend payloads and frontend components. Alloy prevents that drift by generating the client boundary straight from the server definition. Routes, loaders, and mutations are declared once in Rust, and alloy-gen emits matching TypeScript types, client loaders, and typed mutation hooks directly into the project.

When an engineer or coding agent renames a field, changes a return shape, or tightens validation on the server, TypeScript flags every affected React component before the build passes. The generated client code is committed, readable source, so reviewers and agents inspect contract changes alongside the screen edits that follow them. On the server side, Alloy mounts as a source package under Ferrite's single-dependency rule, running solely on injected storage and queue handles with no host filesystem, no shell, and no open network.

Fast documents without a React server

Running React on a server exposes a full JavaScript runtime to untrusted requests, creating an attack surface where a single flaw in React Server Components left roughly 77,000 addresses vulnerable and breached more than thirty organisations. No JavaScript runs on an Alloy server; React executes at build time and in the browser.

At request time, the Rust handler assembles the response from a build-time HTML shell and injects route metadata and script-escaped loader payloads directly into the document. Static routes arrive as complete HTML that reads with or without JavaScript. Interactive Hybrid routes open from a prerendered document seeded with live loader data, then React hydrates in the browser so subsequent route transitions fetch compact JSON payloads and respond immediately. Every enforcement layer beneath that boundary is documented on the security page.

Tag-epoch caching and safe mutations

Interactive storefronts and collaborative tools fail in two predictable ways under concurrency: stale caches display contradictory state across views, and retried requests place duplicate orders, so Alloy builds tag-epoch invalidation and replay-safe actions directly into the framework.

Loader output is cached across a bounded in-process memory layer and durable store, governed by explicit freshness windows, stale-while-revalidate serving, and single-flight leases that prevent refresh stampedes. Instead of scanning cache entries after a write, each cached response carries tag witnesses captured before its loader ran. When a mutation commits, advancing the touched tag epochs atomically in one guarded operation invalidates every product page, category listing, and cart view that depends on that state.

Mutations follow the same rule. Each Alloy action commits its durable change together with an admission marker and its recorded reply inside one guarded envelope, while queuing follow-up work such as confirmation emails through an outbox. If a timeout on a mobile connection retries a checkout request, the server returns the original recorded answer instead of placing a second order or sending a second receipt.

Bring a Next.js App Router codebase

Moving an existing React product to Ferrite does not require rebuilding its interface. Alloy's Next.js adapter maps next/link, next/navigation, next/cache, next/headers, and error boundaries onto Alloy's client router and query cache, so copied App Router component trees, hooks, and providers run unchanged on Vite and React 19. Only server-only queries and 'use server' actions move into Rust loaders and actions, re-exported under their original TypeScript module paths so component imports stay untouched.

Four well-known Next.js applications run live on Ferrite with their original React components intact: Acme Store, Vercel's Next.js Commerce storefront; Beats, a music player that keeps playing across route changes; NextBooks, a catalogue searching more than a million books; and Drop, a social feed with optimistic posts and likes. If you are moving an existing Next.js product, the Ferrite team works directly with you through the first routes.

One backend for people and assistants

Customers increasingly ask AI assistants to check stock, compare options, and complete bookings on their behalf. Maintaining a separate API beside the web backend doubles the maintenance work and lets business rules drift apart.

Because Alloy already concentrates routing, validation, and replay-safe mutations in Rust, adding the agent-ready package publishes those exact operations for assistants alongside llms.txt, Markdown pages, an OpenAPI catalogue, and an MCP endpoint. An order submitted by a customer's assistant runs through the same stock checks, sign-in gates, and deduplication markers as a click in the React storefront.

Choosing between Alloy and Rsx

Ferrite includes two native web frameworks because different products carry different client requirements. Choose Alloy when the interface centres on interactive React state, optimistic editing, complex client workflows, or an existing React and Next.js component library. Choose Rsx when the product is primarily structured content, documentation, catalogues, or dashboards best authored as compiled HTML templates with light JavaScript islands and live regions.

Both frameworks compile to constrained Ferrite applications, compose the same packages for sign-in, payments, and email, and deploy under identical security and billing boundaries.

From local check to live release

Alloy gives engineers and coding agents fast local verification. Local tests run loaders, actions, and cache invalidation against the same storage and queue interfaces used in production, while ferrite check validates the single-dependency containment boundary before a hosted build starts.

When customers request a change, your coding agent tests it on a private copy of the application with real records, ships it once approved, and rolls back to a prior release in a single request if anything misbehaves. Sign-in, Stripe checkout, email delivery, and AI model calls compose into the same Rust server half, keeping all product infrastructure inside one deployment.