ADR 0001 — Nitro 3 + Bun + Vite/Vue as the foundation
Status: accepted; the front-end and build part is superseded by ADR 0017 (no Vite). Date: 2026-12-03.
Context
The plan requires proving the foundation before locking it in: Nitro 3 on Bun, a Vue pipeline, and route registration without duplicating the router.
Alternatives considered
- Routes in Nitro’s
routes/(filesystem routing). - Nitro’s
routesoption (a path → handler object). - Nitro’s
handlersoption (a list withroute,method,handler), generated from the contracts.
Decision
defineRoutereturns an h3 v2-compatible function that carries the contract in.contract. The route file is both the Nitro handler and the source of the contract.fellowHandlers()discoversmodules/*/routesand fillshandlers. Option 2 was rejected because an object keyed by path cannot represent two methods on the same path; option 1 because routes belong to modules.- Frontend: Vite with
@vitejs/plugin-vueand thenitro/viteplugin,bunpreset. A singlevite buildproduces.output/with the server and assets. - The pipeline (
executeRoute) takes aRequestand returns aResponse: it does not depend on Nitro, which allows testing routes without a server.
Evidence
Production build and development server verified on Bun 1.4.4 with nitro@3.0.261103-rc and Vite 8: API and SPA served by the same process.
Risks and consequences
nitro@3.0.0on npm is an old release (2025-10) and fails to build with the Vite plugin. The range^3.0.0-0resolves to it, so the version is pinned to the tested RC.- The plugin’s configuration option changed between versions (
nitro({ config })in 3.0.0, top-level options in the RC). - Discovery happens when the configuration is loaded: new routes require restarting the dev server.
Conditions for reassessment
Stable Nitro 3 is released; SSR becomes necessary; or configuration-time discovery gets in the way of development (alternative: a Nitro module with a watcher).