Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/unnoq/orpc
Typesafe API's Made Simple πͺ
https://github.com/unnoq/orpc
bun cloudflare-workers deno edge-runtime nextjs node reactjs rpc rpc-framework tanstack-query typescript-library vuejs
Last synced: 5 days ago
JSON representation
Typesafe API's Made Simple πͺ
- Host: GitHub
- URL: https://github.com/unnoq/orpc
- Owner: unnoq
- License: mit
- Created: 2024-09-27T00:43:26.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-01-20T13:50:41.000Z (13 days ago)
- Last Synced: 2025-01-20T20:13:30.624Z (12 days ago)
- Topics: bun, cloudflare-workers, deno, edge-runtime, nextjs, node, reactjs, rpc, rpc-framework, tanstack-query, typescript-library, vuejs
- Language: TypeScript
- Homepage: https://orpc.unnoq.com
- Size: 2.37 MB
- Stars: 183
- Watchers: 3
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
![NPM Downloads](https://img.shields.io/npm/dm/%40orpc/server?logo=npm)
![GitHub Release](https://img.shields.io/github/v/release/unnoq/orpc?logo=github)
![GitHub commit activity](https://img.shields.io/github/commit-activity/m/unnoq/orpc?logo=git&logoColor=%23fff)
![GitHub License](https://img.shields.io/github/license/unnoq/orpc)End-to-end typesafe APIs built quicker & easier
> [!NOTE]
> This project is still in heavy development, please be mindful of breaking changes.**oRPC is a powerful combination of RPC and OpenAPI, offering an exceptional developer experience powered by TypeScript. It's designed to be simple and straightforward to use.**
---
## Features
- **Type-safe π**: oRPC is built on top of TypeScript, which means you get full type safety out of the box.
- **Easy to use βοΈ**: oRPC is designed to be simple and straightforward to use.
- **Contract first π**: Take advantage of a "contract first" approach to developing your API.
- **Built-in plugins π**: Easily implement into your favourite frameworks.---
## Documentation & Examples
You can find the full documentation & examples [here](https://orpc.unnoq.com).
---
## Packages
- `@orpc/contract`: Build your API contract.
- `@orpc/server`: Build your API or implement API contract.
- `@orpc/client`: Consume your API on the client with type-safety.
- `@orpc/react-query`: Integration with [React Query](https://tanstack.com/query/latest/docs/framework/react/overview).
- `@orpc/vue-query`: Integration with [Vue Query](https://tanstack.com/query/latest/docs/framework/vue/overview).
- `@orpc/vue-colada`: Integration with [Pinia Colada](https://pinia-colada.esm.dev/).
- `@orpc/openapi`: Generate OpenAPI specs and provide OpenAPI handler for `@orpc/server`.
- `@orpc/next`: Helpers and hooks for [Next.JS](https://nextjs.org/).
- `@orpc/zod`: More schemas that [Zod](https://zod.dev/) doesn't support yet.---
## Comparison
This comparison table helps you understand how oRPC differs from other popular TypeScript RPC and REST solutions.
- β First-class, built-in support.
- π‘ Lacks features, or requires third-party integrations.
- π Not supported or not documented.| Feature | oRPC | tRPC | ts-rest | Description |
| ------------------------ | ---- | ---- | ------- | ------------------------------------------------------------------ |
| End-to-end Type Safety | β | β | β | Full TypeScript type inference from backend to frontend. |
| End-to-end Type Error | β | π | β | Full TYpeScript type inference for Error from backend to frontend. |
| React Query Integration | β | β | π‘ | Native support for React Query/TanStack Query. |
| Vue Query Integration | β | π | π‘ | Native support for Vue Query/TanStack Query. |
| Pinia Colada Integration | β | π | π | Native support for VPinia Colada. |
| With Contract-First | β | π | β | API definitions before implementation. |
| Without Contract-First | β | β | π | API definitions and implementation are combined in same place |
| File Operations | β | π‘ | π‘ | Built-in support for file uploads/downloads. |
| OpenAPI Support | β | π‘ | π‘ | Generation and consumption of OpenAPI specs. |
| Server Actions Support | β | β | π | React/Next.js Actions compatibility. |
| WebSockets/SSE Support | π | β | π | WebSockets/SSE support. |
| Nest.js integration | π | π‘ | β | Integration with Nest.js. |## References
oRPC is inspired by existing solutions that prioritize type safety and developer experience. Special acknowledgments to:
- [tRPC](https://trpc.io): For pioneering the concept of end-to-end type-safe RPC and influencing the development of type-safe APIs.
- [ts-rest](https://ts-rest.com): For its emphasis on contract-first development and OpenAPI integration, which have greatly inspired oRPCβs feature set.## License
Distributed under the MIT License. See [LICENSE](LICENSE) for more information.