https://github.com/webmasterdevlin/trpc-conference-app
https://github.com/webmasterdevlin/trpc-conference-app
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/webmasterdevlin/trpc-conference-app
- Owner: webmasterdevlin
- Created: 2023-04-30T13:12:13.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-01-23T08:36:19.000Z (over 1 year ago)
- Last Synced: 2025-08-29T23:59:58.953Z (10 months ago)
- Language: TypeScript
- Size: 395 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Development
### Start project
```bash
pnpm create next-app --example https://github.com/trpc/trpc --example-path examples/next-prisma-starter trpc-prisma-starter
cd trpc-prisma-starter
pnpm
pnpm dx
```
### Commands
```bash
pnpm build # runs `prisma generate` + `prisma migrate` + `next build`
pnpm db-reset # resets local db
pnpm dev # starts next.js
pnpm dx # starts postgres db + runs migrations + seeds + starts next.js
pnpm test-dev # runs e2e tests on dev
pnpm test-start # runs e2e tests on `next start` - build required before
pnpm test:unit # runs normal Vitest unit tests
pnpm test:e2e # runs e2e tests
```
### Steps to reproduce
- configure tsconfig.json with strict and strictNullChecks set to true
- Do the src/server/env.js
- Do next.config.js
- Do src/utils/publicRuntimeConfig.ts
- Do src/utils/transformer.ts
- Do the src/server folder
prisma.ts,
context.ts (important),
trpc.ts (important)
- Do the src/server/routers folder
post.ts (important) and \_app.ts (important)
- Do src/utils/trpc.ts (important)
- Do the src/pages/api/trpc folder (important)
- Build the components by doing
components/DefaultLayout.tsx,
pages/\_app.tsx, pages/post/[id].tsx, and pages/index.tsx,
- Then add these in the components folder (important):
trpc.useContext,
trpc.post.list.useInfiniteQuery,
trpc.post.byId.useQuery, and
trpc.post.add.useMutation