Add Prayer Times, Dhikr counter, Quran tracker with mobile UI overhaul
- Prayer times page: arc progress ring, next-prayer countdown, clean prayer list - Dhikr counter: SVG ring with glow, 3-phase sequence (SubhanAllah/Alhamdulillah/AllahuAkbar), streak tracking - Daily Quran reading tracker API routes (GET/POST) - Bottom nav updated: Prayer + Dhikr tabs, Repeat2 icon for dhikr, Moon for prayer - Home page redirects to /prayer as primary entry point - Dockerfile: openssl added to builder stage, explicit prisma schema path fixes build - Schema: dhikrStreak, quranStreak on User; DhikrSession and QuranReading models - Stub wallet top-up checkout to fix TypeScript build error Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,189 @@
|
||||
generator client {
|
||||
provider = "prisma-client-js"
|
||||
binaryTargets = ["native", "linux-musl", "debian-openssl-3.0.x"]
|
||||
}
|
||||
|
||||
datasource db {
|
||||
provider = "sqlite"
|
||||
url = env("DATABASE_URL")
|
||||
}
|
||||
|
||||
model User {
|
||||
id String @id @default(cuid())
|
||||
email String @unique
|
||||
name String
|
||||
passwordHash String?
|
||||
flhBalance Int @default(0)
|
||||
isPro Boolean @default(false)
|
||||
isPremium Boolean @default(false)
|
||||
experienceLevel String?
|
||||
madhab String?
|
||||
coachPersona String?
|
||||
preferredName String?
|
||||
coachingGoals String?
|
||||
lastCoachedAt DateTime?
|
||||
dailyMsgCount Int @default(0)
|
||||
dailyMsgResetAt DateTime?
|
||||
stripeCustomerId String?
|
||||
stripeSubscriptionId String?
|
||||
trialEndsAt DateTime?
|
||||
dhikrStreak Int @default(0)
|
||||
dhikrStreakDate DateTime?
|
||||
quranStreak Int @default(0)
|
||||
quranStreakDate DateTime?
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
listings Listing[]
|
||||
purchases Purchase[] @relation("BuyerPurchases")
|
||||
sales Purchase[] @relation("SellerPurchases")
|
||||
cashouts CashoutRequest[]
|
||||
halalBookmarks HalalBookmark[]
|
||||
halalUsage HalalUsage?
|
||||
forumThreads ForumThread[]
|
||||
forumPosts ForumPost[]
|
||||
chatHistory ChatHistory[]
|
||||
}
|
||||
|
||||
model Listing {
|
||||
id String @id @default(cuid())
|
||||
title String
|
||||
description String
|
||||
category String
|
||||
priceFlh Int
|
||||
sellerId String
|
||||
seller User @relation(fields: [sellerId], references: [id])
|
||||
status String @default("active")
|
||||
featured Boolean @default(false)
|
||||
featuredUntil DateTime?
|
||||
fileType String?
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
purchases Purchase[]
|
||||
}
|
||||
|
||||
model Purchase {
|
||||
id String @id @default(cuid())
|
||||
listingId String
|
||||
listing Listing @relation(fields: [listingId], references: [id])
|
||||
buyerId String
|
||||
buyer User @relation("BuyerPurchases", fields: [buyerId], references: [id])
|
||||
sellerId String
|
||||
seller User @relation("SellerPurchases", fields: [sellerId], references: [id])
|
||||
amountFlh Int
|
||||
platformFee Int
|
||||
sellerPayout Int
|
||||
autoConfirmAt DateTime
|
||||
createdAt DateTime @default(now())
|
||||
}
|
||||
|
||||
model CashoutRequest {
|
||||
id String @id @default(cuid())
|
||||
userId String
|
||||
user User @relation(fields: [userId], references: [id])
|
||||
amountFlh Int
|
||||
fiatAmount Float
|
||||
status String @default("pending")
|
||||
createdAt DateTime @default(now())
|
||||
}
|
||||
|
||||
model ForumCategory {
|
||||
id String @id @default(cuid())
|
||||
name String @unique
|
||||
description String?
|
||||
icon String?
|
||||
order Int?
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
threads ForumThread[]
|
||||
}
|
||||
|
||||
model ForumThread {
|
||||
id String @id @default(cuid())
|
||||
title String
|
||||
content String
|
||||
categoryId String
|
||||
category ForumCategory @relation(fields: [categoryId], references: [id])
|
||||
authorId String
|
||||
author User @relation(fields: [authorId], references: [id])
|
||||
pinned Boolean @default(false)
|
||||
shariahStatus String @default("pending")
|
||||
shariahFlags String?
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
posts ForumPost[]
|
||||
}
|
||||
|
||||
model ForumPost {
|
||||
id String @id @default(cuid())
|
||||
content String
|
||||
threadId String
|
||||
thread ForumThread @relation(fields: [threadId], references: [id])
|
||||
authorId String
|
||||
author User @relation(fields: [authorId], references: [id])
|
||||
shariahStatus String @default("pending")
|
||||
shariahFlags String?
|
||||
createdAt DateTime @default(now())
|
||||
}
|
||||
|
||||
model ChatHistory {
|
||||
id String @id @default(cuid())
|
||||
userId String
|
||||
user User @relation(fields: [userId], references: [id])
|
||||
role String
|
||||
content String
|
||||
metadata String?
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
@@index([userId])
|
||||
}
|
||||
|
||||
model HalalBookmark {
|
||||
id String @id @default(cuid())
|
||||
userId String
|
||||
user User @relation(fields: [userId], references: [id])
|
||||
itemId String
|
||||
itemType String
|
||||
label String?
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
@@index([userId])
|
||||
}
|
||||
|
||||
model HalalUsage {
|
||||
userId String @id
|
||||
user User @relation(fields: [userId], references: [id])
|
||||
queriesUsed Int @default(0)
|
||||
queriesLimit Int @default(100)
|
||||
periodEnd DateTime?
|
||||
}
|
||||
|
||||
model HalalPlaceCache {
|
||||
id String @id @default(cuid())
|
||||
cacheKey String @unique
|
||||
data String
|
||||
expiresAt DateTime
|
||||
}
|
||||
|
||||
model DhikrSession {
|
||||
id String @id @default(cuid())
|
||||
userId String
|
||||
date String
|
||||
count Int @default(0)
|
||||
completed Boolean @default(false)
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
@@unique([userId, date])
|
||||
@@index([userId])
|
||||
}
|
||||
|
||||
model QuranReading {
|
||||
id String @id @default(cuid())
|
||||
userId String
|
||||
date String
|
||||
pagesRead Int @default(0)
|
||||
goalPages Int @default(1)
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
@@unique([userId, date])
|
||||
@@index([userId])
|
||||
}
|
||||
Reference in New Issue
Block a user