The Local-First React Framework. Zero Latency. Explicit boundaries. Built on an embedded database.
Warning
RebaseJS is under active development and not yet production-ready. APIs may change before v1.0. Feel free to explore, contribute, or star the repo.
RebaseJS is an open-source, full-stack React framework that eliminates network latency and loading spinners. By embedding a database directly inside the browser via WebAssembly and synchronizing state in the background, RebaseJS allows you to build real-time, offline-capable applications that respond instantly to user interactions.
Powered by a blazing-fast Rust compiler (oxc) that enforces strict server/client boundaries at build time, RebaseJS gives you the speed of a local-first architecture with the security and SEO benefits of traditional server-side rendering (SSR).
Modern web development has a hidden tax: network latency and state management.
Developers spend an immense amount of time building loading spinners, writing complex optimistic UI updates, managing fragile client-side caches, and dealing with offline edge cases. Every interaction suffers from network round-trips.
RebaseJS exists because the network should not block the user interface.
Instead of fetching data from a distant server, RebaseJS apps query a local replica of the database running directly in the browser. Reads are instantaneous (0ms). Writes are applied locally immediately, stored in an outbox queue, and synchronized with the server in the background using our high-performance Rust sync engine.
You write standard data queries. The framework handles the data synchronization, offline queuing, conflict resolution, and real-time multiplayer updates.
RebaseJS doesn't aim to compete with established frameworks on feature count alone. Instead, it competes on paradigm.
We believe that fetching data is an anti-pattern for interactive applications. Instead of pulling data on every route change, RebaseJS synchronizes data seamlessly in the background. Your UI renders instantly from local state.
Most frameworks give you tools to build optimistic updates. RebaseJS makes manual optimistic updates obsolete. Because the database is local, your mutations execute immediately. No loading spinners required.
In Rebase, clarity is a feature. We avoid "invisible magic" that makes debugging a nightmare. Server-only code lives in .server.ts files, enforced strictly by the Rust compiler at build time. There is no guessing which code runs where.
RebaseJS is built on web standards and powered by a Rust compiler (oxc) that is 50-100x faster than legacy tools. Production-grade defaults—like streaming SSR, image optimization, and security headers—are active from the first byte.
We believe that a "great DX" isn't just about hot-reloading (though we're fast at that too). It's about a framework that catches your mistakes before they reach the user.
- End-to-End Type Safety: Types flow from your
defineServerFndirectly into your React components without manual sync. - Compiler-Enforced Safety: The Rust compiler validates your architecture as you build, turning runtime "surprises" into build-time "to-dos".
State management fatigue. Most React setups require complex client-side caching libraries (React Query, Apollo, Redux) to manage server state. RebaseJS treats the local database as the ultimate store of state, eliminating the need for complex fetching logic.
Network bottlenecks. Loading spinners degrade the user experience. RebaseJS makes reads instantaneous (0ms) by querying the embedded local replica, ensuring interactions feel native.
Unclear server/client boundaries. Magic directives create invisible walls in your component tree. RebaseJS uses explicit file naming — .server.ts — enforced by the Rust compiler at build time. Cross the boundary and you get a clear error before anything ships.
Deployment lock-in. Building on a framework should not mean committing to a specific cloud provider. RebaseJS runs on any Node.js host, Cloudflare Workers, or Deno Deploy — the server is a plain H3 HTTP handler you own entirely.
Slow builds at scale. RebaseJS uses an oxc-based Rust compiler — the same technology powering Vite 8's Rolldown. Compilation is 50–100× faster than Webpack-era tools.
- Rust compiler (oxc) — 50–100× faster than Webpack, open source, extensible
- File-system router —
app/directory, nested layouts, dynamic segments - Streaming SSR —
renderToPipeableStream, real HTML in the first byte, no blank pages - CSR by default, SSR opt-in —
export const ssr = trueon any page - Auto layout composition —
layout.tsxfiles nest automatically, root to leaf - SPA client navigation —
<Link>swaps content without a full page reload, prefetches on hover - Error boundaries —
error.tsxfiles catch render errors per-route with retry support - Loading UI —
loading.tsxfiles render Suspense fallbacks while data loads - Not-found page —
not-found.tsxhandles unmatched routes with HTTP 404
- Server functions —
defineServerFnruns only on the server; the Rust compiler enforces the boundary useServerData— Suspense-powered data fetching, full type inference from the server functionuseMutation— async state machine (idle → pending → success / error / invalid) with optimistic updates- Explicit caching —
{ cache: { ttl, tags } }on any server function; nothing cached without your say-so - Zod validation —
defineServerFn(schema, handler)validates input and returns HTTP 422 with structured errors - ISR —
export const revalidate = 60caches rendered HTML with stale-while-revalidate background regeneration - API routes —
route.tsexportsGET,POST,PUT,PATCH,DELETEas standardRequest → Responsehandlers - Server-Sent Events —
defineSSEHandlerstreams live updates;useSSEsubscribes on the client
- Static metadata —
export const metadatasets title, description, OG tags, Twitter Card - Dynamic metadata —
export async function generateMetadata(params)for per-route values generateStaticParams— pre-render dynamic routes at build time with explicit param lists- Auto sitemap —
/sitemap.xmlgenerated from the route manifest automatically
- Tailwind CSS v4 — zero-config, no PostCSS setup, auto-detects classes in source files
<Image>— Rust WebP conversion,srcset, blur-up placeholder, lazy loading by default<Link>— SPA navigation, hover prefetch,history.pushState<Script>— third-party script loading withbeforeInteractive | afterInteractive | lazyOnload<Font>— Google Fonts with preconnect andfont-display: swap<ErrorBoundary>— client-side error boundary with custom fallback prop
- File-system router — automatic, convention-based, zero config
- Code-based router — opt-in typed router (
createRoute,createRouter,RouteLink) with inferred param and search types - i18n routing —
createI18nConfig, URL prefix detection,LocaleProvider,useLocale,LocaleLink - Middleware —
middleware.tsat project root withredirect()andnext()helpers, path matchers
- Security headers —
X-Content-Type-Options,X-Frame-Options,Referrer-Policyon every response - CSRF protection — Double Submit Cookie pattern, completely transparent
- Server boundary enforcement — Rust compiler rejects any import of
.server.tsin a client context
- Dev boundary overlay —
Alt+Shift+Bshows SSR/CSR status, route file, layout chain, cache status - Error overlay — Rust compiler errors mapped to exact source lines in the browser
- Build-time type checking —
tsc --noEmitruns in parallel with the Vite 8 build - Bundle analyzer —
rebase build --analyzeopens an interactive Rolldown treemap - Zero-config testing —
rebase testwith Vitest;@rebase-js/core/testexportsrenderPageandrenderComponenthelpers
- Node.js / Docker —
rebase startruns the H3 production server - Cloudflare Workers —
@rebase-js/core/adapters/cloudflare - Deno Deploy —
@rebase-js/core/adapters/deno - Web standard —
@rebase-js/core/adapters/webfor any fetch-based runtime - SPA mode —
rebase build --mode spafor CDN-deployable client-only builds - Static site generation —
rebase ssgpre-renders static routes to HTML files
- Zero-Latency UI — Client-side database replica executes queries locally in 0ms. No loading spinners.
- Batched Webhook Sync — Built-in
WebhookSyncAdapterbatches operations and compacts them in the background, pushing a single JSON payload to your server. - Server Authority — Background worker automatically retries on failure (exponential backoff) and manages your local
_outbox. - Offline Mode — Mutations instantly update the local UI and queue into IndexedDB, replaying when the network returns.
RebaseJS encourages a modular directory structure for scalability, though you are free to organize your files however you see fit:
my-app/
├── app/
│ ├── models/ # Data Models (e.g. user.model.ts)
│ │ └── index.ts # Aggregates schemas into defineSchema()
│ ├── sync/ # Sync Rules (e.g. todo.sync.ts)
│ │ └── index.ts # Aggregates rules into defineSyncRules()
│ ├── (routes)/ # Standard React UI Routes
│ │ ├── layout.tsx
│ │ └── page.tsx
signal(initial)— observable value, defined at module scope, no React tree requireduseSignal(sig)— subscribe and write; only the reading component re-renderscomputed(sources, derive)— derived signal, auto-updates when any source changes
TypeScript-only by design. Every file is TypeScript. Server function return types flow directly into client components — no manual annotation, no guesswork. The Rust compiler depends on it, and so does end-to-end type safety.
Explicit over magic. Caching is opt-in. SSR is opt-in. Server functions have explicit file names. Nothing happens behind your back. When something goes wrong, you know exactly where to look.
Deployable anywhere. The production server is a plain H3 handler. Any runtime that speaks HTTP can run it. No proprietary infrastructure required.
Open compiler. oxc is open source, documented, and extensible. The Rust compilation pipeline is inspectable via rebase info. You can write your own transforms.
95+ Lighthouse by default. SSR, code splitting, image optimization, and security headers are all active from the first line. You would have to actively disable features to score lower.
Grows with you. Start with the file-system router and server functions. Add the code-based router when the project scales. Add @rebase-js/sync for offline-first. Every capability is additive — the simple baseline never changes.
| Layer | Technology |
|---|---|
| Compiler | oxc (Rust, open source) via napi-rs |
| Bundler | Vite 8 + Rolldown (Rust-native) |
| HTTP server | H3 (Node, Cloudflare Workers, Deno) |
| React | React 19 (streaming SSR, use(), concurrent mode) |
| Styles | Tailwind CSS v4 (zero-config) |
| Testing | Vitest (jsdom + node environments) |
| Package manager | pnpm workspaces |
npx create-rebasejs@latest my-app
cd my-app
pnpm devFull documentation lives in the docs/ folder.
All contributions welcome — docs, bug fixes, new features, and examples. See CONTRIBUTING.md to get started.
MIT — free forever.