specta-rs/rspc

A framework for building typesafe web backends in Rust

Rust

1,390

601 commits

updated Nov 24, 2025

See the code

README

Logo

rspc

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

Website



[!WARNING] rspc is no longer being maintained. Learn more.

Example

You define a rspc router and attach procedures to it like below. This will be very familiar if you have used trpc or GraphQL before.

let router = <rspc::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 and was inspired by the bridge system Jamie Pine designed for Spacedrive. A huge thanks to everyone who helped inspire this project!

api
blazingly-fast
rust
trpc
trpc-rs
typescript

specta-rs/rspc

A framework for building typesafe web backends in Rust

Rust

1,390

601 commits

updated Nov 24, 2025

See the code

README

Logo

rspc

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

Website



[!WARNING] rspc is no longer being maintained. Learn more.

Example

You define a rspc router and attach procedures to it like below. This will be very familiar if you have used trpc or GraphQL before.

let router = <rspc::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 and was inspired by the bridge system Jamie Pine designed for Spacedrive. A huge thanks to everyone who helped inspire this project!

api
blazingly-fast
rust
trpc
trpc-rs
typescript

Project health

crates.io

Latest release

0.4.1 · Feb 7, 2025

Releases this year

0

Significant stargazers

(top 24 of 33)

Renée

501 followers · starred Dec 2022

Nazar Mokrynskyi

827 followers · starred Jun 2024

藍+85CD

258 followers · starred Oct 2023

Syrus Akbary

1,256 followers · starred Aug 2023