Recommended but not enforced file structure. This is what you get when starting from the examples.
create-next-app to bootstrap one of the examples:
TodoMVC-app implemented with tRPC. Uses superjson to transparently use
Dates over the wire.
Live demo at todomvc.trpc.io
Simple starter project with a mock in-memory db.
Live demo at hello-world.trpc.io (note that data isn't persisted on Vercel as it's running in lambda functions)
Using experimental subscription support.
Live demo at chat.trpc.io
The code here is taken from
- tRPC wraps a tiny layer of sugar around react-query when using React which gives you type safety and auto completion of your procedures
- Zod is a great validation lib that works well, but tRPC also works out-of-the-box with yup/myzod/[..] - see test suite
Create a file at
Paste the following code:
Reference project: https://github.com/trpc/trpc/tree/main/examples/next-hello-world
Reference project: https://github.com/trpc/trpc/tree/main/examples/next-prisma-todomvc