Add BMAD framework, authentication, and new features
This commit is contained in:
11
keep-notes/scripts/check-users.js
Normal file
11
keep-notes/scripts/check-users.js
Normal file
@@ -0,0 +1,11 @@
|
||||
const { PrismaClient } = require('@prisma/client');
|
||||
const prisma = new PrismaClient();
|
||||
|
||||
async function main() {
|
||||
const users = await prisma.user.findMany({
|
||||
select: { email: true, name: true }
|
||||
});
|
||||
console.log('Registered users:', JSON.stringify(users, null, 2));
|
||||
}
|
||||
|
||||
main().catch(console.error).finally(() => prisma.$disconnect());
|
||||
12
keep-notes/scripts/check-users.ts
Normal file
12
keep-notes/scripts/check-users.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import 'dotenv/config'
|
||||
import { PrismaClient } from '@prisma/client'
|
||||
const prisma = new PrismaClient()
|
||||
|
||||
async function main() {
|
||||
const users = await prisma.user.findMany()
|
||||
console.log(JSON.stringify(users, null, 2))
|
||||
}
|
||||
|
||||
main()
|
||||
.catch(e => console.error(e))
|
||||
.finally(async () => await prisma.$disconnect())
|
||||
22
keep-notes/scripts/seed-user.ts
Normal file
22
keep-notes/scripts/seed-user.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { PrismaClient } from '@prisma/client'
|
||||
import bcrypt from 'bcryptjs'
|
||||
|
||||
const prisma = new PrismaClient()
|
||||
|
||||
async function main() {
|
||||
const hashedPassword = await bcrypt.hash('password123', 10)
|
||||
const user = await prisma.user.upsert({
|
||||
where: { email: 'test@example.com' },
|
||||
update: {},
|
||||
create: {
|
||||
email: 'test@example.com',
|
||||
name: 'Test User',
|
||||
password: hashedPassword,
|
||||
},
|
||||
})
|
||||
console.log('User created:', user)
|
||||
}
|
||||
|
||||
main()
|
||||
.catch(e => console.error(e))
|
||||
.finally(async () => await prisma.$disconnect())
|
||||
Reference in New Issue
Block a user