Composition API, typisierte Props, schlanke Server-Routen.
Constitution — Vue 3 + Nuxt app
Version 1.0.0 · Ratified 2026-11-10
These principles hold for every spec, plan and task of the project. A spec may add rules; it never weakens these.
-
Composition API. Components use
<script setup lang="ts">; the Options API is not used in new code. Logic shared between components lives in composables nameduseSomething. -
Typed props and emits. Props and events are declared with
defineProps<Props>()anddefineEmits<Events>().vue-tsc --noEmitruns in CI and a type error fails the build. -
Server routes kept thin. A handler in
server/apivalidates its input with a schema (readValidatedBody,getValidatedQuery), calls a function inserver/utilsand returns. Business rules or SQL inside a handler fail the review. -
Data fetched once. Data for the first render comes from
useFetchoruseAsyncDatawith a stable key, so it is fetched on the server and reused on the client. Fetching it again inonMountedis a defect. -
No state shared across requests. Shared state uses
useStateor a Pinia store. A mutablerefat module level leaks between requests on the server and fails the review. -
Secrets in private runtime config. Secrets live in the private keys of
runtimeConfig; onlyruntimeConfig.publicreaches the browser. No secret is read throughimport.meta.envin a component. -
Tested and accessible. Components are tested with Vitest and
@nuxt/test-utils, and key pages run axe with zero violations. The tests are green before the merge.