Crate Reference

This page documents every crate in the bext workspace. Use it to find where a feature lives, what types it exposes, and how crates depend on each other. For the high-level layout and feature-flag matrix, see Architecture overview.

The workspace contains ~36 top-level crates plus ~33 reference-implementation crates under crates/bext-impls/. The default-features build links V8 + the bext-turbopack bundler; everything else is feature-gated so a minimal build stays small.

Server + core

bext-server

Main binary — actix-web HTTP server, masquerade router, vhost.

Property Value
Path crates/bext-server
Binary bext-server
Depends on bext-core, bext-license, and all optional crates via feature flags

Key modules:

Module Responsibility
handler Core request handler, SSR pipeline, compression cache, PRISM dispatch
ssr_pipeline Per-framework dispatch (PRISM, Next.js, Hono, fetch handler, RSC)
bundler Bun and bext-turbopack invocation
bun_pool Pool of Bun workers for Next.js compat path
admin Admin panel SPA + JSON API
dev Dev server (HMR bridge, error overlay, file watcher)
cli clap-based CLI (run, build, start, deploy, plugin, dx, cert)
auth_* Basic-auth and proxy auth middleware
cache_purge Tag/path invalidation API
git_deploy Push-to-deploy git hook handler
h3 HTTP/3 (QUIC) listener (feature-gated)
image_proxy_handler On-the-fly image transforms
upgrade Zero-downtime upgrade via socket passing

bext-core

Shared logic across the server, the NAPI plugin, and CLI tools.

Property Value
Path crates/bext-core
Dependencies None from bext workspace (leaf for core logic)
Key feature flags v8, plugins, redis, otel

Key modules:

Module Responsibility
transform Source-code transforms (see Transform pipeline) — includes prism_compile.rs, the build-time JSX fold pass
route Filesystem-convention route discovery
framework Framework registry + detection (Next.js, PRISM, Hono, Astro, etc.)
cache ISR cache, tenant-scoped cache, stampede guard, stale-while-revalidate
compress Brotli, gzip, zstd compression
stream Streaming SSR pipeline with chunked transfer
html_rewrite Server island replacement, preload hint extraction
image Image optimization (resize, format conversion, blur placeholders)
intern String interning for hot paths
islands / islands_first Server-island bookkeeping
js_bridge NAPI bridge for bext-plugin
flow "use flow" durable-function execution engine
rsc React Server Components payload generation
codegen Generated code for server actions and Flight payloads
seo Sitemap and robots.txt generation
auth Auth provider trait + JWT/cookie support
host_fns Host-function ABI shared with V8/QuickJS plugins
observability Tracing helpers, structured logging
og Open-graph image generation
scheduler Cron scheduler + task registration
static_router Static-asset router
storage KV-store trait + in-memory backend
worker Bun-worker FFI

bext-impls

Trait implementations that glue bext-core to optional ecosystems.

A directory of small adapter crates. Each implements a trait defined in bext-core or bext-plugin-api. The base build links none of them; features in bext-server opt into the ones you want.

Crate Trait it implements Backend
bext-auth-jwt AuthProvider RS256/ES256 JWT verifier
bext-session-cookie SessionStore Encrypted-cookie session
bext-session-redis SessionStore Redis-backed session
bext-tracer-stdout TracerProvider JSON-line tracing to stdout
bext-tracer-otlp TracerProvider OpenTelemetry OTLP exporter
bext-cron Scheduler tokio-cron-scheduler
bext-mailer-smtp Mailer SMTP via lettre
bext-mailer-ses Mailer AWS SES
bext-webhook-verifiers WebhookVerifier Stripe, GitHub, Slack, generic HMAC
bext-flags-static FlagProvider TOML feature flags
bext-flags-openfeature FlagProvider OpenFeature SDK
bext-storage-s3 Storage S3-compatible object store
bext-i18n-static I18nProvider JSON message catalog
bext-i18n-fluent I18nProvider Project Fluent (.ftl)
bext-locking-memory Lock In-process mutex
bext-locking-redis Lock Redlock
bext-locking-pg Lock Postgres advisory locks
bext-policy-cedar AuthzPolicy AWS Cedar
bext-policy-cel AuthzPolicy Common Expression Language
bext-search-meili SearchClient Meilisearch
bext-search-pg SearchClient Postgres FTS
bext-transform-py Transform PyO3 Python transforms
bext-ratelimit-lua RateLimiter Lua-scripted Redis bucket
bext-workflow-pg Workflow Scaffolded for Postgres durable workflows
bext-validate-jsonschema Validator JSON Schema
bext-validate-cue Validator CUE
bext-router-legacy Router Legacy route matcher (back-compat)
bext-tmpl-tera Template Tera
bext-tmpl-handlebars Template Handlebars
bext-tmpl-liquid Template Liquid
bext-pay-stripe Payments Stripe
bext-pay-lemonsqueezy Payments Lemon Squeezy
bext-experiment-hash Experiment Hash-bucket A/B

