Production Hono patterns — zValidator hooks, typed generics, error handling, middleware composition, testing, and multi-runtime deployment
87
80%
Does it follow best practices?
Impact
98%
2.57xAverage score across 5 eval scenarios
Passed
No known issues
A local coffee shop needs a REST API to manage its menu and customer orders. Build it using Hono and TypeScript, targeting Node.js.
Endpoints:
GET /api/menu -- list all menu itemsGET /api/menu/:id -- get a single menu itemPOST /api/menu -- add a new menu item (fields: name, category, price, available)POST /api/orders -- create a new order (fields: customerName, items array with menuItemId, size, quantity)GET /api/orders -- list all ordersGET /api/orders/:id -- get a single order by IDBusiness rules:
Use in-memory storage (no real database needed).
Produce:
src/app.ts -- Hono application setup with routessrc/server.ts -- server entry pointsrc/routes/menu.ts -- menu route handlerssrc/routes/orders.ts -- order route handlerspackage.json -- with dependencies listed (no need to run npm install)You may create additional files as needed for a well-structured codebase.