Skip to content

Bunny

Bunny pairs a React SPA (bundled with Vite) with a type-safe REST API backend (powered by TApi). It includes a CLI for scaffolding, development, building, and production serving — all fully typed end-to-end.

Terminal window
npx @farbenmeer/bunny init my-app
cd my-app
npm run dev

React SPA

Vite-powered frontend with fast HMR in development and optimized production builds.

TApi Backend

Type-safe API routes with defineApi and defineHandler. The client SDK is derived directly from your route definitions.

Service Worker

Built-in offline support, static file caching, and tag-based cache invalidation — zero configuration.

OpenAPI

An OpenAPI schema is auto-generated and served at /.well-known/openapi.json.

Standalone Builds

Bundle your entire app and all its dependencies into a single file for easy deployment anywhere.

CLI

bunny init, bunny dev, bunny build, and bunny serve cover the full development lifecycle.

A Bunny project has two entry points:

// src/api.ts — define your API routes
import { defineApi } from "@farbenmeer/bunny/server";
export const api = defineApi().route("/hello", import("./api/hello"));
// src/index.tsx — render your React app
import { startBunnyClient } from "@farbenmeer/bunny/client";
import { App } from "app/app";
startBunnyClient(<App />);

The client calls the API with full type safety:

import { createFetchClient } from "@farbenmeer/bunny/client";
import type { api } from "./api";
export const client = createFetchClient<typeof api.routes>("/api");
import { useQuery } from "@farbenmeer/bunny/client";
import { client } from "client";
export function App() {
const hello = useQuery(client.hello.get());
return <div>{hello.message}</div>;
}