- Implemented WriteReviewPage for users to submit reviews with ratings and playtime. - Created global CSS styles for consistent theming across the application. - Established RootLayout for metadata and global styles. - Developed LoginPage for user authentication with email/password and Steam login options. - Built Home page to display game search results and recent reviews. - Added LinkSteamPage for linking Steam accounts to user profiles. - Created ProfilePage to manage user information and display their reviews. - Developed GameCard and ReviewCard components for displaying games and reviews. - Implemented Header component for navigation and user session management. - Added Providers component to wrap the application with session context. - Integrated NextAuth for user authentication with Steam and credentials. - Set up Prisma client for database interactions. - Created Steam API utility functions for fetching game and user data. - Configured TypeScript settings for the project.
73 lines
2.0 KiB
Plaintext
73 lines
2.0 KiB
Plaintext
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "postgresql"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model User {
|
|
id String @id @default(uuid())
|
|
email String @unique
|
|
username String @unique
|
|
passwordHash String @map("password_hash")
|
|
steamId String? @unique @map("steam_id")
|
|
steamPersonaname String? @map("steam_personaname")
|
|
steamAvatar String? @map("steam_avatar")
|
|
createdAt DateTime @default(now()) @map("created_at")
|
|
|
|
reviews Review[]
|
|
votes Vote[]
|
|
|
|
@@map("users")
|
|
}
|
|
|
|
model Game {
|
|
appId Int @id @map("app_id")
|
|
name String
|
|
description String? @db.Text
|
|
headerImage String? @map("header_image")
|
|
capsuleImage String? @map("capsule_image")
|
|
backgroundImage String? @map("background_image")
|
|
releaseDate String? @map("release_date")
|
|
developers String[] @default([])
|
|
publishers String[] @default([])
|
|
genres String[] @default([])
|
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
|
|
reviews Review[]
|
|
|
|
@@map("games")
|
|
}
|
|
|
|
model Review {
|
|
id String @id @default(uuid())
|
|
userId String @map("user_id")
|
|
appId Int @map("app_id")
|
|
content String @db.Text
|
|
rating Int
|
|
playtimeHours Decimal? @map("playtime_hours") @db.Decimal(6, 2)
|
|
createdAt DateTime @default(now()) @map("created_at")
|
|
|
|
user User @relation(fields: [userId], references: [id])
|
|
game Game @relation(fields: [appId], references: [appId])
|
|
votes Vote[]
|
|
|
|
@@map("reviews")
|
|
}
|
|
|
|
model Vote {
|
|
id String @id @default(uuid())
|
|
userId String @map("user_id")
|
|
reviewId String @map("review_id")
|
|
voteType Int @map("vote_type")
|
|
createdAt DateTime @default(now()) @map("created_at")
|
|
|
|
user User @relation(fields: [userId], references: [id])
|
|
review Review @relation(fields: [reviewId], references: [id])
|
|
|
|
@@unique([userId, reviewId]) @map("user_review_unique")
|
|
@@map("votes")
|
|
}
|