Index: backend/.env.example
===================================================================
--- backend/.env.example	(revision 0f382c8a9e6f71eee97148bfdf563ae1f70860f7)
+++ backend/.env.example	(revision 0f382c8a9e6f71eee97148bfdf563ae1f70860f7)
@@ -0,0 +1,8 @@
+# Database Configuration
+# Copy this file to .env and fill in your actual database credentials
+
+DB_USER=your_database_user
+DB_HOST=localhost
+DB_NAME=your_database_name
+DB_PASSWORD=your_database_password
+DB_PORT=9999
Index: backend/README_ENV.md
===================================================================
--- backend/README_ENV.md	(revision 0f382c8a9e6f71eee97148bfdf563ae1f70860f7)
+++ backend/README_ENV.md	(revision 0f382c8a9e6f71eee97148bfdf563ae1f70860f7)
@@ -0,0 +1,51 @@
+# Environment Variables Setup
+
+This project uses environment variables to store sensitive database credentials securely.
+
+## Setup Instructions
+
+1. **Copy the example environment file:**
+   ```bash
+   cp .env.example .env
+   ```
+
+2. **Edit the `.env` file with your actual database credentials:**
+   ```bash
+   nano .env
+   ```
+
+3. **Fill in your database information:**
+   ```
+   DB_USER=your_database_user
+   DB_HOST=localhost
+   DB_NAME=your_database_name
+   DB_PASSWORD=your_database_password
+   DB_PORT=9999
+   ```
+
+## Security Notes
+
+- ✅ The `.env` file is included in `.gitignore` and will NOT be committed to git
+- ✅ The `.env.example` file shows the required variables without sensitive data
+- ✅ Database credentials are no longer hardcoded in the source code
+
+## Available Environment Variables
+
+| Variable | Description | Example |
+|----------|-------------|---------|
+| `DB_USER` | Database username | `db_202425z_va_prj_carzone_owner` |
+| `DB_HOST` | Database host | `localhost` |
+| `DB_NAME` | Database name | `db_202425z_va_prj_carzone` |
+| `DB_PASSWORD` | Database password | `your_secure_password` |
+| `DB_PORT` | Database port | `9999` |
+
+## Running the Application
+
+After setting up your `.env` file, start the application as usual:
+
+```bash
+npm install
+node index.js
+```
+
+The application will automatically load the environment variables from the `.env` file.
Index: backend/connectionModel.js
===================================================================
--- backend/connectionModel.js	(revision b52e4a373a687fe2b62a7e375e37f9bad322ad87)
+++ backend/connectionModel.js	(revision 0f382c8a9e6f71eee97148bfdf563ae1f70860f7)
@@ -1,25 +1,11 @@
+require('dotenv').config();
 const Pool = require("pg").Pool;
+
 const pool = new Pool({
-    // Connect to local postgre server
-
-    /* user: "postgres",
-    host: "localhost",
-    database: "postgres",
-    password: "3533",
-    port: 5432, */
-
-    //Connect to live finki postgre server
-
-    /* user: "db_202324z_va_prj_carzone_owner",
-    host: "localhost",
-    database: "db_202324z_va_prj_carzone",
-    password: "673f77a552e6",
-    port: 9999, */
-
-    user: "db_202425z_va_prj_carzone_owner",
-    host: "localhost",
-    database: "db_202425z_va_prj_carzone",
-    password: "af47de86cd4a",
-    port: 9999,
+    user: process.env.DB_USER,
+    host: process.env.DB_HOST,
+    database: process.env.DB_NAME,
+    password: process.env.DB_PASSWORD,
+    port: process.env.DB_PORT,
 });
 
Index: backend/node_modules/.package-lock.json
===================================================================
--- backend/node_modules/.package-lock.json	(revision b52e4a373a687fe2b62a7e375e37f9bad322ad87)
+++ backend/node_modules/.package-lock.json	(revision 0f382c8a9e6f71eee97148bfdf563ae1f70860f7)
@@ -245,4 +245,15 @@
         "node": ">= 0.8",
         "npm": "1.2.8000 || >= 1.4.16"
+      }
+    },
+    "node_modules/dotenv": {
+      "version": "17.2.2",
+      "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-17.2.2.tgz",
+      "integrity": "sha512-Sf2LSQP+bOlhKWWyhFsn0UsfdK/kCWRv1iuA2gXAwt3dyNabr6QSj00I2V10pidqz69soatm9ZwZvpQMTIOd5Q==",
+      "engines": {
+        "node": ">=12"
+      },
+      "funding": {
+        "url": "https://dotenvx.com"
       }
     },
Index: backend/package-lock.json
===================================================================
--- backend/package-lock.json	(revision b52e4a373a687fe2b62a7e375e37f9bad322ad87)
+++ backend/package-lock.json	(revision 0f382c8a9e6f71eee97148bfdf563ae1f70860f7)
@@ -11,4 +11,5 @@
       "dependencies": {
         "cors": "^2.8.5",
+        "dotenv": "^17.2.2",
         "express": "^4.18.2",
         "express-session": "^1.18.2",
@@ -259,4 +260,15 @@
         "node": ">= 0.8",
         "npm": "1.2.8000 || >= 1.4.16"
+      }
+    },
+    "node_modules/dotenv": {
+      "version": "17.2.2",
+      "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-17.2.2.tgz",
+      "integrity": "sha512-Sf2LSQP+bOlhKWWyhFsn0UsfdK/kCWRv1iuA2gXAwt3dyNabr6QSj00I2V10pidqz69soatm9ZwZvpQMTIOd5Q==",
+      "engines": {
+        "node": ">=12"
+      },
+      "funding": {
+        "url": "https://dotenvx.com"
       }
     },
Index: backend/package.json
===================================================================
--- backend/package.json	(revision b52e4a373a687fe2b62a7e375e37f9bad322ad87)
+++ backend/package.json	(revision 0f382c8a9e6f71eee97148bfdf563ae1f70860f7)
@@ -12,4 +12,5 @@
   "dependencies": {
     "cors": "^2.8.5",
+    "dotenv": "^17.2.2",
     "express": "^4.18.2",
     "express-session": "^1.18.2",
