Open Source · MIT License

The BackendThat ShipsWith You

A production-ready Hono + TypeScript foundation, validated config, versioned routes, structured logs, migrations and auth. Wired up. Explicit. Yours to extend.

View on Codeberg

no install required, runs through npx

terminal

$ npx create-hono-forge@latest my-app

▸ Scaffolding My App from Hono Forge...

▸ Installing dependencies...

▸ Creating database... running migrations...

✓ Done!

$ cd my-app

$ pnpm dev

▸ INFO: Server listening {"environment":"development","service":"Hono Forge","host":"0.0.0.0","port":8000} _

Step 01

Scaffold

Deps installed, DB created and migrated

npx create-hono-forge@latest my-app

Step 02

Enter

Your new project, ready to go.

cd my-app

Step 03

Run

Live on 0.0.0.0:8000.

pnpm dev
Feature Preview

What's forged in

#1 Configure

Validated by Default

Zod checks every variable in .env before the server accepts a single request. Bad config never reaches production.

env validation

PORT must be an integer 1–65535

wildcard CORS cannot be combined with credentials

DATABASE_URL resolves to a .db path

src/modules/

├─ article/

└─ <your-feature>/

routes · service · schema

#2 Extend

Feature-First Modules

Business logic lives beside its routes and schema, decoupled from Hono's Context testable on its own terms.

#3 Trace

Every Request, Tagged

Every response carries an X-Request-Id. Error bodies repeat it, so a client report matches a server log in one grep.

{

"error": {

"code": "NOT_FOUND",

"requestId": "01K9X…"

}

}

{"level":30,"reqId":"01K9X…","method":"GET","path":"/api/v1","ms":4}

#4 Observe

Logs That Read Like Data

Newline-delimited JSON in production, pretty-printed in development. Credentials and tokens redacted either way.

#5 Persist

Migrations, Handled

Drizzle migrations and Better Auth are already connected — model your schema and move on.

$ pnpm db:generate

$ pnpm db:migrate

▸ 2 migrations applied

SIGTERM received

▸ draining connections

▸ closed in 340ms

#6 Ship

Shuts Down Clean

SIGINT/SIGTERM stop new connections and close gracefully — no dropped requests mid-deploy.

Parts List

Chosen tools, not a pile of dependencies

Node.js

Node.js

Runtime

TypeScript

TypeScript

Type safety

pnpm

pnpm

Package manager

Hono

Hono

Web framework

Zod

Zod

Validation

Pino

Pino

Logging

Drizzle ORM

Drizzle ORM

ORM

SQLite

SQLite

Database

Better Auth

Better Auth

Authentication

ESLint

ESLint

Linting

Prettier

Prettier

Formatting

Vitest

Vitest

Testing

How It's Structured

A feature-first modular monolith

app.ts is the composition root. server.ts adapts it to Node.js and owns the process lifecycle.

server.tsnode adapter · lifecycleapp.tscomposition rootshared concerns· http / middleware· logging· config (env)· auth· databasesrc/modules/<feature>articleroutesserviceschema<feature-1>routesserviceschema<feature-2>routesserviceschemaservices and domain logic do not import Hono's ContextHONO FORGE — ARCHITECTUREDWG NO. HF-001SCALE: NTSfeature-first modular monolithREV: 1.0
Community

Open, and staying that way

MIT licensed, hosted on Codeberg. Issues and pull requests are welcome. read the README for the full command reference and environment rules.