Git Product home page Git Product logo

ts-rest's Introduction

ts-rest

RPC-like client and server helpers for a magical end to end typed experience

langue typescript npm GitHub GitHub Workflow Status

Introduction

ts-rest provides an RPC-like client side interface over your existing REST APIs, as well as allowing you define a separate contract implementation rather than going for a 'implementation is the contract' approach, which is best suited for smaller or simpler APIs.

If you have non typescript consumers, a public API, or maybe want to add type safety to your existing REST API? ts-rest is what you're looking for!

Features

  • End to end type safety ๐Ÿ›Ÿ
  • Magic RPC-like API ๐Ÿช„
  • Tiny bundle size ๐ŸŒŸ (1kb!)
  • Well-tested and production ready โœ…
  • No Code Generation ๐Ÿƒโ€โ™€๏ธ
  • Zod support for body parsing ๐Ÿ‘ฎโ€โ™€๏ธ
  • Full optional OpenAPI integration ๐Ÿ“

Quickstart

Install the core package

yarn add @ts-rest/core
# Optional react-query integration
yarn add @ts-rest/react-query
# Pick your backend
yarn add @ts-rest/nest @ts-rest/express
# For automatic server OpenAPI gen
yarn add @ts-rest/open-api

Create a contract, implement it on your server then consume it in your client. Incrementally adopt, trial it with your team, then get shipping faster.

๐Ÿ‘‰ Read more on the official Quickstart Guide ๐Ÿ‘ˆ

Stargazers over Time โญ๏ธ

Stargazers over time

ts-rest's People

Contributors

cyrus-za avatar ghoullier avatar github-actions[bot] avatar netiperher avatar oliverbutler avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.