https://github.com/leanhanc/hono-betterauth-openapi-starter
A Hono 🔥 starter project using Drizzle ORM and Stoker helpers, featuring Better Auth integration and API documentation powered by OpenAPI.
https://github.com/leanhanc/hono-betterauth-openapi-starter
better-auth drizzle-orm hono openapi pino scalar
Last synced: 2 months ago
JSON representation
A Hono 🔥 starter project using Drizzle ORM and Stoker helpers, featuring Better Auth integration and API documentation powered by OpenAPI.
- Host: GitHub
- URL: https://github.com/leanhanc/hono-betterauth-openapi-starter
- Owner: leanhanc
- License: mit
- Created: 2025-08-09T18:04:22.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2025-08-09T20:13:46.000Z (2 months ago)
- Last Synced: 2025-08-09T21:11:04.511Z (2 months ago)
- Topics: better-auth, drizzle-orm, hono, openapi, pino, scalar
- Language: TypeScript
- Homepage:
- Size: 46.9 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Hono 🔥 Better Auth OpenAPI Starter
A modern TypeScript starter project featuring:
- **Hono** - Fast, lightweight web framework
- **Better Auth** - Type-safe authentication
- **Drizzle ORM** - Type-safe database operations
- **Stoker** - Utilities for Hono and OpenAPI
- **OpenAPI** - Automatic API documentation## Quick Start
1. **Install dependencies:**
```sh
bun install
```2. **Run development server:**
```sh
bun run dev
```3. **Open your browser:**
```
http://localhost:3000
```## Project Structure
```
src/
├── index.ts # Application entry point
├── db/ # Database schema & migrations
├── middleware/ # Middleware
├── lib/ # Library (utils, types, etc.)
```## Environment Setup
Copy `.env.example` to `.env` and configure:
```env
LOG_LEVEL=
CORS_ORIGIN=
DATABASE_URL=
```## Development
- **Hot reload:** Changes automatically restart the server
- **Type safety:** Full TypeScript support with strict mode
- **API docs:** Auto-generated OpenAPI documentation at `/api-docs` and `/betterauth-docs` (Better Auth specific endpoints)
- **Code formatting:** Prettier with consistent formatting rules
- **Linting:** ESLint with TypeScript support and recommended rules## Stack Details
- **Runtime:** Bun
- **Framework:** Hono v4
- **Database:** Drizzle ORM (PostgreSQL default)
- **Auth:** Better Auth
- **Validation:** Zod
- **Documentation:** OpenAPI/Swagger
- **Code Quality:** ESLint + Prettier