feat: Implement pricing page, AI generation/transformation APIs, user/project management, and database schema.

This commit is contained in:
2026-02-27 23:08:56 +01:00
parent ec89ddc9dc
commit 23560ac9c3
18 changed files with 837 additions and 94 deletions

View File

@@ -7,16 +7,38 @@ generator client {
}
// =====================
// AUTH
// AUTH & SUBSCRIPTIONS
// =====================
model Plan {
id String @id // e.g., 'free', 'pro', 'master'
name String @unique
displayName String
price Float
description String
maxProjects Int // -1 for unlimited
maxAiActions Int // -1 for unlimited
features String[]
isPopular Boolean @default(false)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
users User[]
}
model User {
id String @id @default(cuid())
name String?
email String @unique
hashedPassword String
avatar String?
bio String?
plan String @default("free") // free | pro | master
// Legacy string plan (temporarily kept to avoid DB drop errors)
plan String @default("free")
// New Subscription
planId String? @default("free")
subscriptionPlan Plan? @relation(fields: [planId], references: [id])
aiActionsUsed Int @default(0)
dailyWordGoal Int @default(500)
writingStreak Int @default(0)