feat: Set up initial monorepo structure for admin and mobile applications with core configurations and database integration.

This commit is contained in:
2026-02-20 12:58:54 +01:00
parent 5e2d5fb3ae
commit b7f8221095
52 changed files with 2200 additions and 175 deletions

View File

@@ -0,0 +1,34 @@
import { auth } from './lib/auth'
import { PrismaClient } from '@prisma/client'
const prisma = new PrismaClient()
async function seed() {
console.log('Cleaning up existing superadmin if exists...')
// Delete the existing user to avoid constraints
await prisma.user.deleteMany({
where: { email: 'superadmin@innungsapp.de' },
})
console.log('Seeding superadmin via better-auth API...')
try {
const user = await auth.api.signUpEmail({
body: {
email: 'superadmin@innungsapp.de',
password: 'demo1234',
name: 'Super Admin',
}
})
// Check if better-auth actually uses the Prisma DB directly here
// It should, as auth is configured with the prisma instance
console.log('Superadmin created successfully! ID:', user.user.id)
} catch (err: any) {
console.error('Error creating superadmin:', err.message || err)
}
}
seed()
.catch(console.error)
.finally(() => prisma.$disconnect())