Type-safe, real-time backend on your own Cloudflare account. Vite-first.
Documentation · Website · Packages · Quick start
[![typescript-image][typescript-badge]][typescript-url]
[![Apache-2.0 licence][license-badge]][license]
[![Status][status-badge]][status]
[![Node][node-badge]][node]
[![pnpm][pnpm-badge]][pnpm]
[![CI][ci-badge]][ci]
[![npm version][npm-version-badge]][npm-version]
[![PRs Welcome][prs-welcome-badge]][prs-welcome]
[![OpenSSF Scorecard][scorecard-badge]][scorecard]
What is Lunora?
Lunora gives you Convex-style DX on infrastructure you control. You write type-safe queries, mutations, and actions in TypeScript. In production, Lunora deploys them as Cloudflare Workers: Durable Objects hold real-time state, D1 handles SQL, R2 stores blobs, and Queues run jobs. Nothing runs on servers we operate; the production stack lives in the Cloudflare account you already pay for. See Where it runs for the other targets.
Lunora is Vite-first. The dev loop, codegen, and client bindings plug into a Vite project through @cloudflare/vite-plugin, so local dev runs on workerd, the same runtime as production. Rsbuild and Rspack projects get the same loop through @lunora/rspack, and a standalone CLI covers everything else.
Quick start
pnpm dlx lunorash@alpha init my-app
cd my-app
pnpm install
pnpm dev
Alpha. The npm package is lunorash because the unscoped lunora name is taken; the CLI it installs is still called lunora. Install from the @alpha dist-tag and expect breaking changes until the first stable release (see Status).
Prefer managed hosting, or just want one email when v1 is stable? Join the Lunora Cloud waitlist →
A fresh app has three files you edit:
// lunora/schema.ts
import { defineSchema, defineTable, v } from "lunorash/server";
export default defineSchema({
messages: defineTable({
author: v.string(),
body: v.string(),
ts: v.number(),
}),
});
// lunora/messages.ts
import { mutation, query, v } from "./_generated/server";
export const list = query.query(async ({ ctx }) => ctx.db.query("messages").order("desc").take(50));
export const send = mutation.input({ author: v.string(), body: v.string() }).mutation(async ({ ctx, args }) => {
await ctx.db.insert("messages", { ...args, ts: Date.now() });
});
// src/App.tsx
import { useQuery, useMutation } from "@lunora/react";
import { api } from "../lunora/_generated/api";
export default function App() {
const messages = useQuery(api.messages.list, {}) ?? [];
const { mutate: send } = useMutation(api.messages.send);
return (
<>
<button onClick={() => send({ author: "me", body: "hello" })}>Send</button>
<ul>
{messages.map((m) => (
<li key={m._id}>
{m.author}: {m.body}
</li>
))}
</ul>
</>
);
}
pnpm dev boots workerd, generates the client types, starts the Vite dev server, and reloads on every save. Click the button and the list updates in every open tab; the query re-runs on the server and pushes the new result.
lunora init asks which framework to use and defaults to a React SPA. Pass -t to pick one directly: next, nuxt, sveltekit, astro, analog, tanstack-start-react, tanstack-start-solid, solid-v2, expo, vinext, rspack-react, standalone, and a few more (lunora init --help lists them). Use --vite <framework> for a plain React, Vue, Solid, or Svelte SPA, and lunora init --here to add Lunora to an app you already have.
Why Lunora
Types run end to end. The schema, validators, query results, and client hooks come from one source of truth. The dev server regenerates client types on save, so there is no codegen step to forget.
Queries are live. Clients subscribe over WebSocket, and a mutation pushes the change to every subscriber. You don't write cache invalidation.
Production runs on your account. Cloudflare is the production target: Workers, Durable Objects, D1, R2, Queues, and KV all live in your Cloudflare account. An idle app costs about nothing, and at scale you pay Cloudflare's prices rather than a SaaS markup.