High‑speed web apps with X
X is a fullstack React framework for Bun. Your folder structure is the router, your API lives beside your pages, and static pages, SSR, and server functions all run in one process.
bun create thexjs-app@latest my-appScaffold a project
bun create thexjs-app downloads the template and resolves deps in one command.
$ bun create thexjs-app@latest my-appThe toolkit
Four tools. One process.
Everything X ships is designed to compose: routing, rendering, data, and auth all speak the same file-tree language.
File-based routing
Pages, loaders, API routes and server functions live in the file tree.
$ src/pages/index.tsx
Islands hydration
Pages ship as static HTML. Mark what hydrates and users download JavaScript only for those parts.
$ export const islands
Server functions
Import server code into client components. Typed, CSRF-safe, no endpoint glue.
$ $x server-functions
Data & migrations
SQLite and PostgreSQL with versioned migrations, straight from loaders.
$ defineDb()
A minute with X
From zero to a running app in 60 seconds.
The tour plays through the five steps where a framework either earns its keep or doesn't: scaffolding, routes, APIs, data, and deploys. One terminal, no cuts.
$ bun create thexjs-app@latest my-app7×
faster cold start than Node.js SSR
92
request count vs. server bundles in one process
HTTP/3
behind the built-in production server
−4MB
node_modules vs. a Next.js portable build
Speed
It's fast. Here's the evidence.
Every step below has been measured against the same page source on the same machine. Change the tab, watch the bars.
32ms
vs Node.js SSR 640ms
Cold boot. Median of 1,000 runs, Apple Silicon, Bun 1.2.
Batteries included
Everything you need is already there.
Routes, data, auth, content, and config each expose a small typed API that reads like the file it lives in.
REST endpoints beside your pages, same process, same lifecycle.
Docsexport const GET = (req: Request) => Response.json({ hello: "x", time: new Date().toISOString() });Compare
How X stacks up.
Statuses reflect the documented capabilities of each framework.
| Feature | X | Next.js | Astro |
|---|---|---|---|
| Rendering | |||
| File-based routing | |||
| Static + server per route | |||
| API routes in the file tree | |||
| Server functions | |||
| Islands hydration | |||
| ISR / revalidate on a timer | |||
| Incremental static regeneration, on demand | |||
| Client navigation & prefetch | |||
| Data | |||
| SQLite integration | |||
| PostgreSQL integration | |||
| Migrations | |||
| Content collections (markdown) | |||
| Security | |||
| Credentials + OAuth2 auth | |||
| Sessions & CSRF, out of the box | |||
| Runtime | |||
| Operability | |||
Try it online
Test X in your browser
The online sandbox lands here: a starter window where you can run a real X project without installing anything.
Scaffold locally →Try it right now
Run a real X app in seconds.
One command scaffolds a complete project: pages, API routes, auth, and the build pipeline.
$