Move Add Prayer button to sidebar and implement comprehensive prayer functionality

- Integrated prayer data with Prisma database schema
- Updated API endpoints to use actual database
- Implemented AI prayer generation with Azure OpenAI
- Added user authentication for prayer creation
- Moved Add Prayer button from FAB to sidebar top
- Added prayer count tracking and user prayer status

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
andupetcu
2025-09-21 23:17:20 +03:00
parent 6492601355
commit 5a3c6a6691
7 changed files with 669 additions and 259 deletions

View File

@@ -25,6 +25,7 @@ model User {
notes Note[]
chatMessages ChatMessage[]
prayerRequests PrayerRequest[]
userPrayers UserPrayer[]
readingHistory ReadingHistory[]
preferences UserPreference[]
@@ -186,16 +187,23 @@ model Note {
model PrayerRequest {
id String @id @default(uuid())
userId String?
content String @db.Text
isAnonymous Boolean @default(true)
title String
description String @db.Text
category String // personal, family, health, work, ministry, world
author String // Display name (can be "Anonymous" or user's name)
isAnonymous Boolean @default(false)
prayerCount Int @default(0)
isActive Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
user User? @relation(fields: [userId], references: [id], onDelete: Cascade)
prayers Prayer[]
userPrayers UserPrayer[]
@@index([createdAt])
@@index([category])
@@index([isActive])
}
model Prayer {
@@ -209,6 +217,20 @@ model Prayer {
@@unique([requestId, ipAddress])
}
model UserPrayer {
id String @id @default(uuid())
userId String
requestId String
createdAt DateTime @default(now())
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
request PrayerRequest @relation(fields: [requestId], references: [id], onDelete: Cascade)
@@unique([userId, requestId])
@@index([userId])
@@index([requestId])
}
model ReadingHistory {
id String @id @default(uuid())
userId String