security: remove hardcoded DB credentials from code files

This commit is contained in:
AyrisAI
2026-07-23 17:58:07 +03:00
parent a2d6cf653d
commit f67afd32da
3 changed files with 13 additions and 9 deletions
+7 -5
View File
@@ -2,9 +2,11 @@ import { Pool } from 'pg';
import { PrismaPg } from '@prisma/adapter-pg';
import { PrismaClient } from '@prisma/client';
const connectionString =
process.env.DATABASE_URL ||
'postgres://postgres:mBTWE2cDKGExtpktguD3HPe8y9Xr9kWFYdxV4WHQKISLLGoBAS4UdtfSCfXwvPpq@65.109.236.58:37298/postgres';
const connectionString = process.env.DATABASE_URL;
if (!connectionString) {
throw new Error('[Seed] DATABASE_URL environment variable is not set!');
}
const pool = new Pool({ connectionString });
const adapter = new PrismaPg(pool);
@@ -20,6 +22,7 @@ async function main() {
await db.lesson.deleteMany();
await db.cheatsheetItem.deleteMany();
await db.cheatsheet.deleteMany();
await db.prompt.deleteMany();
// Create Lessons
await db.lesson.create({
@@ -93,13 +96,12 @@ async function main() {
});
// Create Prompts
await db.prompt.deleteMany();
await db.prompt.create({
data: {
slug: 'fullstack-nextjs-architect-prompt',
title: 'Full-Stack Next.js 16 System Architect Prompt',
category: 'System Architecture',
description: 'System prompt for building production-ready Next.js 16 App Router code with Server Actions and Prisma.',
description: 'System prompt for building production-ready Next.js 16 App Router code.',
content: `You are a Senior Next.js 16 Architect. Always use TypeScript strict mode, App Router, proxy.ts for middleware, Server Actions with Zod validation, and Prisma ORM.`,
tags: ['Next.js', 'System Prompt', 'AI Architecture'],
isOpen: false,