GithubHelp home page GithubHelp logo

trpc-tutorial's Introduction

tRPC with Next.js, TypeScript & Prisma

Why you should be learning & using tRPC

  • Making E2E type-safe APIs is fun and easy
  • Gives you a deeper understanding of Next.js
  • Going to be very popular (prediction)

Technologies used

  • tRPC
  • TypeScript
  • Prisma (Postgres)
  • Zod - Schema validation & type generation
  • nodemailer - Sending OTP emails

Features

  • Register user
  • Login with OTP
  • Create a post
  • View a post
  • List posts

What will you learn?

  • Enough tRPC to be productive
  • Using Next.js as a monorepo
  • Some TypeScript
  • OPT login flow

What you will need

  • A running instance of a DB (Postgres, Mongo, SQLlite, MYSQL) - Postgres

Video structure

  1. Demo

  2. Code walk-through

  3. Bootstrap application

    • Create app router
    • Create router base
    • Configure _app.tsx
    • Make a request
    • Configure prisma
  4. Register user

    • Create a user model
    • Create register user schema
    • Configure user router
    • Register user resolver
    • Register UI
  5. User login

    • Add login token to prisma
    • Login schema
    • Configure mailer
    • Verify login schema
    • Login resolver
    • Verify login resolver
    • Login UI
  6. Create post

    • Add post to prisma
    • Create post router
    • Create post resolver
    • Create post UI
  7. List posts

    • List posts resolver
    • List posts UI
  8. View single post

    • Query post schema
    • Query post resolver
    • Post UI

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.