initial commit: project completion with proper gitignore

This commit is contained in:
AyrisAI
2026-05-16 00:43:22 +03:00
commit e708ba2156
84 changed files with 11035 additions and 0 deletions

13
lib/db.ts Normal file
View File

@@ -0,0 +1,13 @@
import postgres from 'postgres';
const globalForSql = global as unknown as { sql: postgres.Sql<{}> };
const sql = globalForSql.sql || postgres(process.env.DATABASE_URL!, {
max: 10, // Limit maximum connections
idle_timeout: 20, // Close idle connections after 20 seconds
connect_timeout: 10,
});
if (process.env.NODE_ENV !== 'production') globalForSql.sql = sql;
export default sql;