Files
bikeApp/prisma/schema.prisma
T
fegger cb0ff5feb7 1. Authentication Library (src/lib/auth.ts)
2. Authentication Routes
3. Updated Data Store (`src/lib/db.ts`)
4. Updated API Routes
5. Updated Frontend Component (`src/components/BikeBuilderApp.tsx`)
2026-05-19 16:07:57 +02:00

87 lines
2.3 KiB
Plaintext

generator client {
provider = "prisma-client-js"
output = "../node_modules/.prisma/client"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model User {
id String @id @default(cuid())
email String @unique
passwordHash String
name String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
builds BikeBuild[]
reviews RideReview[]
preference RiderPreference?
}
model Product {
id String @id
category String
position String?
brand String
model String
imagePath String?
specs String
setup String
sources String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model BikeBuild {
id String @id @default(cuid())
name String
riderWeightKg Int
discipline String
riderLevel String
rideStyle String
frameId String?
forkId String?
shockId String?
frontTireId String?
rearTireId String?
setup String
imagePath String?
userId String
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
reviews RideReview[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model RideReview {
id String @id @default(cuid())
buildId String
build BikeBuild @relation(fields: [buildId], references: [id], onDelete: Cascade)
userId String
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
suspFeel Int
frontGrip Int
rearGrip Int
rollSpeed Int
confidence Int
bottomOut Boolean @default(false)
harshHit Boolean @default(false)
wallow Boolean @default(false)
smallBump Boolean @default(false)
notes String?
advice String?
createdAt DateTime @default(now())
}
model RiderPreference {
id String @id @default(cuid())
userId String @unique
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
harshTendency Int @default(0)
softTendency Int @default(0)
gripPreference Int @default(0)
updatedAt DateTime @updatedAt
}