radicalplatforms / shafa

A wardrobe logging, composition, and organization app
https://shafa.app
Mozilla Public License 2.0
1 stars 0 forks source link

Add Swagger UI to backend #39

Open rak3rman opened 7 months ago

rak3rman commented 7 months ago

Description

As of now, no documentation of the backend exists unless you look at the exact API definition. Integrate the Swagger UI into the hono backend and automatically generate documentation based on zod/drizzle schema definitions. This may require some research, but the implementation should be clean/self-sustaining given that it is done right. Whenever an endpoint is updated (say POST /api/items now requires an additional field), the Swagger docs should update automatically (no need to manually edit the Swagger Spec YAML). Ideally it'd require no user intervention at all, but something like npm run update-docs can also suffice. Make sure some form of testing is included for this feature. Ensure Swagger UI is accessible on the production instance via /api/docs/*, it should run whenever the backend is running via npm run dev.

Acceptance Criteria

Generated by Zenhub AI

Resources

https://github.com/honojs/middleware/tree/main/packages/swagger-ui https://hono.dev/snippets/swagger-ui https://hono.dev/snippets/zod-openapi