feat: add reminders page, BMad skills upgrade, MCP server refactor

- Add reminders page with navigation support
- Upgrade BMad builder module to skills-based architecture
- Refactor MCP server: extract tools and auth into separate modules
- Add connections cache, custom AI provider support
- Update prisma schema and generated client
- Various UI/UX improvements and i18n updates
- Add service worker for PWA support

Made-with: Cursor
This commit is contained in:
Sepehr Ramezani
2026-04-13 21:02:53 +02:00
parent 18ed116e0d
commit fa7e166f3e
3099 changed files with 397228 additions and 14584 deletions

View File

@@ -0,0 +1,35 @@
import { PrismaClient } from '@prisma/client'
const prisma = new PrismaClient()
async function main() {
const users = await prisma.user.findMany({
include: {
aiSettings: true,
notes: {
take: 5,
orderBy: { updatedAt: 'desc' }
}
}
})
console.log('Total Users:', users.length)
for (const user of users) {
console.log(`User: ${user.email} (${user.id})`)
console.log(` AI Settings:`, user.aiSettings)
console.log(` Recent 5 Notes:`)
for (const note of user.notes) {
console.log(` ID: ${note.id}, Title: ${note.title}, Updated: ${note.updatedAt}, Dismissed: ${JSON.stringify(note)}`)
}
}
}
main()
.catch(e => {
console.error(e)
process.exit(1)
})
.finally(async () => {
await prisma.$disconnect()
})

View File

@@ -0,0 +1,31 @@
import { PrismaClient } from '../prisma/client-generated'
import bcrypt from 'bcryptjs'
const prisma = new PrismaClient()
async function main() {
const email = 'test@example.com'
const password = 'password123'
const hashedPassword = await bcrypt.hash(password, 10)
const user = await prisma.user.upsert({
where: { email },
update: { password: hashedPassword },
create: {
email,
name: 'Test User',
password: hashedPassword,
aiSettings: {
create: {
showRecentNotes: true // Ensure this is true!
}
}
}
})
console.log(`User created/updated: ${user.email}`)
}
main()
.catch(e => console.error(e))
.finally(async () => await prisma.$disconnect())

View File

@@ -0,0 +1,60 @@
import { PrismaClient } from '../prisma/client-generated'
const prisma = new PrismaClient()
async function main() {
// 1. Get a user
const user = await prisma.user.findFirst()
if (!user) {
console.log('No user found in database.')
return
}
console.log(`Checking for User ID: ${user.id} (${user.email})`)
// 2. Simulate logic from app/actions/notes.ts
const sevenDaysAgo = new Date()
sevenDaysAgo.setDate(sevenDaysAgo.getDate() - 7)
sevenDaysAgo.setHours(0, 0, 0, 0)
console.log(`Filtering for notes updated after: ${sevenDaysAgo.toISOString()}`)
// 3. Query Raw
const allNotes = await prisma.note.findMany({
where: { userId: user.id },
select: { id: true, title: true, contentUpdatedAt: true, updatedAt: true, dismissedFromRecent: true, isArchived: true }
})
console.log(`\nTotal Notes for User: ${allNotes.length}`)
// 4. Check "Recent" candidates
const recentCandidates = allNotes.filter(n => {
const noteDate = new Date(n.contentUpdatedAt)
return noteDate >= sevenDaysAgo
})
console.log(`Notes passing date filter: ${recentCandidates.length}`)
recentCandidates.forEach(n => {
console.log(` - [${n.title}] Updated: ${n.contentUpdatedAt.toISOString()} | Dismissed: ${n.dismissedFromRecent} | Archived: ${n.isArchived}`)
})
// 5. Check what the actual query returns
const actualQuery = await prisma.note.findMany({
where: {
userId: user.id,
contentUpdatedAt: { gte: sevenDaysAgo },
isArchived: false,
dismissedFromRecent: false
},
orderBy: { contentUpdatedAt: 'desc' },
take: 3
})
console.log(`\nActual Query Returns: ${actualQuery.length} notes`)
actualQuery.forEach(n => {
console.log(` -> [${n.title}]`)
})
}
main()
.catch(e => console.error(e))
.finally(async () => await prisma.$disconnect())

View File

@@ -0,0 +1,39 @@
import { PrismaClient } from '../prisma/client-generated'
const prisma = new PrismaClient()
async function main() {
console.log('Updating user settings to show recent notes...')
const updateResult = await prisma.userAISettings.updateMany({
data: {
showRecentNotes: true
}
})
console.log(`Updated ${updateResult.count} user settings.`)
// Verify and Create missing
const users = await prisma.user.findMany({
include: { aiSettings: true }
})
for (const u of users) {
if (!u.aiSettings) {
console.log(`User ${u.id} has no settings. Creating default...`)
await prisma.userAISettings.create({
data: {
userId: u.id,
showRecentNotes: true
}
})
console.log(`Created settings for ${u.id}`)
} else {
console.log(`User ${u.id}: showRecentNotes = ${u.aiSettings.showRecentNotes}`)
}
}
}
main()
.catch(e => console.error(e))
.finally(async () => await prisma.$disconnect())