Add zod-validated CRUD, OpenAPI docs and a styled CRUD frontend

- Define the Meal once as a zod v4 schema and derive everything from it:
  request validation, response validation, types and the OpenAPI spec.
- Full CRUD on /api/menu: list (filter/search/sort), get one, create, replace,
  update and delete, while keeping the original GET error messages intact.
- Normalize Elysia's 422 validation failures into 400 with a per-field
  `fields` map the frontend renders under each input.
- Add the @elysiajs/openapi plugin: Scalar UI at /openapi, spec at
  /openapi/json, with zod -> JSON Schema via mapJsonSchema.
- Rebuild index.html on the it3206-minisys design language (dark, white/10
  hairlines) with create/edit/delete, filters and a two-step delete confirm.
- Read index.html per request so frontend edits need no restart.
This commit is contained in:
2026-09-16 20:26:04 +08:00
parent 3899025fa3
commit a7e7ad238d
3 changed files with 1447 additions and 201 deletions
+977 -130
View File
File diff suppressed because it is too large Load Diff