This is a example of how to use the @ts-rest
library in a fullstack monorepo.
@ts-rest/core
is used to create @ts-rest-example/contract
package.
@ts-rest/react-query
is used to consume the api on the client side.
@ts-rest/nest
is used to type the api implementation on the server side.
This example repo uses Lerna for monorepo workflow.
- Install Yarn.
npm install -g yarn
- Install dependencies.
npx lerna bootstrap
- Make sure MySQL server is running on your local machine.
npx lerna run migrate:local
npx lerna run build
To develop all apps and packages, run the following command at the root of project:
npx lerna run dev