Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

Awesome Lists containing this project

README

        


Logo


rspc




A blazing fast and easy to use TRPC-like server for Rust.



Website




Discord

crates.io


download count badge


docs.rs


npm (scoped)



## 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!