A minimal starter template for building web applications using Hono & Bun. Implemented with a clean Layered Architecture.
Designed for scalable and maintainable backend development with clear separation of concerns across Presentation, Application, Domain, and Infrastructure layers.
- 🚀 Web Framework: Hono
- 🧊 Runtime & Package Manager: Bun
- 💾 Database: Turso (Serverless SQLite)
- 🛠️ ORM: Drizzle
- 📧 Email Service: Resend
- 🔐 Validation: Zod
.
├── documentation
│ ├── address.md
│ ├── contact.md
│ └── user.md
├── migrations
│ ├── 0000_peaceful_tiger_shark.sql
│ └── meta
├── src
│ ├── application
│ │ ├── services
│ │ │ ├── contact-service.ts
│ │ │ └── user-service.ts
│ │ └── validation
│ │ ├── auth-validation.ts
│ │ ├── contact-validation.ts
│ │ └── user-validation.ts
│ ├── domain
│ │ └── model
│ │ ├── contact-model.ts
│ │ └── user-model.ts
│ ├── infrastructure
│ │ ├── database
│ │ │ ├── index.ts
│ │ │ └── schema.ts
│ │ ├── external
│ │ │ └── mail-sender.ts
│ │ ├── logging
│ │ │ └── logger.ts
│ │ └── repositories
│ │ ├── auth-repository.ts
│ │ ├── contact-repository.ts
│ │ └── user-repository.ts
│ ├── presentation
│ │ ├── middleware
│ │ │ └── auth-middleware.ts
│ │ └── routers
│ │ ├── contact-router.ts
│ │ └── user-router.ts
│ └── index.ts
├── test
│ ├── result
│ ├── contact-test.ts
│ └── user-test.ts
├── .env
├── bun.lockb
├── drizzle.config.ts
├── package.json
├── README.md
└── tsconfig.json
To install dependencies:
bun install
Copy .env.example
to .env
and fill in the values
cp .env.example .env
Generate and migrate database schema
bun db:gen
bun db:migrate
To run:
bun run dev
To run tests:
bun test ./test/user-test.ts
bun test ./test/contact-test.ts