CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl-labs/hono-best-practices

Production Hono patterns — zValidator hooks, typed generics, error handling, middleware composition, testing, and multi-runtime deployment

87

2.57x
Quality

80%

Does it follow best practices?

Impact

98%

2.57x

Average score across 5 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

task.mdevals/scenario-3/

Build a Coffee Shop Order API

Problem/Feature Description

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 items
  • GET /api/menu/:id -- get a single menu item
  • POST /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 orders
  • GET /api/orders/:id -- get a single order by ID

Business rules:

  • Menu item names must be unique
  • Price must be a positive number
  • Order must contain at least one item
  • Size must be one of: small, medium, large
  • Quantity must be between 1 and 10

Use in-memory storage (no real database needed).

Output Specification

Produce:

  • src/app.ts -- Hono application setup with routes
  • src/server.ts -- server entry point
  • src/routes/menu.ts -- menu route handlers
  • src/routes/orders.ts -- order route handlers
  • package.json -- with dependencies listed (no need to run npm install)

You may create additional files as needed for a well-structured codebase.

evals

tile.json