Starter template with a CRUD functionality and type-safe, using scalar and OpenAPI
Project reference here and all credits to the author.
- Structured console logging with pino / hono-pino
- Documented / type-safe routes with @hono/zod-openapi
- Interactive API documentation with scalar / @scalar/hono-api-reference
- Convenience methods / helpers to reduce boilerplate with stoker
- Type-safe schemas and environment variables with zod
- Single source of truth database schemas with drizzle and drizzle-zod
- Testing with vitest
- Sensible editor, formatting and linting settings with @antfu/eslint-config
Install dependencies
bun install
Create SQLite database / push schema
bun drizzle-kit generate
bun drizzle-kit push
View database in drizzle studio
bun drizzle-kit studio
Start development server
bun run dev
Open in browser
http://localhost:3002/reference
Check format and linting with Biome.js
bun run check
Testing with vitest
bun run test
| Path | Description |
|---|---|
| GET /doc | Open API Specification |
| GET /reference | Scalar API Documentation |
| GET /tasks | List all tasks |
| POST /tasks | Create a task |
| GET /tasks/{id} | Get one task by id |
| PATCH /tasks/{id} | Patch one task by id |
| DELETE /tasks/{id} | Delete one task by id |