Skip to content

Introduction

Kilat is a full-stack edge starter that runs entirely on Cloudflare Workers. The Indonesian word for lightning — and the name is the promise: code that runs fast, deploys fast, and is understood fast. No Docker, no VPS, no reverse proxy. wrangler deploy and you’re live on 300+ edge locations.

Layer Choice Why
Runtime Cloudflare Workers Serverless at the edge; 300+ locations
HTTP Hono 4.x Runtime-agnostic, app.fetch(request, env)
Database D1 (SQLite at the edge) Async, zero-ORM, raw prepared statements
UI Inertia v3 + React 19 Server-driven UI with in-process SSR
Build esbuild Client bundle + content-hashed assets
Deploy Wrangler wrangler deploy — that’s it
Password hashing PBKDF2 via Web Crypto 100K iterations (Workers cap)
Package manager Bun >= 1.3 Install + scripts only (not the runtime)

Bun is the package manager and script runner — the app does NOT run on Bun. It runs on the Workers runtime via Wrangler/Miniflare.

Kilat ships production-grade guardrails from day one — not a scaffold you have to harden, a skeleton that already works:

  • Auth: register, login, logout — PBKDF2 passwords, DB-backed sessions (httpOnly cookies, 30-day expiry, Secure in production), CSRF (Origin check).
  • Forgot / reset password with email delivery and hashed reset tokens (60-minute expiry).
  • Google OAuth register-or-login (zero-dependency, plain fetch).
  • Roles: user / admin, requireRole('admin') guard, /admin page with paginated user list.
  • Inertia v3: full SSR on first load, SPA navigation after, asset-version negotiation (409 + reload), partial reloads, flash messages, shared props.
  • Migrations: versioned SQL files applied via wrangler d1 migrations apply.
  • Ops: per-request logging with correlation ID, security headers (CSP, nosniff, frame denial), /health check, HSTS.
  • Testing: bun test — boots the Hono app and drives it through app.request().

What’s missing is your business logic — and that’s the point.

Terminal window
bun create kilat@latest my-app

The interactive prompt lets you pick a framework (React 19, Svelte 5, Vue 3) and a styling approach (vanilla CSS or Tailwind CSS v4) via arrow-key navigation. It downloads the template, patches wrangler.toml, renames package.json, and runs bun install for you.

Terminal window
cd my-app
bun run db:migrate # create local D1 schema
bun run build # build client assets + SSR bundle
bun run dev # http://localhost:8787

Six template variants — pick one via the scaffolder:

Template Stack Branch
default React 19 + vanilla CSS main
react-tailwind React 19 + Tailwind CSS v4 template/react-tailwind
svelte-vanilla Svelte 5 + scoped <style> CSS template/svelte-vanilla
svelte-tailwind Svelte 5 + Tailwind CSS v4 template/svelte-tailwind
vue-vanilla Vue 3 + scoped <style> CSS template/vue-vanilla
vue-tailwind Vue 3 + Tailwind CSS v4 template/vue-tailwind

Skip the prompts:

Terminal window
bun create kilat my-app --template svelte-tailwind
bun create kilat . # use current dir
bun create kilat my-app --no-install