Next.js 16 + Prisma + OpenAI
DevTutor AI와 데이터 흐름 예제
문서 기반 RAG 학습 도구를 추가했습니다. 기존 Server Component, SSR, CSR 예제도 남겨두어 어떤 코드가 서버와 브라우저에서 실행되는지 같이 비교할 수 있습니다.
DevTutor AI
Upload notes as text, generate embeddings, search pgvector chunks, and ask grounded questions with structured AI answers.
Server Component
Reads Prisma data directly in a server-rendered page without shipping database code to the browser.
SSR
Forces request-time rendering with connection() and shows when the page was rendered on the server.
CSR
Hydrates a Client Component first, then fetches Prisma-backed JSON through a Route Handler.
Route Handler POST
Creates a user from a Client Component by calling POST /api/users with JSON.
Password Auth
Registers and signs in with email/password through Auth.js Credentials and Prisma.
Register
Creates a password user through a Route Handler and stores only the scrypt password hash.