reggie3-braingu / examples-next-prisma-starter

mirror of https://github.com/trpc/trpc/tree/main/examples/next-prisma-starter

Home Page:https://github.com/trpc/trpc/tree/main/examples/next-prisma-starter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Prisma + tRPC

Features

  • πŸ§™β€β™‚οΈ E2E typesafety with tRPC
  • ⚑ Full-stack React with Next.js
  • ⚑ Database with Prisma
  • βš™οΈ VSCode extensions
  • 🎨 ESLint + Prettier
  • πŸ’š CI setup using GitHub Actions:
    • βœ… E2E testing with Playwright
    • βœ… Linting

Setup

yarn:

yarn create next-app --example https://github.com/trpc/trpc --example-path examples/next-prisma-starter trpc-prisma-starter
cd trpc-prisma-starter
yarn
yarn dx

npm:

npx create-next-app --example https://github.com/trpc/trpc --example-path examples/next-prisma-starter trpc-prisma-starter
cd trpc-prisma-starter
yarn
yarn dx

Requirements

  • Node >= 14
  • Docker (for running Postgres)

Development

Start project

yarn create next-app --example https://github.com/trpc/trpc --example-path examples/next-prisma-starter trpc-prisma-starter
cd trpc-prisma-starter
yarn
yarn dx

Commands

yarn build      # runs `prisma generate` + `prisma migrate` + `next build`
yarn db-nuke    # resets local db
yarn dx         # starts postgres db + runs migrations + seeds + starts next.js 
yarn test-dev   # runs e2e tests on dev
yarn test-start # runs e2e tests on `next start` - build required before
yarn test:unit  # runs normal jest unit tests
yarn test:e2e   # runs e2e tests

Files of note

Path Description
./prisma/schema.prisma Prisma schema
./src/api/trpc/[trpc].tsx tRPC response handler
./src/routers Your app's different tRPC-routers

Created by @alexdotjs.

About

mirror of https://github.com/trpc/trpc/tree/main/examples/next-prisma-starter

https://github.com/trpc/trpc/tree/main/examples/next-prisma-starter


Languages

Language:TypeScript 98.1%Language:JavaScript 1.5%Language:Shell 0.4%