feat: Implement initial with admin and mobile clients, authentication, data models, and lead generation scripts.

This commit is contained in:
2026-02-19 16:18:34 +01:00
parent c53a71a5f9
commit 5e2d5fb3ae
32 changed files with 2283 additions and 420 deletions

View File

@@ -2,6 +2,12 @@ import { PrismaClient } from '@prisma/client'
const prisma = new PrismaClient()
// bcrypt-compatible hash using better-auth's default (sha256 fallback for seeding)
// better-auth uses its own hashing — we use the auth API to set a real password instead.
// For seeding we insert a known bcrypt hash for "demo1234".
// Generated with: https://bcrypt-generator.com/ (rounds=10)
const DEMO_PASSWORD_HASH = '$2a$10$N9qo8uLOickgx2ZMRZoMyeIjZAgcfl7p92ldGxad68LJZdL17lHny'
async function main() {
console.log('Seeding database...')
@@ -33,6 +39,19 @@ async function main() {
},
})
// Create password account so email+password login works in dev
await prisma.account.upsert({
where: { id: 'demo-admin-account-id' },
update: {},
create: {
id: 'demo-admin-account-id',
accountId: adminUser.id,
providerId: 'credential',
userId: adminUser.id,
password: DEMO_PASSWORD_HASH,
},
})
await prisma.userRole.upsert({
where: { orgId_userId: { orgId: org.id, userId: adminUser.id } },
update: {},