These are deliberately tiny. Pick the ones you need; nothing else links in.

bext-license

Offline Ed25519 license key validation.

Property Value
Path crates/bext-license
Always linked Yes

Key types: LicensePayload, Tier (Community / Pro / Enterprise), Feature, validate_key(). 14-day grace period after expiry before falling back to Community tier.

bext-keygen

License key generation utility (binary).

Property Value
Path crates/bext-keygen
Binary bext-keygen

Internal tool. Signs LicensePayload blobs with the Ed25519 private key.

PRISM / framework pipeline

bext-turbopack

Direct API around utoo / Turbopack — JSX/TSX → JS bundle.

Property Value
Path crates/bext-turbopack
Activated by bext-server turbopack feature (default-on)

Owns the PRISM compile pass call sites. Two hooks call into bext-core::transform::prism_compile:

- compile_closure — entry source on first-request compile

  • transform_with_analysis_opts — every transitive import traversed by the bundler

Modules: direct (compile entry points + transform integration), prism (PRISM-specific bundle setup, byte-equivalence test scaffolding), registry (compiled-route cache), walker (transitive-closure walker), watch (file watcher invalidating the registry on save).

bext-v8

rusty_v8 SSR isolate.

Property Value
Path crates/bext-v8
Activated by bext-server v8 feature (default-on)

Modules: eval (eval thread + page-context cache, used by both PRISM SSR and Next.js compat), pump (streaming-render pump from V8 to the HTTP response), pool (per-tenant isolate pool with idle eviction), atomize (string interning helpers).

The same isolate runtime is reused by bext-plugin-v8 for plugin sandboxing. See V8 plugins.

bext-react-compiler

SWC + React Compiler integration.

Property Value
Path crates/bext-react-compiler
Activated by bext-server react-compiler feature (default-on)

Auto-memoization (React Compiler) for client islands and pure-function lowering for SSR-only code paths. Runs as part of the bundler's source transforms when the React Compiler is enabled in bext.config.toml.

bext-css

Rust-native Tailwind v4 engine.

Property Value
Path crates/bext-css
Activated by bext-server route-css feature (default-on)

Utility scanner (walks PRISM/JSX sources, extracts class names) and JIT class generator. Output is route-scoped CSS extracted at build time and served from the asset cache. No tailwindcss Node binary needed.

bext-import

AST-aware "use server" / "use client" / "use cache" directive scanner.

Property Value
Path crates/bext-import

Used by the bundler to discover boundaries before splitting the graph for client/server bundles. Powers the [framework] type = "nextjs" RSC compile path and PRISM islands.

bext-proxy

Reverse-proxy subsystem.

Property Value
Path crates/bext-proxy
Always linked Yes

Upstream pools, load balancing, circuit breakers, retries, gRPC proxying, WebSocket proxying. Extracted from bext-server in 2026-04 to cut incremental rebuild time.

Plugins

bext-plugin-api

Trait definitions and shared types. Deliberately lightweight.

Property Value
Path crates/bext-plugin-api
Dependencies serde, serde_json (no bext crates)

Public types:

Type Description
LifecyclePlugin Server start/stop/cache/reload hooks
MiddlewarePlugin Request/response interception
TransformPlugin Source-code transform
CacheBackend Custom cache storage
PluginManifest Plugin identity and capabilities
PluginCapability Enum: Transform, Middleware, CacheBackend, Lifecycle
SandboxType Enum: Wasm, V8, QuickJs, Lua, Nsjail
SandboxPermissions URL allowlists, storage quotas, memory/time limits

WASM guest crates can depend on this without dragging in actix-web, V8, or anything else heavy.

bext-plugin

NAPI addon for Bun (native plugin mode).

Property Value
Path crates/bext-plugin

Used when bext is invoked as a Node/Bun-native module (the legacy "plugin" build) instead of as a standalone server. Exposes apply_source_transforms and the SSR pool over NAPI.

bext-plugin-wasm

wasmtime sandbox for WASM lifecycle plugins.

Property Value
Path crates/bext-plugin-wasm
Activated by bext-server plugins feature

