{"id":50317305,"url":"https://github.com/mwesox/xrpc","last_synced_at":"2026-05-29T01:01:00.368Z","repository":{"id":334129953,"uuid":"1140181453","full_name":"mwesox/xrpc","owner":"mwesox","description":"Type-safe, cross-platform RPC framework with fantastic developer experience","archived":false,"fork":false,"pushed_at":"2026-03-09T09:45:38.000Z","size":1733,"stargazers_count":1,"open_issues_count":7,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-12T05:43:31.690Z","etag":null,"topics":["code-generation","cross-platform","openapi-alternative","rpc","type-safe","typescript","zod"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mwesox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-22T23:46:24.000Z","updated_at":"2026-02-15T17:30:05.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/mwesox/xrpc","commit_stats":null,"previous_names":["mwesox/xrpc"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mwesox/xrpc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwesox%2Fxrpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwesox%2Fxrpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwesox%2Fxrpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwesox%2Fxrpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mwesox","download_url":"https://codeload.github.com/mwesox/xrpc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwesox%2Fxrpc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33632271,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-28T02:00:06.440Z","response_time":99,"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":["code-generation","cross-platform","openapi-alternative","rpc","type-safe","typescript","zod"],"created_at":"2026-05-29T01:00:56.592Z","updated_at":"2026-05-29T01:01:00.357Z","avatar_url":"https://github.com/mwesox.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# xRPC\n\n**Define once. Generate everywhere. Type-safe across every boundary.**\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Documentation](https://img.shields.io/badge/docs-mwesox.github.io%2Fxrpc-blue)](https://mwesox.github.io/xrpc/)\n\nxRPC is a next-generation RPC framework that bridges the gap between type safety and cross-platform development. Write your API contracts in TypeScript with Zod schemas, and generate idiomatic, dependency-free code for any language.\n\nNo more hand-writing SDKs. No more API drift. No more runtime surprises.\n\n## Why xRPC?\n\nTraditional API development forces a choice: type safety within a single language (tRPC) or cross-platform reach with verbose tooling (OpenAPI, gRPC). xRPC eliminates this tradeoff.\n\n| Capability | tRPC | gRPC | OpenAPI | xRPC |\n|------------|------|------|---------|------|\n| Type Safety | Full | Partial | None | Full |\n| Schema Language | TypeScript | Protobuf | YAML/JSON | TypeScript + Zod |\n| Cross-Platform | No | Yes | Yes | Yes |\n| Generated Code Quality | N/A | Verbose | Varies | Idiomatic |\n| Runtime Dependencies | Heavy | Heavy | Varies | Zero |\n| Learning Curve | Low | High | Medium | Low |\n\n## Get Started\n\n```bash\nnpm install -g @xrpckit/cli\n```\n\nDefine your API with the xRPC DSL:\n\n```typescript\nimport { z } from 'zod';\nimport { createRouter, group, query, mutation } from 'xrpckit';\n\nconst users = group(\"users\", {\n  get: query({\n    input: z.object({ id: z.string().uuid() }),\n    output: z.object({\n      id: z.string().uuid(),\n      name: z.string(),\n      email: z.string().email(),\n    }),\n  }),\n  create: mutation({\n    input: z.object({\n      name: z.string().min(1).max(100),\n      email: z.string().email(),\n    }),\n    output: z.object({ id: z.string().uuid() }),\n  }),\n});\n\nexport const router = createRouter({ users });\n```\n\nFor small APIs, flat endpoints are also supported:\n\n```typescript\nexport const router = createRouter({\n  ping: query({ input: z.object({}), output: z.object({ ok: z.boolean() }) }),\n});\n```\n\nGenerate code for your targets:\n\n```bash\nxrpc generate --input src/api.ts --targets go-server,ts-client,swift-client\n```\n\nThat's it. You now have type-safe clients and servers with full validation logic, zero runtime dependencies, and idiomatic code that feels native to each language.\n\n## TypeScript Go-to-Definition (Optional)\n\nFor TypeScript projects, you can enable contract-aware go-to-definition from generated `api.group.method(...)` calls.\n\nInstall the plugin:\n\n```bash\nbun add -d @xrpckit/ts-plugin\n```\n\nEnable it in your `tsconfig.json`:\n\n```json\n{\n  \"compilerOptions\": {\n    \"plugins\": [\n      { \"name\": \"@xrpckit/ts-plugin\" }\n    ]\n  }\n}\n```\n\nThis plugin is optional and only improves editor navigation. Generation/runtime behavior is unchanged.\n\n## Generated Code\n\nxRPC generates production-ready code that follows each language's conventions:\n\n**Go** — Structs, HTTP handlers, and validation using only the standard library\n**TypeScript** — Full type inference with Zod schemas\n**Swift** — Codable models with an async URLSession client\n**Python** — Pydantic models with FastAPI integration *(coming soon)*\n**Rust** — Serde structs with Axum handlers *(coming soon)*\n\nAll generated code includes:\n- Request/response types derived from your Zod schemas\n- Validation logic with detailed error messages\n- HTTP routing with proper status codes\n- JSON serialization/deserialization\n\n## Design Principles\n\n**Zero Dependencies** — Generated code uses only standard libraries. No vendor lock-in.\n\n**Idiomatic Output** — Code looks like it was written by a native developer, not a machine.\n\n**Schema as Source of Truth** — Your Zod schemas define validation, types, and documentation in one place.\n\n**Compile-Time Safety** — Catch errors before runtime, across language boundaries.\n\n## Use Cases\n\n- **Polyglot Microservices** — Type-safe contracts between services in different languages\n- **SDK Generation** — Ship idiomatic client libraries for your public API\n- **Full-Stack Apps** — Share types seamlessly between frontend and backend\n- **Mobile + Web** — Unified API contracts across iOS, Android, and web clients\n\n## Documentation\n\nCheck out the [full documentation](https://mwesox.github.io/xrpc/) for detailed guides.\n\nRun docs locally:\n\n```bash\nbun install\nbun run docs:dev\n```\n\nBuild/preview docs exactly like CI:\n\n```bash\nbun run docs:build\nbun run docs:preview\n```\n\n**Hands-on tutorial:** See the [x-rpc TODO App](./examples/x-rpc-todo-app/) for a complete walkthrough building a fullstack app with a Go backend and React frontend from a single contract.\n\n## Releases\n\nxRPC packages are released manually from `main` via GitHub Actions.\n\n- Workflow: `.github/workflows/release-npm.yml`\n- Versioning: manual Changesets (`bunx changeset`, then `bun run release:version`)\n- Tags: one per released package in `npm/\u003cpkg-slug\u003e/vX.Y.Z` format\n\n## Contributing\n\nContributions welcome. See [Contributing Guide](./CONTRIBUTING.md) and [Code of Conduct](./CODE_OF_CONDUCT.md).\n\n## Security\n\nReport vulnerabilities via our [Security Policy](./SECURITY.md).\n\n## License\n\nMIT\n\n---\n\n*Type safety shouldn't stop at language boundaries.*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmwesox%2Fxrpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmwesox%2Fxrpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmwesox%2Fxrpc/lists"}