Initial commit of Dance School App

This commit is contained in:
kertenkerem
2026-01-08 00:51:13 +03:00
parent 902fb6e9bb
commit 260dea0713
48 changed files with 7923 additions and 1 deletions

29
scripts/seed.ts Normal file
View File

@@ -0,0 +1,29 @@
import 'dotenv/config';
import { PrismaClient } from '@prisma/client';
import bcrypt from 'bcryptjs';
// Manually read .env if needed, but dotenv/config should handle it
const prisma = new PrismaClient();
async function main() {
const password = await bcrypt.hash('admin123', 10);
const user = await prisma.user.upsert({
where: { username: 'admin' },
update: {},
create: {
username: 'admin',
password,
},
});
console.log('Admin user created:', user);
}
main()
.then(async () => {
await prisma.$disconnect();
})
.catch(async (e) => {
console.error(e);
await prisma.$disconnect();
process.exit(1);
});