Modules: adapter (trait bridge), host_functions (host imports), kv (scoped storage), queue (message queue), runtime (wasmtime instance management), sandbox (rate limiting, quota enforcement, URL allowlisting).

bext-plugin-v8

V8 isolate sandbox for plugin JS.

Property Value
Path crates/bext-plugin-v8
Activated by bext-server plugins feature

First-class plugin tier sharing the same V8 engine the SSR pipeline uses (so no extra runtime to ship). Pinned-thread-per-isolate threading model, fuel-via-watchdog preemption, JSON-over-host-functions ABI. See V8 plugins.

bext-plugin-quickjs

QuickJS interpreter sandbox.

Property Value
Path crates/bext-plugin-quickjs
Depends on bext-plugin-api, rquickjs
Activated by bext-server plugins feature

Optimized for tiny footprint and deterministic interpretation. Modules: api (JS global registration — console, bext.storage, bext.fetch, bext.config, bext.metric), runtime (QuickJS runtime with memory limits, stack limits, and interrupt-based timeout enforcement).

bext-plugin-lua

Lua 5.4 plugin runtime.

Property Value
Path crates/bext-plugin-lua
Depends on bext-plugin-api, mlua
Activated by bext-server plugins feature

For middleware authors who prefer Lua. Sandboxed via mlua's safe-mode and a host-function table similar to the V8 binding.

bext-plugin-nsjail

Process-level sandbox with JSON-over-stdio IPC.

Property Value
Path crates/bext-plugin-nsjail
Depends on bext-plugin-api
Activated by bext-server plugins feature

Modules: config (interpreter detection from shebang/extension), ipc (JSON line protocol with 10 MB max line length), runtime (child process management), sandbox (Linux namespace setup when available).

Networking + protocols

bext-tls

Automatic TLS certificate provisioning and management.

Property Value
Path crates/bext-tls
Activated by bext-server tls feature

