Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 4 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 (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-27T06:05:37.000Z (15 days ago)
- Last Synced: 2025-01-07T07:09:51.683Z (4 days ago)
- Topics: api, blazingly-fast, rust, trpc, trpc-rs, typescript
- Language: Rust
- Homepage: https://rspc.dev
- Size: 6.39 MB
- Stars: 1,236
- Watchers: 8
- Forks: 61
- Open Issues: 53
-
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
## 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!