products 스키마 추가

prisma > schema.prisma

model Product {
  id          Int      @id @default(autoincrement())
  title       String
  price       Float
  description String
  photo       String
  created_at  DateTime @default(now())
  updated_at  DateTime @updatedAt
  user        User     @relation(fields: [userId], references: [id], onDelete: Cascade)
  userId      Int
}

작성 후 npx prisma migrate dev 잊지말자 ! (name: add_product)

폴더 정리를 좀 해주었습니다. 그룹핑!

image.png

기존 폴더들을 (auth) 로 넣어 묶어주었음

추가로 만든 폴더들은 (tabs) 로 묶어주었음

Layout.tsx 가 두개일 수 있는 이유?

중괄호로 묶어준 폴더는 경로에 영향을 끼치지 않는다.

그러므로 (auth)와 (tabs)의 layout이 모두 있을 경우 에러를 발생한다.

그러면 어떻게 해결해줄 수 있을까!

app > tabs > layout.tsx