Files
Nemo b273f1a573 feat: initial NFC Attendance Hub implementation
- Multi-tenant client management with unique API keys
- Semaphore SMS integration (per-client key + sender name + credit balance)
- DB-based SMS queue with 3-attempt retry and exponential backoff
- Failed SMS dashboard with manual retry button
- Reports page with date/client filter and CSV export
- Admin auth via NextAuth (email/password)
- Docker Compose setup (app + PostgreSQL 16)
- Prisma 5 schema with SmsQueue, SmsLog, Client, User models

Tech: Next.js 14 App Router + TypeScript + Tailwind CSS + Prisma + PostgreSQL
2026-03-12 08:49:13 +00:00

25 lines
736 B
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { PrismaClient } from '@prisma/client'
import bcrypt from 'bcryptjs'
const prisma = new PrismaClient()
async function main() {
const email = process.env.SEED_EMAIL || 'admin@nfchub.local'
const password = process.env.SEED_PASSWORD || 'admin123'
const existing = await prisma.user.findUnique({ where: { email } })
if (!existing) {
const hashed = await bcrypt.hash(password, 12)
await prisma.user.create({
data: { email, password: hashed, name: 'Admin', role: 'ADMIN' },
})
console.log(`✅ Created admin user: ${email}`)
} else {
console.log(` Admin user already exists: ${email}`)
}
}
main()
.catch(e => { console.error(e); process.exit(1) })
.finally(() => prisma.$disconnect())