cloudflare / cloudflare/templates
🚀 Template proposal: type-safe Hono API with InferDI, D1, and Queues
- Dominant language
- TypeScript
- Stars
- 2.1k
- Forks
- 1k
- Avg merge
- 17h 44m
- Merged PRs (30d)
- 10
Description
### Describe the stack
## Proposal
I would like to propose a Cloudflare Workers template demonstrating a type-safe service-layer architecture with [Hono](https://github.com/honojs/hono) and [InferDI](https://github.com/inferdi/inferdi).
The template would include:
- Hono for routing and API endpoints.
- InferDI for type-safe dependency injection and per-request scopes.
- D1 for persistent application data.
- Queues for asynchronous audit events.
- A small web interface demonstrating the complete request flow.
## Why it would be useful
The template would show how to structure a non-trivial Worker application with clearly separated routes, services, repositories, and infrastructure dependencies. It would also demonstrate how Cloudflare bindings can be supplied to request-scoped
services without decorators or reflection.
## References
- [InferDI Cloudflare Workers example](https://github.com/inferdi/inferdi/blob/main/examples/runtimes-edge/cloudflare-workers.ts)
- [InferDI Hono example](https://github.com/inferdi/inferdi/blob/main/examples/backend/hono.ts)
- [InferDI Hono adapter](https://github.com/inferdi/inferdi/tree/main/packages/hono)
I would be happy to implement the template, documentation, deployed preview, and required end-to-end tests if this proposal is a good fit for the repository.
Contributor guide
Research direction
Start by reviewing the referenced InferDI Cloudflare Workers example, Hono example, and Hono adapter, then inspect the repository's existing Cloudflare Workers templates. Done means a complete Hono and InferDI template with D1 persistence, Queues audit events, a small web interface, documentation, a deployed preview, and end-to-end tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, cloud, databases, web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100