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.
The stack
Section titled “The stack”| 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.
What’s included
Section titled “What’s included”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,
Securein 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,/adminpage 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),
/healthcheck, HSTS. - Testing:
bun test— boots the Hono app and drives it throughapp.request().
What’s missing is your business logic — and that’s the point.
Quick start
Section titled “Quick start”bun create kilat@latest my-appThe 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.
cd my-appbun run db:migrate # create local D1 schemabun run build # build client assets + SSR bundlebun run dev # http://localhost:8787Templates
Section titled “Templates”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:
bun create kilat my-app --template svelte-tailwindbun create kilat . # use current dirbun create kilat my-app --no-installNext steps
Section titled “Next steps”- Installation — prerequisites, manual clone, production deploy.
- Building with AI agents — why Kilat is built for agents.
- Philosophy — the principles behind every choice.
- Architecture overview — the
src/layout and how the pieces fit.