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.
Free to start. 100K requests/day, 500 MB D1 database, 20K static assets — all on Cloudflare’s free tier. No credit card, no server to rent, no database to provision. See the full free tier limits.
Outgrew the free tier? Dulak is Kilat’s sister
project — same stack, same templates, but runs on Bun + bun:sqlite with
zero platform limits. Deploy with a single docker compose up on any
free-tier VPS (Oracle Cloud, Fly.io, Railway). No request caps, no CPU time
ceilings, no database size limits. See the
migration guide — there’s even a copy-paste
prompt for your AI agent to do it automatically.
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 (recommended) or npm | Install + scripts only (not the runtime) |
Bun is the recommended package manager and script runner — the app does NOT
run on Bun. It runs on the Workers runtime via Wrangler/Miniflare. npm install works for installing deps, but bun:test and build scripts require
Bun. Install Bun.
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”npm create kilat@latest my-appHave Bun? bun create kilat@latest my-app is faster —
Bun installs deps in seconds and runs the test suite and build scripts.
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.
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:
npm create kilat my-app --template svelte-tailwindnpm create kilat . # use current dirnpm 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.