A thin convention layer over Hono that gives your SSR full-stack app a place for everything and a way to do it. npm: @tknf/oven.
oven delivers a convention-driven development experience on the Hono + Hono/JSX (SSR) + Turbo/Stimulus stack. It is runtime- and backend-agnostic: platform-specific implementations (such as the Node and Cloudflare Workers adapters) are isolated behind subpath exports. Only patterns that were grown and proven inside a production app are extracted here.
import { Hono } from "hono";
import { RouteHandler } from "@tknf/oven/routing";
class BooksHandler extends RouteHandler {
protected register() {
this.get("/", (c) => c.text("books-index"));
}
}
const app = new Hono();
app.route("/books", new BooksHandler());
export default app;RouteHandler is an abstract base class that extends Hono. Override the register() (and optionally layout() / middleware()) methods, then mount an instance with the same app.route() you already use.
pnpm add @tknf/oven hono drizzle-ormPeer dependencies: hono@^4.12.27 and drizzle-orm@^0.45.2 are required. Add @libsql/client@^0.17.4 for SQLite (Turso/libSQL) and @cloudflare/workers-types@^5.0.0 if you deploy to Cloudflare Workers. This package is ESM-only. See docs/getting-started.md for a full walkthrough.
- Getting started — installation, project layout, and your first
RouteHandler. - Concepts — the class-based idiom shared across RouteHandler, Model, Session, Storage, and the rest.
- Documentation index — a guide per subpath export: routing, view, models, forms, sessions, auth, security, storage/kv/cache, jobs, realtime, mailer, i18n, admin, pagination, audit, database, datasource, logging, helpers, support, vite, deployment, and testing.
oven ships a SKILL.md that teaches AI coding agents (Claude Code, Codex, and others) how to build with oven — the class-based idiom, the register/use DI convention, the subpath API map, and the security defaults. Install it into your project with npx skills:
npx skills add tknf/ovenThis drops the skill into your agent's config (e.g. .claude/skills/). To preview before installing, run npx skills add tknf/oven --list.
oven targets Web-standard Request/Response and runs anywhere Hono does, including Node.js and Cloudflare Workers. Platform-specific glue lives behind subpath exports so the core stays backend-agnostic:
@tknf/oven/node— Node.js adapter.@tknf/oven/cloudflare— Cloudflare Workers adapter (KV/R2-backed implementations of the abstractKeyValueStore/Storageinterfaces).
- Stay a thin wrapper over Hono — lean on Hono's built-ins (jsx-renderer, cookie helpers, languageDetector, etc.) as much as possible. The one intentional replacement is CSRF (Origin checking → token-based).
- One idiom: the class — from Session / Storage / Mailer / Model / RouteHandler down to the wiring layer (
ContextAccessorand friends), everything uses the same vocabulary of an abstract base class plus inheritance. - Backend-agnostic — the core depends only on abstractions such as
KeyValueStoreandStorage. Cloudflare KV / R2 are just one adapter. - No magic — no file-based routing, no lifecycle hooks, no auto-discovery. Explicit declaration and inheritance only.
RouteHandler (extends Hono), Model (a thin base over Drizzle), Form (Standard Schema), Session (server-side + flash), CSRF, Guard (authentication), Storage (R2/S3 adapters with presigning split out), KeyValueStore, Mailer (with a template layer), RateLimiter, DI (typed context register/use), Layout, i18n catalogs, Queue/Scheduled, assorted helpers, and a test harness (@tknf/oven/test).
vp install
vp check # lint + format
vp run typecheck
vp test # two projects: node (L1/L2) + workerd (L3)- The
secureattribute on the session cookie and remember token is not set by default (an intentional choice that keeps local HTTP development frictionless). In production you must setsecure: trueexplicitly via the cookie options. - The
secretsyou pass toCookieSessionStorage,UrlSigner,Encrypter, etc. must be high-entropy random values of ~32 bytes (do not reuse a human-chosen passphrase). - The two points above are not enforced at runtime (nothing is thrown); oven only emits a
console.warnso you can catch a misconfiguration (when asecretis short, or whensecureis unset in a production-like environment). The default behavior itself is unchanged. - This package is ESM-only (
exportsdeclares only thedefaultcondition; it cannot be loaded via CJSrequire).
- Published on npm as
@tknf/oven, currently on the1.xline. SeeCHANGELOG.mdfor release history.
MIT