# Installation & Setup

### 1️⃣ Install Node.js and npm
Ensure you have **Node.js** and **npm** installed. If not, install it from:
👉 [Download Node.js](https://nodejs.org/)

Check installation:
```sh
node -v
npm -v
```

### 2️⃣ Install PostgreSQL Database
Download and install **PostgreSQL**:
👉 [Download PostgreSQL](https://www.postgresql.org/download/)

After installation, create a new database:
```sh
psql -U postgres
CREATE DATABASE real-estate-backend;
```

### 3️⃣ Clone the Repository
```sh
git clone https://github.com/AHMAD-JX/Hozn-RealEstate-Fullstack.git
cd Hozn-RealEstate-Fullstack
```

### 2️⃣ Install dependencies:
```sh
# Install frontend dependencies
cd Hozn-RealEstate
npm install

# Install backend dependencies
cd ../real-estate-backend
npm install
```

### 3️⃣ Setup environment variables:
**Frontend (`.env.local`):**
```
NEXT_PUBLIC_API_URL=http://localhost:5000/api
```

**Backend (`.env`):**
```
PORT=5000
DATABASE_URL=postgres://user:password@localhost:5432/realestate
JWT_SECRET=your_jwt_secret
```

### 4️⃣ Run the project:
```sh
# Start backend server
cd real-estate-backend
npm run dev

# Start frontend
cd ../hozn-frontend

npx ts-node src/server.ts
or
npm run dev

```