mirror of
https://github.com/Hestia-Homes/survey-extraction.git
synced 2026-06-08 11:17:29 +00:00
added env files for production
This commit is contained in:
parent
26c7fa019b
commit
254aeb647e
7 changed files with 1394 additions and 9 deletions
0
frontend/.env
Normal file
0
frontend/.env
Normal file
1
frontend/.env.development
Normal file
1
frontend/.env.development
Normal file
|
|
@ -0,0 +1 @@
|
|||
DATABASE_URL=postgresql://postgres:makingwarmhomes@db:5432/postgres
|
||||
1
frontend/.env.production
Normal file
1
frontend/.env.production
Normal file
|
|
@ -0,0 +1 @@
|
|||
DATABASE_URL=postgresql://postgres:makingwarmhomes@terraform-20250331175522503500000002.cdgzupxvdyp0.eu-west-2.rds.amazonaws.com:5432/surveyDB
|
||||
2
frontend/.gitignore
vendored
2
frontend/.gitignore
vendored
|
|
@ -31,7 +31,7 @@ yarn-error.log*
|
|||
.pnpm-debug.log*
|
||||
|
||||
# env files (can opt-in for committing if needed)
|
||||
.env*
|
||||
# .env*
|
||||
|
||||
# vercel
|
||||
.vercel
|
||||
|
|
|
|||
1370
frontend/package-lock.json
generated
1370
frontend/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -9,19 +9,25 @@
|
|||
"lint": "next lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"dotenv": "^16.5.0",
|
||||
"drizzle-orm": "^0.44.0",
|
||||
"next": "15.3.2",
|
||||
"pg": "^8.16.0",
|
||||
"postgres": "^3.4.7",
|
||||
"react": "^19.0.0",
|
||||
"react-dom": "^19.0.0",
|
||||
"next": "15.3.2"
|
||||
"react-dom": "^19.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5",
|
||||
"@eslint/eslintrc": "^3",
|
||||
"@tailwindcss/postcss": "^4",
|
||||
"@types/node": "^20",
|
||||
"@types/pg": "^8.15.2",
|
||||
"@types/react": "^19",
|
||||
"@types/react-dom": "^19",
|
||||
"@tailwindcss/postcss": "^4",
|
||||
"tailwindcss": "^4",
|
||||
"drizzle-kit": "^0.31.1",
|
||||
"eslint": "^9",
|
||||
"eslint-config-next": "15.3.2",
|
||||
"@eslint/eslintrc": "^3"
|
||||
"tailwindcss": "^4",
|
||||
"typescript": "^5"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
11
frontend/src/app/db/db.ts
Normal file
11
frontend/src/app/db/db.ts
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import { drizzle } from 'drizzle-orm/postgres-js';
|
||||
import postgres from 'postgres';
|
||||
|
||||
if (!process.env.DATABASE_URL) {
|
||||
throw new Error("DATABASE_URL is not defined in environment variables");
|
||||
}
|
||||
|
||||
|
||||
const queryClient = postgres(process.env.DATABASE_URL);
|
||||
const db = drizzle({ client: queryClient });
|
||||
const result = await db.execute('select 1');
|
||||
Loading…
Add table
Reference in a new issue