Documentation
Everything you need to build with x
A fullstack framework for Bun. Static sites, server-rendered pages, API routes, and server functions — all in a single process.
Start here
Introduction
What x is, how the packages fit together, and a minimal page.
Read moreInstallation
Prerequisites, create command, templates, and manual setup.
Read moreGetting Started
Project structure, your first page, and running the dev server.
Read morePackages
@thexjs/core
Rendering engine — routing, SSR/SSG, islands, server functions, data layer.
Read more@thexjs/cli
The x command — dev, build, start, and deployment output.
Read more@thexjs/env
Type-safe environment variable validation with fail-fast errors.
Read more@thexjs/adapter-vercel
Zero-config Vercel Build Output API v3 adapter for serverless deployment.
Read moreGuides
Routing
File-based routing: static pages, dynamic segments, nested routes.
Read morePages & Loaders
Static pages, server-rendered pages, and data loading.
Read moreLayouts
Nested layouts, dedicated layout directories, and root layouts.
Read moreAPI Routes
Build REST endpoints alongside your frontend pages.
Read moreServer Functions
Call server-side functions from the browser without REST.
Read moreContent Collections
Markdown files with frontmatter that become routes.
Read moreMiddleware
Route-level middleware for auth, redirects, and validation.
Read moreData Layer
SQLite and PostgreSQL integration with migrations.
Read moreBuild & Deploy
Production builds, static export, and deployment.
Read moreConfiguration
x.config.ts reference — all options and defaults.
Read moreSecurity
Env isolation, CSRF protection, security headers, and rate limiting.
Read moreObservability
Structured logging, health probes, and APM error tracing.
Read more