Stacks.
A full-stack TypeScript framework on Bun, for frontends, backends and the clouds they run on. Think Laravel and Vapor, or Next and Vercel, wholly open source, plus more. Most of what it needed got written along the way, so by now it is an ecosystem more than a framework, and everything I build runs on it, this site included.
Try it
Stacks is in active development and usable today, on macOS, Linux and WSL. pantry installs the toolchain, then buddy creates the project:
curl -fsSL https://pantry.dev | bash
pantry bootstrap
panx @stacksjs/buddy new my-project
cd my-project && ./buddy dev
Frontend
Pages are .stx files: HTML with Blade-style directives, rendered on the server and hydrated in the browser.
-
stx
Templates with
@if,@foreach, layouts, sections and components, server-side data in<script server>, scoped styles, and signals (state,derived,effect) for what changes in the browser. -
Routing
File-based: a file in
resources/viewsis a page. Nested layouts, typed params, middleware and SPA navigation that swaps only the content. -
Composables
Around 150 auto-imported
use*composables for state, the DOM, sensors, storage, fetching and motion, plustoast,modaland stores. - Crosswind A Tailwind-compatible utility engine written in TypeScript, with no runtime dependencies. CSS is generated per page and cached.
-
Components
A UI library (dialogs, comboboxes, a command palette, tables, steppers, transitions), and
build:web-componentsto ship your own as framework-agnostic custom elements.
Data
Laravel-shaped, with one difference that matters: migrations are derived from your models. Describe the schema once and Stacks diffs it against the database.
-
Models
defineModel()holds attributes, validation, factories and relationships (has one, has many, belongs to, many to many, through) in one place. -
Traits
useApigenerates REST actions and routes,useAuthadds auth columns and passkeys,useSearchindexes into a search engine, plus UUIDs, timestamps, seeding, soft deletes, audit logs, billing, tags, categories, comments and likes. -
Migrations
buddy generate:migrationsdiffs models against the schema and writes the SQL.migrate,migrate:fresh --seed, status, ER diagrams, backups and restores. -
Query builder
A fluent, typed builder (
bun-query-builder) with joins, aggregates, eager loading, transactions and read replicas, and a fast path for simple SQLite reads. - Databases SQLite, MySQL and PostgreSQL, fully supported, with migrations generated in each dialect. SingleStore and Vitess are experimental.
Backend
Logic lives in actions, small classes a route points at by name. Anything the framework ships can be overridden by creating the same path under app/.
-
Routing and API
route.get('/products', 'Actions/ProductIndexAction'), with groups, middleware, route model binding, signed URLs, rate limits and security headers. OpenAPI specs and a typed client are generated from it. - Auth Passkeys, TOTP two-factor, magic links, password resets, API tokens with abilities, sessions, gates, policies, roles and teams. Sign in with Apple, GitHub, Google, Bluesky, Mastodon and five more.
- OAuth server A full OAuth 2 authorization server, with PKCE, consent, introspection and revocation, for when your app is the identity provider.
- Queues Jobs on the database or Redis, with batches, a dead-letter queue, a circuit breaker, idempotency, quarantine for poison jobs and progress reporting.
-
Scheduler and events
Cron-style schedules in
app/Scheduler.tswith overlap protection and timezones, and a typed event bus with wildcard listeners and model events. - Cache, storage, search Memory and Redis caching. Local and S3 storage with signed URLs. Search through Meilisearch, Algolia, Typesense or OpenSearch.
- Realtime WebSocket channels with auth, heartbeats, a replay buffer and backpressure.
-
Validation and errors
Schema validation on every model attribute, and a
Resulttype for errors that have to be handled rather than thrown.
Communication
Every way an app talks to people, behind one notification API.
- Email SES, SendGrid, Mailgun, Mailtrap or SMTP, with stx templates, CSS inlining, inbound parsing, suppression lists and one-click unsubscribe.
-
Mail server
Its own mail server: a local catcher with webmail in development (
buddy mail:dev), and the same binary in production. One parser, one Maildir, one UI, from a laptop to production. - SMS, voice, push, chat Twilio and Vonage, Amazon Connect for phone, Expo, FCM and Web Push, and Slack, Discord and Teams.
- Notifications One notification sent over email, SMS, push, chat, the database or a broadcast, with user preferences and delivery tracking. Newsletters too.
Commerce and content
Optional modules for the things most products end up needing.
- Payments Stripe charges, subscriptions, checkout, invoices, the billing portal, webhooks and Stripe Connect for marketplaces.
-
Commerce
Products and variants, carts, orders, customers, coupons, gift cards, shipping zones and rates, tax, waitlists, auctions and printed receipts.
buddy commerce:installadds it. - CMS Posts, pages, authors, categories, tags, comments, menus, revisions and redirects, with RSS and sitemaps.
- Dashboard An admin dashboard of more than a hundred views: your models, commerce, content, queues, logs, mailboxes, deployments, servers, DNS and analytics.
- And Forms, feature flags, multi-site tenancy, i18n, analytics, error tracking and log streaming.
AI
AI as a framework feature, and a framework built to be written by agents.
-
Models
Anthropic, OpenAI, Ollama, AWS Bedrock and the Claude Agent SDK behind one API:
ask,summarize, image generation and analysis, sentiment, classification and recommendations. - RAG and MCP Embeddings, a vector index, chunking and retrieval, and MCP clients over stdio and HTTP.
-
Built for agents
Ships 115 agent skills and an
AGENTS.md,buddy setup:aifor Claude Code, Codex, Cursor, Copilot and Gemini, andbuddy ai:contextfor a compact picture of the project. Models write the intent, the framework supplies the glue.
Cloud and deploy
Imagine Vercel, Vapor and Forge unified, and open source. buddy deploy takes the app from a laptop to production, infrastructure included.
- AWS Server mode on EC2 behind a load balancer, or serverless on Lambda, API Gateway, CloudFront and S3, provisioned through CloudFormation, with optional WAF, alarms, caches and a jump box.
- Hetzner Provisions a server and deploys over SSH with systemd and the rpx gateway. Several projects can share one box. Experimental, and what this site runs on.
- Your own box Any host you can SSH into, down to a Raspberry Pi on your desk, with TLS from its own CA on a LAN. Experimental.
- Operations Dry runs, rollbacks, infrastructure diffs, cache invalidation, deploy hooks, and container images built without a Docker daemon.
- Domains and DNS DNS records declared in config and synced to Route 53, Cloudflare, Porkbun or GoDaddy, plus domain purchase and WHOIS.
Beyond the web
The same codebase, built for other places.
- Desktop Native windows and system tray apps through Craft, packaged for macOS, Linux and Windows. Experimental: builds are not signed yet.
- Mobile iOS and Android through Craft, with haptics, location, the camera, sharing, secure storage, health data and Live Activities.
- Browser extensions Manifest V3 extensions for Chrome, Firefox and Safari, published to each store from the CLI.
- Libraries and CLIs Component and function libraries published to npm, and your own command-line tools compiled to a single binary.
Developer experience
Convention over configuration, while staying wholly configurable. No more boilerplate.
-
buddy
One CLI with more than 300 commands:
dev,build,deploy,migrate,test,tinker,doctor, andmake:*for every kind of file. -
Dev server
buddy devstarts the frontend, API, docs and dashboard behind pretty HTTPS URLs with locally trusted certificates.buddy shareopens a public tunnel. -
Testing
Bun's test runner with database refreshes, factories, fakes for events and mail, feature tests,
actingAsand time travel. -
Encrypted env
.envvalues encrypted with X25519 and AES-256-GCM, so production secrets can live in the repository. - Tooling Linting and formatting with pickier, git hooks, conventional commits, releases and changelogs, documentation with BunPress, and toolchains and services installed by pantry.
- Honest labels Every driver is labelled supported, partial, experimental or unsupported, and choosing an unsupported one fails loudly instead of quietly doing nothing.
The ecosystem
Stacks is assembled from libraries that each stand on their own. A few of them, and every other public repo is on projects.
- stx The UI framework and template engine.
- Crosswind A utility-first CSS engine, like Tailwind or UnoCSS.
- bun-query-builder A fast, typed SQL query builder.
- bun-router A fast, type-safe router for Bun.
- bun-queue A Redis-backed job queue built for Bun.
- ts-cloud Infrastructure as code for AWS, Hetzner and SSH hosts.
- rpx A reverse proxy for pretty local and production URLs.
- tlsx TLS certificates, automated.
- pantry A package and toolchain manager.
- pickier Linting and formatting in a fraction of a second.
- BunPress A documentation engine.
- Craft Desktop and mobile apps from web languages.
-
dtsx
Fast
.d.tsgeneration. - buddy-bot Dependency updates, like Renovate and Dependabot.