{"id":18160811,"url":"https://github.com/blankeos/hono-trpc","last_synced_at":"2025-08-22T15:32:19.174Z","repository":{"id":233280753,"uuid":"786415794","full_name":"Blankeos/hono-trpc","owner":"Blankeos","description":"🔥🔷 Hono + tRPC 10 example.","archived":false,"fork":false,"pushed_at":"2024-04-24T14:34:29.000Z","size":84,"stargazers_count":23,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T08:51:15.620Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/Blankeos.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}},"created_at":"2024-04-14T11:54:29.000Z","updated_at":"2025-03-16T06:53:01.000Z","dependencies_parsed_at":"2024-04-15T13:21:05.751Z","dependency_job_id":"b6004883-71ad-40cf-bdfc-e4dd45bf402c","html_url":"https://github.com/Blankeos/hono-trpc","commit_stats":null,"previous_names":["blankeos/hono-trpc"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Blankeos/hono-trpc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blankeos%2Fhono-trpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blankeos%2Fhono-trpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blankeos%2Fhono-trpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blankeos%2Fhono-trpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Blankeos","download_url":"https://codeload.github.com/Blankeos/hono-trpc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blankeos%2Fhono-trpc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271658864,"owners_count":24798189,"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-22T02:00:08.480Z","response_time":65,"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":[],"created_at":"2024-11-02T08:09:26.414Z","updated_at":"2025-08-22T15:32:18.753Z","avatar_url":"https://github.com/Blankeos.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1\u003e\nHono tRPC Example Project\n\u003c/h1\u003e\n\nJust a demo of Hono and tRPC in a monorepo. I wanted to try this out as an alternative\nto Hono's own RPC feature and compare its features. If you like Hono RPC instead, you can check out my [Hono RPC Examples](https://github.com/Blankeos/hono-rpc-examples).\n\nThe frontend can be anything, I just chose Solid + [Vike][vike-url] (for SSR) for this example.\n\n\u003ch2\u003eTable of Contents\u003c/h2\u003e\n\n- [Architecture](#architecture)\n- [Requirements](#requirements)\n- [Getting Started](#getting-started)\n- [Differences with Hono RPC that I noticed.](#differences-with-hono-rpc-that-i-noticed)\n\n## Architecture\n\n```mermaid\nblock-beta\n    columns 4\n        block:frontend:4\n            columns 3\n            frontendheader[\"Frontend\"]:3\n            S[\"🔵 Solid port:3000\"]:1\n            space\n            S-. \"SSR\" .-V\n            V[\"🔨 Vike port:3000\"]:1\n        end\n        space:4\n        block:backend:4\n            columns 2\n            backendheader[\"Backend - port:4001\"]:2 H[\"🔥 Hono\"]:1 T[\"🔷 tRPC\"]:1\n            S -. \"CSR\" .-\u003e H\n            V -. \"SSR\" .-\u003e H\n        end\n\n  style frontendheader fill:#939,stroke:#333,stroke-width:4px,width:10px\n  style backendheader fill:#386,stroke:#333,stroke-width:4px,width:10px\n```\n\n## Requirements\n\n1. [Bun (latest)][bun-install-url]\n\n## Getting Started\n\n1. Install dependencies\n\n```sh\nbun install\n```\n\n2. Run the app\n\n```sh\nbun dev # Runs bun server:dev and bun client:dev\n```\n\n## Differences with Hono RPC that I noticed.\n\nThe current differences I see are:\n\n- [x] Feature: Batch fetching with tRPC client.\n  - When initializing the client, you can `httpBatchLink` to do batching.\n  - You can use `httpLink` to not use batching. (The same as regular Hono RPC).\n- [x] Feature: When using the `client.*.*`, you can actually ctrl/cmd + click and it will take you to the actual resolver.\n  - example: `trpc.user.getList()` - ctrl clicking will take you to the resolver.\n  - This gets you to the actual resolver/service implementation right away. Not exactly difficult to do without though, but it's nice.\n- [x] Maturity: tRPC is (probably) more mature and battle-tested than Hono RPC.\n- [x] Paradigm: In `trpc.ts`, you can export reusable base:\n  - Routers\n  - Procedures (e.g. protectedProcedure, publicProcedure) - The alternative would be to use **middlewares** for \u003cu\u003econtroller-level\u003c/u\u003e protection or use a **utility** for \u003cu\u003eresolver-level\u003c/u\u003e protection.\n- [x] Paradigm: REST-facing is difficult unless you use `trpc-openapi`.\n  - 1. because if your URL queries are always inside `?input` of the URL query (e.g. `:4000?input=\"Carl\"`)\n  - 2. If your query has multiple variables, you can't do (e.g. `?name=\"Carl\"\u0026age=\"23\"`) - I have not tested this yet.\n  - 3. Query Objects are always parsed as URL strings:\n    - `const input = { name: \"Carl\" }` will be\n    - `input=%7B%220%22%3A%7B%22id%22%3A%221%22%2C%22name%22%3A%22Carl%22%7D%7D`\n\n\u003c!-- URLS --\u003e\n\n[vike-url]: https://github.com/vikejs/vike-solid \"Vike Solid\"\n[bun-install-url]: https://bun.sh/docs/installation\n\n\u003c!-- # hono-trpc\n\nTo install dependencies:\n\n```bash\nbun install\n```\n\nTo run:\n\n```bash\nbun run index.ts\n```\n\nThis project was created using `bun init` in bun v1.1.3. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime. --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblankeos%2Fhono-trpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblankeos%2Fhono-trpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblankeos%2Fhono-trpc/lists"}