Expo, NextJS, NestJS, tRPC in one single monorepo.
-
Prerequisites
- Node v20.10.0
- NPM
- PNPM v8.15.0
-
Clone the repository
Clone this repository to your local machine.
-
Setup dependencies
# Install dependencies pnpm i
-
Build all the packages & apps
pnpm build
-
Running the apps:
-
Run "TRPC Playground"
- Run below command to start server (nestjs + fastify + tRPC) app:
pnpm -F server dev
-
Go to url: http://localhost:4000/playground
-
Paste the below queries/mutations on the left side.
await trpc.greeting.hello.query({ name: "acme" }) await trpc.post.all.query() await trpc.post.byId.query({ id: 2 }) await trpc.post.create.mutate({ title: "new post title", content: "new post content" }) await trpc.post.delete.mutate(3) export {}
-
Run all or each operation one by one, they should be performed successfully.
-
Run "nextjs" backend and web app
pnpm -F nextjs dev
-
Run "expo" react-native app with "nextjs" backend
In "Terminal 1", run "nextjs" app:
pnpm -F nextjs dev
In "Terminal 2", run "expo" app:
pnpm -F expo dev
-
Run "expo" react-native app with "nestjs + fastify" backend
First change the port from
3000
to4000
here in your code!In "Terminal 1", run "nestjs" app:
pnpm -F server dev
In "Terminal 2", run "expo" app:
pnpm -F expo dev
-
This monorepo is an fork and upgraded version of t3-oss/create-t3-turbo.
Read more about it here.