@nexica/nestjs-trpc
Version:
NestJS TRPC Bridge
47 lines (30 loc) ⢠2.08 kB
Markdown
# NestJS tRPC
A TypeScript integration package that bridges NestJS and tRPC, enabling fully type-safe API development without sacrificing the powerful features of NestJS.
[](https://github.com/nexica/nestjs-trpc/blob/dev/LICENSE)
[](https://nexica.github.io/nestjs-trpc/)
## What is NestJS tRPC?
NestJS tRPC automatically generates tRPC server definition files from NestJS decorators, allowing you to:
- **Build end-to-end typesafe APIs** with NestJS as your backend framework
- **Leverage NestJS dependency injection, modules, and lifecycle** while getting tRPC's type safety
- **Eliminate manual schema definition** through automatic generation
- **Use familiar decorator patterns** for defining tRPC routers, queries, and mutations
- **Integrate with Express and Fastify** frameworks seamlessly
## Key Features
⨠**Automatic Schema Generation** - Generate tRPC schema files from NestJS decorators (tRPC v11)
š **Type-Safe APIs** - Full end-to-end type safety without manually defining schemas
šÆ **NestJS Decorators** - Familiar `@Router()`, `@Query()`, `@Mutation()`, `@Subscription()` decorators
š„ **Parameter Decorators** - `@Input()` and `@Context()` for accessing validated data and request context
ā” **Middleware Support** - Full tRPC middleware integration
š” **Real-time Subscriptions** - WebSocket support for live data updates
š **Multiple Drivers** - Express and Fastify support
š **Zod Integration** - Built-in validation with Zod schemas
## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## Author
[Jamie Fairweather](https://github.com/Jamie-Fairweather)
## Contributors
<a href="https://github.com/nexica/nestjs-trpc/graphs/contributors">
<img src="https://contrib.rocks/image?repo=nexica/nestjs-trpc" />
</a>