Key types: AcmeClient (Let's Encrypt / ZeroSSL), SniCertResolver (multi-domain SNI), OcspStapler (background OCSP stapling), RenewalManager (automatic renewal), CertStore (SQLite-backed storage), OnDemandProvisioner (provision on first request), MtlsConfig (mutual TLS client certs).

bext-realtime

SSE and WebSocket pub/sub hub.

Property Value
Path crates/bext-realtime
Feature flags redis (cross-instance relay)
Activated by bext-server realtime feature

Key types: BextHub (central broker), TopicAuth (per-topic authorization rules), SseStream, WsSession, RedisRelay (requires redis feature).

bext-waf

Web Application Firewall.

Property Value
Path crates/bext-waf
Activated by bext-server waf feature

Key types: WafDecision (Allow / Block / RateLimit / Challenge), WafRequest, RuleEngine (SQLi/XSS/traversal detection), IpFilter (CIDR lists), GeoBlocker, BotDetector, DdosGuard, EnhancedRateLimiter, WafAuditLog.

bext-ebpf

eBPF kernel-level acceleration.

Property Value
Path crates/bext-ebpf
Platform Linux only (no-ops on other platforms)
Activated by bext-server ebpf feature

Modules: xdp (packet filtering), tracing_probes (request waterfall uprobes), tcp (connection intelligence via sock_ops), seccomp (syscall allowlisting for plugin sandboxes), capability (Linux capability detection).

bext-php

Embedded PHP SAPI for in-process PHP execution.

Property Value
Path crates/bext-php
Requires PHP 8.2+ with --enable-embed --enable-zts
Activated by bext-server php feature

Key types: PhpPool (thread pool of PHP workers), PhpState (top-level handle for AppState).

bext-protocol-mqtt

MQTT 5 gateway broker.

Property Value
Path crates/bext-protocol-mqtt
Activated by bext-server protocol-mqtt feature

Topic routing, QoS 0/1/2, persistent sessions, retained messages. Bridges to bext-realtime so SSE/WebSocket clients can subscribe to the same topic namespace.

bext-protocol-grpc

First-party gRPC support.

Property Value
Path crates/bext-protocol-grpc
Activated by bext-server protocol-grpc feature

tonic-based service registry, codec handling, gRPC-Web transcoding so browsers can call into the same services without a proxy layer.

bext-protocol-caldav

CalDAV / CardDAV protocol support.

Property Value
Path crates/bext-protocol-caldav
Activated by bext-server protocol-caldav feature

WebDAV methods, iCalendar, vCard. Useful for CRM/calendar surfaces.

nginx compat

bext-nginx-compat

nginx.conf parser and converter.

Property Value
Path crates/bext-nginx-compat
Activated by bext-server nginx-compat feature

Modules: lexer, ast (nginx config AST), convert (AST → bext config), detect (auto-detection of nginx.conf on disk). Powers "masquerade mode" where bext drops in for nginx with zero config changes on the operator side.

bext-nginx-shim

Drop-in nginx binary replacement.

Property Value
Path crates/bext-nginx-shim
Binary nginx (when symlinked)
Activated by bext-server nginx-compat feature

Mimics the nginx command-line interface: PID file, SIGHUP reload, systemd override generation. Lets bext sit behind existing systemctl reload nginx workflows.

Framework adapters

Each adapter implements the FrameworkAdapter trait from bext-core. Detection looks at package.json / config files; build shells out to the framework's own CLI; serve runs the produced output through bext SSR or as a static-asset bundle.

Crate Path Detects
bext-framework-astro crates/bext-framework-astro astro.config.{js,ts,mjs}
bext-framework-qwik crates/bext-framework-qwik Qwik City project
bext-framework-solidstart crates/bext-framework-solidstart SolidStart project
bext-framework-sveltekit crates/bext-framework-sveltekit SvelteKit project

PRISM is not a framework adapter — it's owned by bext-core (the compile pass) and bext-turbopack (the call sites). Next.js and Hono are handled inline in bext-server's SSR pipeline rather than via a crate adapter.

Tooling / DX

bext-dx

Developer-experience engine.

Property Value
Path crates/bext-dx

TOML format/lint, plugin/infra/route graph, env provenance, secret store. Shared by the bext CLI and bext-lsp.

bext-lsp

Language server for bext.config.toml.

Property Value
Path crates/bext-lsp

Reuses bext-dx rules so VS Code, Zed, nvim and Helix all share one diagnostic engine. Completions, hovers, "go to plugin definition".

bext-tui

Terminal management dashboard.

Property Value
Path crates/bext-tui

Ratatui-based live-deploy / log-streaming UI. Useful for headless servers where you want to watch a deploy from a TTY.

bext-bench-history

Performance history store.

Property Value
Path crates/bext-bench-history

SQLite-backed perf-history database used by the benchmark dashboard and CI regression detector. Stores per-commit benchmark numbers (SSR µs/req, TTFB, bundle size, etc.) so regressions get caught before they ship.

Test harnesses

Live under harnesses/ (most are also workspace members so they share build artifacts):

Harness Path What it covers
conformance harnesses/conformance Next.js conformance test suite + HTTP spec
ecosystem harnesses/ecosystem Integration tests for all 6 framework adapters
security harnesses/security Fuzzing, penetration testing, sandbox escape
jsx-shootout harnesses/jsx-shootout 5-engine SSR throughput bench (PRISM, Marko, Solid, React, Rust)
plugin-harness harnesses/plugin-harness Plugin sandbox conformance tests
cache-bench harnesses/cache-bench ISR cache benchmark
ssr-dev harnesses/ssr-dev PRISM SSR dev-server harness against ~/dev/apps/app
sites harnesses/sites Self-contained PRISM fixture sites used by integration tests
bun harnesses/bun Bun-runtime compatibility harness
t3 harnesses/t3 T3 stack (Next.js + tRPC + Prisma) integration
nginx-compat harnesses/nginx-compat nginx.conf import test corpus
browser harnesses/browser Headless-browser end-to-end tests
companion harnesses/companion Smoke tests for the desktop companion app
ssr-examples harnesses/ssr-examples Reference SSR scenarios for documentation

Binary crates

Crate Path Description
bext-server crates/bext-server Main server binary
bext-keygen crates/bext-keygen License key generation tool (internal)
bext-nginx-shim crates/bext-nginx-shim Drop-in nginx binary replacement

Feature flag combinations

# Community (free) — minimal build, ~45s cold compile
cargo build --release -p bext-server --no-default-features

# Default — V8 + Turbopack + route-css + react-compiler
cargo build --release -p bext-server

# Pro — security + performance features
cargo build --release -p bext-server \
  --features "waf,h3-quic,redis,otel,plugins,nginx-compat,realtime,websocket-proxy"

# Enterprise — everything
cargo build --release -p bext-server --all-features

# Custom — pick what you need
cargo build --release -p bext-server --features "waf,redis,plugins"

A minimal build takes ~45 seconds on an M2 MacBook Pro. The full production build with v8 + turbopack + route-css + react-compiler + nginx-compat + tls + redis + realtime + waf + php + h3-quic takes ~5 minutes cold and ~30 seconds warm. See Architecture overview for the full feature-flag table.