Honolus is a type-safe Sonolus server framework built on Hono. It provides typed routes, pluggable databases, search and cursor pagination, Pack import, asset delivery, durable jobs, authentication, and production observability.
- Node.js 20 or later
- TypeScript is recommended
npm install @untitledsekai/honolusimport { Honolus, createSonolusDatabase } from '@untitledsekai/honolus'
export const database = createSonolusDatabase({ driver: 'memory' })
export const sonolus = new Honolus({
database,
version: '1.1.3',
})
export default sonolus.getApp()Pass the returned Hono application to the runtime adapter used by your project. With a database configured, Honolus registers the standard item info, list, and detail routes automatically.
For production, use a shared PostgreSQL database and shared session/rate-limit stores instead of Memory or JSON storage.
import { Pool } from 'pg'
import { PostgresExecutor, createSonolusDatabase } from '@untitledsekai/honolus'
const pool = new Pool({ connectionString: process.env.DATABASE_URL })
const executor = new PostgresExecutor({ pool, statementTimeoutMs: 5_000 })
export const database = createSonolusDatabase({
driver: 'sql',
executor,
cursorSecret: process.env.CURSOR_SECRET,
autoMigrate: false,
})The PostgreSQL driver itself is intentionally not bundled. Install the pg version selected by your application.
honolus generate project ./my-server
honolus generate route levels ./my-server
honolus routes --module ./dist/app.js
honolus openapi --module ./dist/app.js --output openapi.json
honolus db migrate --module ./dist/app.jsThe full VitePress documentation is maintained in docs-site. Design notes and compatibility information are available in docs.
- Getting started
- Database and PostgreSQL
- Authentication and authorization
- Production deployment
- Compatibility policy
A runnable Node.js project is available in example.
cd example
npm install
npm run devnpm install
npm run check
npm run docs:dev