{"id":17461582,"url":"https://github.com/w3cj/hono-open-api-starter","last_synced_at":"2025-04-04T20:10:24.215Z","repository":{"id":257925410,"uuid":"867733739","full_name":"w3cj/hono-open-api-starter","owner":"w3cj","description":"A starter template for building fully documented type-safe JSON APIs with Hono and Open API","archived":false,"fork":false,"pushed_at":"2024-10-15T18:02:50.000Z","size":238,"stargazers_count":164,"open_issues_count":0,"forks_count":16,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-18T09:33:20.375Z","etag":null,"topics":["drizzle","hono","openapi","scalar","typescript","zod"],"latest_commit_sha":null,"homepage":"https://www.youtube.com/watch?v=sNh9PoM9sUE","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/w3cj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/funding.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"CodingGarden","patreon":"CodingGarden","custom":["https://streamlabs.com/codinggarden/tip","https://twitch.tv/products/codinggarden","https://www.youtube.com/codinggarden/join"]}},"created_at":"2024-10-04T16:03:02.000Z","updated_at":"2024-10-17T21:45:57.000Z","dependencies_parsed_at":"2024-10-17T02:14:11.197Z","dependency_job_id":null,"html_url":"https://github.com/w3cj/hono-open-api-starter","commit_stats":null,"previous_names":["w3cj/hono-open-api-starter"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/w3cj%2Fhono-open-api-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/w3cj%2Fhono-open-api-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/w3cj%2Fhono-open-api-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/w3cj%2Fhono-open-api-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/w3cj","download_url":"https://codeload.github.com/w3cj/hono-open-api-starter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247242678,"owners_count":20907134,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["drizzle","hono","openapi","scalar","typescript","zod"],"created_at":"2024-10-18T07:03:58.042Z","updated_at":"2025-04-04T20:10:24.199Z","avatar_url":"https://github.com/w3cj.png","language":"TypeScript","funding_links":["https://github.com/sponsors/CodingGarden","https://patreon.com/CodingGarden","https://streamlabs.com/codinggarden/tip","https://twitch.tv/products/codinggarden","https://www.youtube.com/codinggarden/join"],"categories":["TypeScript"],"sub_categories":[],"readme":"# Hono Open API Starter\n\nA starter template for building fully documented type-safe JSON APIs with Hono and Open API.\n\n\u003e A new version of drizzle was released since the video showing this starter was made. See the [drizzle-v0.35 branch](https://github.com/w3cj/hono-open-api-starter/tree/drizzle-v0.35) and [this commit](https://github.com/w3cj/hono-open-api-starter/commit/92525ff84fb2a247c8245cc889b2320d7b3b6e2c) for the changes required to use drizzle v0.35\n\n\u003e For a cloudflare specific template, see the [cloudflare branch](https://github.com/w3cj/hono-open-api-starter/tree/cloudflare) on this repo and the [cloudflare-drizzle-v0.35 branch](https://github.com/w3cj/hono-open-api-starter/tree/cloudflare-drizzle-v0.35)\n\n\u003e For other deployment examples see the [hono-node-deployment-examples](https://github.com/w3cj/hono-node-deployment-examples) repo\n\n- [Hono Open API Starter](#hono-open-api-starter)\n  - [Included](#included)\n  - [Setup](#setup)\n  - [Code Tour](#code-tour)\n  - [Endpoints](#endpoints)\n  - [References](#references)\n\n## Included\n\n- Structured logging with [pino](https://getpino.io/) / [hono-pino](https://www.npmjs.com/package/hono-pino)\n- Documented / type-safe routes with [@hono/zod-openapi](https://github.com/honojs/middleware/tree/main/packages/zod-openapi)\n- Interactive API documentation with [scalar](https://scalar.com/#api-docs) / [@scalar/hono-api-reference](https://github.com/scalar/scalar/tree/main/packages/hono-api-reference)\n- Convenience methods / helpers to reduce boilerplate with [stoker](https://www.npmjs.com/package/stoker)\n- Type-safe schemas and environment variables with [zod](https://zod.dev/)\n- Single source of truth database schemas with [drizzle](https://orm.drizzle.team/docs/overview) and [drizzle-zod](https://orm.drizzle.team/docs/zod)\n- Testing with [vitest](https://vitest.dev/)\n- Sensible editor, formatting and linting settings with [@antfu/eslint-config](https://github.com/antfu/eslint-config)\n\n## Setup\n\nClone this template without git history\n\n```sh\nnpx degit w3cj/hono-open-api-starter my-api\ncd my-api\n```\n\nCreate `.env` file\n\n```sh\ncp .env.example .env\n```\n\nInstall dependencies\n\n```sh\npnpm install\n```\n\nCreate sqlite db / push schema\n\n```sh\npnpm drizzle-kit push\n```\n\nRun\n\n```sh\npnpm dev\n```\n\nLint\n\n```sh\npnpm lint\n```\n\nTest\n\n```sh\npnpm test\n```\n\n## Code Tour\n\nBase hono app exported from [app.ts](./src/app.ts). Local development uses [@hono/node-server](https://hono.dev/docs/getting-started/nodejs) defined in [index.ts](./src/index.ts) - update this file or create a new entry point to use your preferred runtime.\n\nTypesafe env defined in [env.ts](./src/env.ts) - add any other required environment variables here. The application will not start if any required environment variables are missing\n\nSee [src/routes/tasks](./src/routes/tasks/) for an example Open API group. Copy this folder / use as an example for your route groups.\n\n- Router created in [tasks.index.ts](./src/routes/tasks/tasks.index.ts)\n- Route definitions defined in [tasks.routes.ts](./src/routes/tasks/tasks.routes.ts)\n- Hono request handlers defined in [tasks.handlers.ts](./src/routes/tasks/tasks.handlers.ts)\n- Group unit tests defined in [tasks.test.ts](./src/routes/tasks/tasks.test.ts)\n\nAll app routes are grouped together and exported into single type as `AppType` in [app.ts](./src/app.ts) for use in [RPC / hono/client](https://hono.dev/docs/guides/rpc).\n\n## Endpoints\n\n| Path               | Description              |\n| ------------------ | ------------------------ |\n| GET /doc           | Open API Specification   |\n| GET /reference     | Scalar API Documentation |\n| GET /tasks         | List all tasks           |\n| POST /tasks        | Create a task            |\n| GET /tasks/{id}    | Get one task by id       |\n| PATCH /tasks/{id}  | Patch one task by id     |\n| DELETE /tasks/{id} | Delete one task by id    |\n\n## References\n\n- [What is Open API?](https://swagger.io/docs/specification/v3_0/about/)\n- [Hono](https://hono.dev/)\n  - [Zod OpenAPI Example](https://hono.dev/examples/zod-openapi)\n  - [Testing](https://hono.dev/docs/guides/testing)\n  - [Testing Helper](https://hono.dev/docs/helpers/testing)\n- [@hono/zod-openapi](https://github.com/honojs/middleware/tree/main/packages/zod-openapi)\n- [Scalar Documentation](https://github.com/scalar/scalar/tree/main/?tab=readme-ov-file#documentation)\n  - [Themes / Layout](https://github.com/scalar/scalar/blob/main/documentation/themes.md)\n  - [Configuration](https://github.com/scalar/scalar/blob/main/documentation/configuration.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fw3cj%2Fhono-open-api-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fw3cj%2Fhono-open-api-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fw3cj%2Fhono-open-api-starter/lists"}