Give your API typed routes, generated docs and a consistent error response before adding features.

16 files · 18 KB

Hono ↗

Why I keep it

I run WithSeismic’s portal API on Hono, so auth, bookings and the other server work share one API layer. Routes use Zod schemas to produce typed handlers and an OpenAPI document; the docs stay connected to the routes the agent changes.

I’ve taken the API files from my React starter, including session middleware, request logging, health checks and the error handler. Every error has a code, message and request ID, so your front end has one shape to handle as you add modules.

Take the files

16 files · 18 KB

  • README.md3 KB
  • package.json859 B
  • src/app.ts2 KB
  • src/config/env.ts1 KB
  • src/index.ts1 KB
  • src/lib/client-ip.ts2 KB
  • src/lib/context.ts179 B
  • src/lib/logger.ts448 B
  • src/middleware/authenticated.ts529 B
  • src/middleware/error-handler.ts882 B
  • src/middleware/request-log.ts561 B
  • src/modules/account/routes.ts1 KB
  • src/modules/auth/routes.ts378 B
  • src/modules/docs/routes.ts1 KB
  • src/modules/health/routes.ts1 KB
  • src/routes/index.ts579 B

Keep building your setup: The stack

Back to the shelves →
  • 015 files · 151 KB

    The SaaS starter

    Start with accounts, organisations, email and analytics wired into a React app and Hono API.

  • 025 files · 6 KB

    Turborepo

    Run builds, tests and type checks across your apps in dependency order, with cached results.

  • 038 files · 8 KB

    Drizzle

    Keep your database schema typed and your SQL migrations checked in beside the code that needs them.

  • 042 files · 5 KB

    Better Auth with passkeys

    Keep accounts, organisations and passkey sign-in in your own Hono API and Postgres database.

  • 059 files · 10 KB

    TanStack

    Keep React routes, session checks and cached server data working from the same types.

  • 065 files · 5 KB

    Lefthook and Biome

    Check staged code at commit time and types before a push, including work written by your agents.