Initial scaffold: offertesysteem (clients, projects, quotes, quote_items)
- Next.js 15 + TypeScript + Tailwind, standalone output - SQLite schema: users, clients, projects, quotes, quote_items - HMAC-signed sessie-cookie auth - Dockerfile (Node 22 Alpine, multi-stage) - create-admin script - Doel: portal.rikxplatform.nl Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import { getDb } from "../lib/db";
|
||||
import { hashPassword } from "../lib/auth";
|
||||
|
||||
const email = process.argv[2];
|
||||
const password = process.argv[3];
|
||||
const name = process.argv[4] || "Admin";
|
||||
|
||||
if (!email || !password) {
|
||||
console.error("Gebruik: npx tsx scripts/create-admin.ts <email> <wachtwoord> [naam]");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const db = getDb();
|
||||
const hash = hashPassword(password);
|
||||
db.prepare("INSERT INTO users (email, password_hash, name) VALUES (?, ?, ?)").run(email, hash, name);
|
||||
console.log(`Admin aangemaakt: ${email}`);
|
||||
Reference in New Issue
Block a user