Backend Starter: Hono + Prisma

A fast, type-safe backend boilerplate using Hono, Prisma, and PostgreSQL, structured as a modular monolith for long-term maintainability.

View Repository

Tech Stack

HonoPrismaPostgreSQLTypeScriptZodPinoVitest

A Practical Backend Setup

This boilerplate provides a clean starting point for building APIs without unnecessary abstractions. It focuses on fast startup, clear structure, and strong type safety, so you can spend time on business logic instead of framework setup.

Why Hono

Hono is small, fast, and designed for modern runtimes. Compared to Express, it has lower overhead, faster startup times, and a simpler mental model, making it a good fit for both traditional servers and serverless environments.

Modular Monolithic Structure

The project follows a modular monolithic approach. Features are organized by domain, with clear separation between controllers, services, and repositories. This keeps the codebase easy to navigate and avoids premature microservice complexity.

Database Access with Prisma

Prisma is used for database access and migrations. It provides a type-safe client for PostgreSQL and helps keep the database schema and application code in sync.

Request Validation

Zod is used to validate incoming requests and shared data structures. This ensures invalid input is rejected early and keeps API contracts explicit.

Logging and Rate Limiting

Structured logging is handled with Pino. Basic rate limiting is included to protect endpoints and prevent accidental or abusive overuse.

Testing and Code Quality

Vitest is used for unit testing. ESLint and Prettier enforce consistent formatting and catch common issues without adding runtime overhead.

Getting Started

Start the project in a few steps:

Install dependencies
pnpm install
Set environment variables
cp .env.example .env
Run migrations
pnpm db:migrate
Start dev server
pnpm dev