{"id":18162765,"url":"https://github.com/a4arpon/hot-shot","last_synced_at":"2026-04-12T13:02:53.296Z","repository":{"id":259647956,"uuid":"879122195","full_name":"a4arpon/hot-shot","owner":"a4arpon","description":"Welcome to Hot Shot, a meta-framework built on top of Hono, inspired by the best features of AdonisJS and NestJS. Hot Shot provides a structured and efficient way to build scalable web applications that can run on multiple JavaScript runtimes, including Node.js, Deno, and Bun.","archived":false,"fork":false,"pushed_at":"2025-01-04T13:22:29.000Z","size":130,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-07T05:24:01.912Z","etag":null,"topics":["adonisjs","bun","bundler","bytecode","hono","honojs","http-server","javascript","linux-app","nestjs","nodejs","nodejs-api","nodejs-server","nodemailer","typescript","zig"],"latest_commit_sha":null,"homepage":"https://jsr.io/@a4arpon/hotshot","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/a4arpon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-27T03:26:44.000Z","updated_at":"2025-01-04T13:22:32.000Z","dependencies_parsed_at":"2024-10-27T04:35:26.103Z","dependency_job_id":"ab00f7e9-f0cb-443e-a550-4891a493bcc3","html_url":"https://github.com/a4arpon/hot-shot","commit_stats":null,"previous_names":["a4arpon/hot-shot"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/a4arpon/hot-shot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a4arpon%2Fhot-shot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a4arpon%2Fhot-shot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a4arpon%2Fhot-shot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a4arpon%2Fhot-shot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/a4arpon","download_url":"https://codeload.github.com/a4arpon/hot-shot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a4arpon%2Fhot-shot/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268356088,"owners_count":24237380,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adonisjs","bun","bundler","bytecode","hono","honojs","http-server","javascript","linux-app","nestjs","nodejs","nodejs-api","nodejs-server","nodemailer","typescript","zig"],"created_at":"2024-11-02T10:05:13.720Z","updated_at":"2026-04-12T13:02:53.230Z","avatar_url":"https://github.com/a4arpon.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hot Shot\n\n## Hottest framework on planet earth for building scalable web applications server.\n\n**If you're on other planets you can use it too. Just use Bun only for now.**\n\n### If You Want To Ship Fast, You Have To Build Faster.\n\n**But this framework is more faster than your crush rejects your proposal.**\n\nWelcome to **Hot Shot**, a meta-framework built on top of\n[Hono](https://honojs.dev/), inspired by the best features of AdonisJS and\nNestJS. Hot Shot provides a structured and efficient way to build scalable web\napplications that can run on multiple JavaScript runtimes, including Node.js,\nDeno, and Bun.\n\n## Introduction\n\nHot Shot leverages the simplicity and performance of Hono while offering a\nhigher-level abstraction for organizing your application's components. By\ncombining concepts from AdonisJS and NestJS, Hot Shot promotes a clean\narchitecture using classes for controllers, routes, and middleware, making your\ncodebase modular and maintainable.\n\n## Key Features\n\n- **Modular Routing**: Organize routes into classes for better structure and\n  readability.\n- **Middleware Support**: Easily integrate middleware for authentication,\n  validation, and more.\n- **Controller-Based Design**: Encapsulate request handling logic within\n  controllers.\n- **Inspired by AdonisJS and NestJS**: Familiar patterns for developers coming\n  from these frameworks.\n- **Multi-Runtime Support**: Run your applications seamlessly on Node.js, Deno,\n  and Bun.\n\n## Getting Started\n\n### Copy Starter Kit (Recommended)\n\nCopy the [starter kit](https://github.com/a4arpon/hot-shot-kit) to your project directory and start coding.\n\n```bash\ngit clone https://github.com/a4arpon/hot-shot-kit.git \u0026\u0026 cd hot-shot-kit \u0026\u0026 rm -rf .git \u0026\u0026 code .\n```\n\nI am too lazy to write the documentation for this. So, I recommend you to copy the starter kit to your project directory\nand start coding. I don't know know what this documentation contains. This is 99% ChatGPT generated. If you face any\nproblem, please open an issue on GitHub or Hey directly message me on LinkedIn Or Twitter.\n\n- [LinkedIn](https://www.linkedin.com/in/a4arpon/)\n- [Twitter](https://twitter.com/a4arpon)\n- [Facebook](https://www.facebook.com/a4arpon/)\n\n### Installation\n\nInstall Hot Shot via npm:\n\n```bash\n# NPM Installation\nnpx jsr add @a4arpon/hotshot\n\n# Bun Installation\nbunx jsr add @a4arpon/hotshot\n\n# Deno Installation\ndeno add jsr:@a4arpon/hotshot\n```\n\n### Creating Routes\n\nHot Shot encourages organizing your routes into classes, each representing a\nmodule or feature of your application.\n\n#### Example: Creating a User Routes Class\n\n```typescript\nexport class UserRoutes {\n    public readonly routes: Hono;\n    private readonly userController: UserController;\n\n    constructor() {\n        this.userController = new UserController();\n        this.routes = router({\n            basePath: \"users\",\n            routes: [\n                {\n                    path: \"/register\",\n                    method: \"POST\",\n                    controller: this.userController.register,\n                },\n                {\n                    path: \"/login\",\n                    method: \"POST\",\n                    controller: this.userController.login,\n                },\n                {\n                    path: \"/profile\",\n                    method: \"GET\",\n                    controller: this.userController.getProfile,\n                    middlewares: [AuthGuard],\n                },\n            ],\n        });\n    }\n}\n```\n\n- **`basePath`**: Sets the base URL for all routes in the class.\n- **`routes`**: An array of route definitions with methods, paths, controllers,\n  and optional middleware.\n\n### Creating Controllers\n\nControllers contain the business logic for handling requests and generating\nresponses.\n\n#### Example: Creating a User Controller\n\n```typescript\nexport class UserController {\n    async register(ctx: Context): Promise\u003cApiResponse\u003e {\n        const data = await ctx.req.json();\n        // Logic to register a user\n        return response(\"User registered successfully\", {userId: 1});\n    }\n\n    async login(ctx: Context): Promise\u003cApiResponse\u003e {\n        const data = await ctx.req.json();\n        // Logic to authenticate a user\n        return response(\"User logged in successfully\", {token: \"jwt-token\"});\n    }\n\n    async getProfile(ctx: Context): Promise\u003cApiResponse\u003e {\n        // Logic to retrieve user profile\n        return response(\"User profile retrieved\", {name: \"John Doe\"});\n    }\n}\n```\n\n- **Controller Methods**: Asynchronous functions that handle specific endpoints.\n\n### Implementing Middleware\n\nMiddleware functions perform actions before or after route handlers, such as\nauthentication or input validation.\n\n#### Example: Creating an Authentication Guard\n\n```typescript\nexport const AuthGuard = async (ctx: Context, next: () =\u003e Promise\u003cvoid\u003e) =\u003e {\n    try {\n        const authHeader = ctx.req.header(\"Authorization\");\n        const token = authHeader?.split(\" \")[1];\n\n        if (!token) {\n            ctx.status(401);\n            return ctx.json(response(\"Unauthorized access\", null, {}, false));\n        }\n\n        // Verify token (implementation depends on your auth strategy)\n        const user = verifyToken(token);\n\n        if (!user) {\n            ctx.status(401);\n            return ctx.json(response(\"Invalid token\", null, {}, false));\n        }\n\n        ctx.user = user;\n        await next();\n    } catch (error) {\n        ctx.status(500);\n        return ctx.json(response(\"Server error\", null, {}, false));\n    }\n};\n```\n\n- **Middleware Functions**: Take `ctx` and `next` as arguments and can modify\n  the context or control the flow.\n\n### Combining Routes\n\nUse `routerFactory` to combine multiple route classes into a single application\nroute.\n\n#### Example: Combining Multiple Route Classes\n\n```typescript\nexport const applicationRoutes = routerFactory([\n    UserRoutes,\n    ProductRoutes,\n    OrderRoutes,\n]);\n```\n\n## Utilities and Helpers\n\n### Response Helper\n\nUse the `response` function to create consistent API responses.\n\n#### Example: Using the Response Helper\n\n```typescript\nreturn response(\"Operation successful\", {data: \"Sample data\"});\n```\n\n### Middleware Exception Response\n\nUse `middleWareExceptionResponse` to handle exceptions in middleware.\n\n#### Example: Handling Middleware Exceptions\n\n```typescript\nexport const ExampleMiddleware = async (\n    ctx: Context,\n    next: () =\u003e Promise\u003cvoid\u003e,\n) =\u003e {\n    try {\n        // Middleware logic\n        await next();\n    } catch (error) {\n        return middleWareExceptionResponse(ctx, error);\n    }\n};\n```\n\n## Full Usage Example\n\nLet's build a simple blog module with posts and comments.\n\n### Step 1: Create Controllers\n\n```typescript\nexport class PostsController {\n    async createPost(ctx: Context): Promise\u003cApiResponse\u003e {\n        const data = await ctx.req.json();\n        // Logic to create a post\n        return response(\"Post created\", {postId: 1});\n    }\n\n    async getPost(ctx: Context): Promise\u003cApiResponse\u003e {\n        const {postId} = ctx.req.param();\n        // Logic to get a post\n        return response(\"Post retrieved\", {postId, title: \"Sample Post\"});\n    }\n}\n\nexport class CommentsController {\n    async addComment(ctx: Context): Promise\u003cApiResponse\u003e {\n        const data = await ctx.req.json();\n        // Logic to add a comment\n        return response(\"Comment added\", {commentId: 1});\n    }\n}\n```\n\n### Step 2: Define Route Classes\n\n```typescript\nexport class PostsRoutes {\n    public readonly routes: Hono;\n    private readonly postsController: PostsController;\n\n    constructor() {\n        this.postsController = new PostsController();\n        this.routes = router({\n            basePath: \"posts\",\n            routes: [\n                {\n                    path: \"/\",\n                    method: \"POST\",\n                    controller: this.postsController.createPost,\n                    middlewares: [AuthGuard],\n                },\n                {\n                    path: \"/:postId\",\n                    method: \"GET\",\n                    controller: this.postsController.getPost,\n                },\n            ],\n        });\n    }\n}\n\nexport class CommentsRoutes {\n    public readonly routes: Hono;\n    private readonly commentsController: CommentsController;\n\n    constructor() {\n        this.commentsController = new CommentsController();\n        this.routes = router({\n            basePath: \"comments\",\n            routes: [\n                {\n                    path: \"/\",\n                    method: \"POST\",\n                    controller: this.commentsController.addComment,\n                    middlewares: [AuthGuard],\n                },\n            ],\n        });\n    }\n}\n```\n\n### Step 3: Combine Routes into Application Routes\n\n```typescript\nexport const applicationRoutes = routerFactory([\n    UserRoutes,\n    PostsRoutes,\n    CommentsRoutes,\n]);\n```\n\n### Step 4: Initialize the Application\n\n```typescript\nconst app = new Hono();\n\napp.route(\"/\", applicationRoutes);\n\napp.listen(3000, () =\u003e {\n    console.log(\"Blog application is running on http://localhost:3000\");\n});\n```\n\n## Best Practices\n\n- **Organize by Feature**: Group related controllers and routes together.\n- **Use Middleware Wisely**: Apply middleware at the route or controller level\n  as needed.\n- **Handle Errors Gracefully**: Use `safeAsync` and consistent error responses.\n- **Keep Controllers Focused**: Controllers should handle request logic, not\n  business logic.\n\n## Conclusion\n\nHot Shot provides a robust structure for building scalable and maintainable web\napplications. By following familiar patterns and offering utilities to simplify\ncommon tasks, it helps you focus on writing clean and efficient code.\n\nExplore the framework and start building your next application with Hot Shot!\n\n---\n\nFeel free to dive deeper into each section and adapt the examples to fit your\napplication's specific needs.\n\n## Developer Information\n\n### Mr Wayne\n\n**Github** : [a4arpon](https://github.com/a4arpon)\n\n**Twitter** : [@a4arpon](https://twitter.com/a4arpon)\n\n**LinkedIn** : [@a4arpon](https://www.linkedin.com/in/a4arpon/)\n\n**Instagram** : [@a4arpon](https://www.instagram.com/a4arpon/)\n\n**Facebook** : [@a4arpon](https://www.facebook.com/a4arpon/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa4arpon%2Fhot-shot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fa4arpon%2Fhot-shot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa4arpon%2Fhot-shot/lists"}