https://github.com/specta-rs/rspc
A framework for building typesafe web backends in Rust
https://github.com/specta-rs/rspc
api blazingly-fast rust trpc trpc-rs typescript
Last synced: 6 days ago
JSON representation
A framework for building typesafe web backends in Rust
- Host: GitHub
- URL: https://github.com/specta-rs/rspc
- Owner: specta-rs
- License: mit
- Created: 2022-06-23T15:38:52.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-04-20T15:34:20.000Z (14 days ago)
- Last Synced: 2025-04-27T22:29:44.562Z (7 days ago)
- Topics: api, blazingly-fast, rust, trpc, trpc-rs, typescript
- Language: Rust
- Homepage: https://rspc.dev
- Size: 6.38 MB
- Stars: 1,292
- Watchers: 8
- Forks: 65
- Open Issues: 56
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
![]()
rspc
A blazing fast and easy to use TRPC-like server for Rust.
Website
> [!WARNING]
> rspc is no longer being maintained. [Learn more](https://github.com/specta-rs/rspc/discussions/351).## Example
You define a `rspc` router and attach procedures to it like below. This will be very familiar if you have used [trpc](https://trpc.io/) or [GraphQL](https://graphql.org) before.
```rust
let router = ::new()
.query("version", |t| {
t(|ctx, input: ()| "0.0.1")
})
.mutation("helloWorld", |t| {
t(|ctx, input: ()| async { "Hello World!" })
});
```## Features:
- Per Request Context - Great for database connection & authentication data
- Middleware - With support for context switching
- Merging routers - Great for separating code between files### Inspiration
This project is based off [trpc](https://trpc.io) and was inspired by the bridge system [Jamie Pine](https://github.com/jamiepine) designed for [Spacedrive](https://www.spacedrive.com). A huge thanks to everyone who helped inspire this project!