3 Commits

Author SHA1 Message Date
f6af2d2827 supabase connection 2026-02-21 23:18:57 +05:30
40a33fc3b7 Remove test files and commit necessary changes 2026-02-21 23:03:55 +05:30
8b3a53342e updated pnpm 2026-02-21 20:31:04 +05:30
4 changed files with 242 additions and 2946 deletions

25
lib/db.ts Normal file
View File

@@ -0,0 +1,25 @@
import { Pool } from 'pg';
import { config } from 'dotenv';
// Load environment variables based on the environment
if (process.env.NODE_ENV === 'production') {
config({ path: '.env.production' });
} else {
config({ path: '.env.local' });
}
const connectionString = process.env.NODE_ENV === 'production'
? process.env.SUPABASE_URL
: process.env.DATABASE_URL;
console.log('Using connection string:', connectionString);
if (!connectionString) {
throw new Error('Database connection URL is not set in environment variables');
}
const pool = new Pool({
connectionString,
});
export default pool;

View File

@@ -11,17 +11,21 @@
"check": "biome check ."
},
"dependencies": {
"dotenv": "^17.3.1",
"next": "16.1.6",
"pg": "^8.18.0",
"react": "19.2.3",
"react-dom": "19.2.3"
},
"devDependencies": {
"@tailwindcss/postcss": "^4",
"@types/node": "^20",
"@types/pg": "^8.16.0",
"@types/react": "^19",
"@types/react-dom": "^19",
"biome": "^0.3.3",
"tailwindcss": "^4",
"ts-node": "^10.9.2",
"typescript": "^5"
}
}

3154
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -8,7 +8,7 @@
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "bundler",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "react-jsx",
@@ -20,7 +20,8 @@
],
"paths": {
"@/*": ["./*"]
}
},
"allowImportingTsExtensions": true
},
"include": [
"next-env.d.ts",