Features

Everything you need to build for the web

x combines static generation, server rendering, APIs, and server functions in a single Bun process — with zero configuration.

One process, everything included

Static sites, SSR, API routes, and server functions all run in a single Bun process. No microservices, no orchestration, no separate API server.

File-based routing

Your file tree is your route tree. Drop a page in src/pages/ and it's immediately available. Dynamic segments, nested routes, and catch-all 404s come for free.

Static + dynamic hybrid

Pick the right rendering mode per route. Use mode='static' for prerendered marketing pages, and server mode for personalized dashboards — all in the same project.

API routes built in

Build REST endpoints alongside your frontend. Shared types, same process, zero config. Middleware support for auth, validation, and logging.

Server functions

Call server-side functions from the browser without writing REST endpoints. Just export async functions from src/actions/ and call them via fetch.

Type safe end to end

TypeScript from loader to component. LoaderData is typed through RouteProps, params are inferred from file paths, and server functions are fully typed.

Production security

Build-time env isolation prevents secret leaks into client bundles. CSRF protection on server actions. Security headers (CSP, HSTS, X-Frame-Options) on every response. In-memory rate limiting — all on by default.

Observability

Structured JSON logging, /healthz and /readyz probes for containers, and pluggable APM error tracing (Sentry + OpenTelemetry). Production-ready out of the box.

Content collections

Write markdown files with frontmatter and x turns them into pages. Built-in rendering with code highlighting, slug generation, and frontmatter parsing.

Live reload

See changes instantly. The dev server watches pages, layouts, API routes, and actions. No manual restarts, no build step during development.

Optimized production builds

One command produces static HTML, a server bundle, and a build manifest. Deploy anywhere Bun runs — Fly.io, Railway, Docker, or a VPS.

Islands architecture

Interactive client components hydrate in place. The rest of the page is static HTML. Minimal JavaScript, maximum performance.

Database integration

Built-in SQLite and PostgreSQL support with migrations. Query databases directly from loaders and server functions with prepared statements.

Open source

MIT licensed. Contributions welcome. Built for Bun with modern JavaScript in mind. No lock-in, no proprietary formats.

Ready to build with x?

One command, one process, everything you need.