Starter Code REST API with Auto-Generated Swagger UI & Complete Auth Flow #3984
SyahrulBhudiF
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I’d like to share something I built in my free time a REST API starter template to help kickstart projects quickly.
link : https://github.com/SyahrulBhudiF/Hono-Starter-Code
In this template, I’m using Hono as the web framework, along with Drizzle ORM for database management, PostgreSQL, Redis for caching, and JWT/OAuth2 for authentication.
For the features, it includes:
Improving SwaggerUI in Hono and validation
I also wanted to improve how SwaggerUI is generated in Hono. While Hono provides a built-in method for generating OpenAPI documentation, manually writing routes repeatedly can be quite tedious.
To solve this, I created a utility function that simplifies the process of defining API routes with OpenAPI specifications. This function allows you to generate endpoints dynamically while keeping the Swagger documentation structured, clean and auto zod validation.
Here’s the helper function I made:
How to use it
That’s one of the things I wanted to share! If you're interested, feel free to check out the repository or contribute to help improve this starter template, making it even more useful for everyone. 🚀
Beta Was this translation helpful? Give feedback.
All reactions