ksyunnnn / hands-on-t3-app

2022年10月1日(土) at 渋谷 16:00~
1 stars 1 forks source link

T3 Stack触り切る&まとめる #3

Open ksyunnnn opened 2 years ago

ksyunnnn commented 2 years ago

What

触っておく

ksyunnnn commented 2 years ago

とりあえずなんか保存したり認証したりしたい

ksyunnnn commented 2 years ago

T3 Stack

ksyunnnn commented 2 years ago

tRPC

What

スキーマの定義や型生成なしに、型安全なAPIが構築できるツール

なにがうれしいの

左: server.ts / 右: client.ts fc3155bc1eccc1ed764f3bcd8a817afc

https://trpc.io/docs/v10/nextjs

Screen Shot 2022-09-27 at 9 30 58

N/A

https://trpc.io/docs/v10/#features https://github.com/prisma/prisma-examples/blob/latest/typescript/rest-nextjs-api-routes-auth/pages/api/publish/%5Bid%5D.ts

zod

APIのルーティングをしてくれとる

(追記: ↑これは語弊あるな。tRPC内のルーティングってのほうが正しそう) (NextjsがルーティングしてくれるAPIも使えるし)

  useEffect(()=>{
    (async()=>{
      const res = await fetch("/api/examples")
      console.log({res: await res.json()})
    })()
  },[])

ここでPrisma使ってデータ取得したり作成したりするんやな https://github.com/ksyunnnn/hands-on-t3-app/blob/57a01890ca8b2b18b69934d125cb69f13834ee59/sample/src/server/router/example.ts#L4-L21

example.hello部分が上記で定義したルートぽい https://github.com/ksyunnnn/hands-on-t3-app/blob/57a01890ca8b2b18b69934d125cb69f13834ee59/sample/src/pages/index.tsx#L6

ksyunnnn commented 2 years ago

Prisma

What

Prisma is an ORM that helps app developers build faster and make fewer errors. Combined with its Data Platform developers gain reliability and visibility when working with databases.

Prisma は、アプリ開発者がより速くビルドし、エラーを減らすのに役立つ ORM です。 その Data Platform 開発者と組み合わせることで、データベースを操作する際の信頼性と可視性が得られます。

ORMってなんなん👉 https://utouto97.hatenablog.com/entry/2021/07/21/224759

N/A

ksyunnnn commented 2 years ago

Tailwind CSS

What

N/A

VSCodeにこの拡張機能いれとくと便利👇 https://marketplace.visualstudio.com/items?itemName=bradlc.vscode-tailwindcss image

コピペで使えるSVG https://heroicons.dev/

UIライブラリぽいもの https://flowbite.com/docs/getting-started/introduction/

Headless UI おすすめ https://headlessui.com/

ドキュメント https://tailwindcss.com/docs/installation

ksyunnnn commented 2 years ago

NextAuth.js

What

ksyunnnn commented 2 years ago

TypeScript

What

ksyunnnn commented 2 years ago

Next.js

What

N/A

研修資料 https://speakerdeck.com/recruitengineers/nextjs-2022