first commit

This commit is contained in:
mstfyldz
2026-03-24 15:46:27 +03:00
parent 095d830279
commit 34b6a46604
33 changed files with 5212 additions and 81 deletions

25
db/seed.ts Normal file
View File

@@ -0,0 +1,25 @@
import { db } from "./index";
import { users } from "./schema";
import bcrypt from "bcryptjs";
import * as dotenv from "dotenv";
dotenv.config({ path: ".env.local" });
async function seed() {
const hashedPassword = await bcrypt.hash("admin123", 10);
await db.insert(users).values({
name: "Admin",
email: "admin@admin.com",
password: hashedPassword,
role: "admin",
}).onConflictDoNothing();
console.log("Admin user created.");
process.exit(0);
}
seed().catch(err => {
console.error(err);
process.exit(1);
});