Lunora is a type-safe, real-time backend framework on Cloudflare Workers and Durable Objects with a Vite-first developer experience. Define a schema and write query, mutation, and action functions on the server; the client gets end-to-end typed data with live subscriptions, optimistic updates, and an offline queue — types sync from server to client automatically via codegen.

The realtime backend for Cloudflare

Realtime backends, in a few lines of code.

Define a schema, write a function — Lunora gives you a typed, live-syncing API on Cloudflare's edge. No glue code, no infrastructure to manage.

1import { mutation, query, v } from 'lunorash/server';
2
3export const list = query.query(
4 async ({ ctx }) => ctx.db.query('todos').collect(),
5);
6
7export const add = mutation
8 .input({ text: v.string() })
9 .mutation(async ({ ctx, args }) =>
10 ctx.db.insert('todos', { ...args, done: false }),
11 );
12
13export const toggle = mutation
14 .input({ id: v.id('todos'), done: v.boolean() })
15 .mutation(async ({ ctx, args }) =>
16 ctx.db.patch(args.id, { done: args.done }),
17 );
app · todoslive
studio · todos3 docs
#_id id_creationTime numbertext stringdone boolean
1k00044zn06/01 00:00:00"Ship the launch post"false
2k000568i06/01 01:00:00"Review the pull request"true
3k00067hd06/01 02:00:00"Walk the dog"false
Works with your stack
ReactVueSvelteSolidAstroTanStackNuxtAnalogon Cloudflare
Features

Everything you need to ship realtime

Realtime, storage, types, and a studio — typed and edge-native by default.

Everything is code

Schema, queries, and mutations in pure TypeScript — codegen keeps server and client in lockstep.

lunora/schema.ts
export default defineSchema({
todos: defineTable({
text: v.string(),
done: v.boolean(),
}),
});

Realtime by default

Queries are subscriptions. Every mutation pushes live updates to all clients — with optimistic writes and an offline queue.

Todos.tsx
// subscribes once, re-renders on every change
const todos = useQuery(api.todos.list);
const add = useMutation(api.todos.add);

Edge-native & sharded

State lives in SQLite-backed Durable Objects at the edge. Shard by key, or go global to replicate reads across regions.

lunora/schema.ts
export const messages = defineTable({
roomId: v.string(),
body: v.string(),
}).shardBy('roomId');

Studio included

A local admin UI for schema, data, SQL, logs, and time-travel ships with every app — running against your live edge database.

Studio included — Lunora Studio

End-to-end typed

Types flow from server functions to the client via codegen. Rename a field and the client stops compiling.

_generated/dataModel.ts
export type Todo = {
_id: Id<'todos'>;
text: string;
done: boolean;
};

Rewind your data

Every shard is a SQLite database you can rewind — restore to any moment in the last 30 days, with no extra infrastructure.

Rewind your data — Lunora Studio
Batteries included

Everything a real app needs

Opt-in packages for auth, payments, email, AI, storage, and jobs — typed onto your ctx, deployed to your own Cloudflare account.

Auth

A customizable auth system built on Better Auth — D1-backed, or bring your own store.

  • Email & password
  • Social login (OAuth)
  • Magic links
  • 2FA & passkeys
  • Organizations & RBAC
  • Email verification
  • SSO / OIDC

Payments & Billing

Provider-agnostic payments with a Stripe-first adapter and webhook sync — Polar included.

  • Subscriptions
  • Webhook state sync
  • Entitlements
  • Metered & usage-based
  • Idempotency
  • Money helpers

Transactional Email

Beautiful, TSX-templated transactional email. Integrate Resend, or use your own SMTP.

  • TSX templates
  • Queue-backed sends
  • Resend adapter
  • Custom SMTP
  • Mail-catcher testing

AI

Workers AI on the Vercel AI SDK — provider-agnostic models wired onto every action ctx.

  • Workers AI models
  • Provider-agnostic
  • generateText / streamText
  • Embeddings
  • Typed tool calls

Storage & Bindings

Typed Cloudflare binding facades in one install — storage and data plumbing on ctx.

  • R2 typed buckets & signed URLs
  • Workers KV
  • Cloudflare Images
  • Vectorize
  • Analytics Engine

Background Jobs

Durable background work: cron triggers, delayed jobs, queues, and multi-step workflows.

  • Cron triggers
  • runAfter / runAt
  • Durable Workflows
  • Typed queues
  • Reusable steps

Bring-your-own DB

Bring your own Postgres or MySQL over Cloudflare Hyperdrive — a driver-agnostic ctx.sql.

  • PostgreSQL & MySQL
  • Cloudflare Hyperdrive
  • node-postgres / postgres.js
  • mysql2
  • Connection pooling

Testing & Advisors

Ship with confidence — an in-memory harness, schema advisors, and deterministic seeding.

  • In-memory test harness
  • Vitest
  • Schema & query advisors
  • Deterministic seeding
  • GitHub Actions
How it works

Define. Write. Ship.

From a schema to a live, globally-synced backend in three steps.

lunora/schema.ts
1import { defineSchema, defineTable, v } from 'lunorash/server';
2
3export default defineSchema({
4 todos: defineTable({
5 text: v.string(),
6 done: v.boolean(),
7 }),
8});
Integrations

Works with your entire stack

One framework, every frontend — Lunora ships live adapters for React, Vue, Svelte, Solid, Astro, TanStack, Nuxt, and Analog, powered by a Vite-first dev experience.

ReactReact
Vue.jsVue
SvelteSvelte
SolidSolid
Astro
TanStack
Nuxt
Analog
ViteVite

Ready to ship realtime apps?

Open source, deployed to your own Cloudflare account, with no infrastructure to manage.

Start building