# Wasiyat Isolated Deployment Guide (GoDaddy VPS)

This guide provides steps to deploy Wasiyat alongside other projects without causing conflicts.

## 1. Preparation
1. **SSH into your VPS**: `ssh user@your-vps-ip`
2. **Dedicated Directory**: Create a folder to isolate the files.
   ```bash
   sudo mkdir -p /var/www/wasiyat
   sudo chown -R $USER:$USER /var/www/wasiyat
   ```

## 2. Upload & Extract
1. Upload `wasiyat_production_v1.zip` to your server (using SCP, SFTP, or GoDaddy File Manager).
2. Move it to the directory and unzip:
   ```bash
   mv wasiyat_production_v1.zip /var/www/wasiyat/
   cd /var/www/wasiyat
   unzip wasiyat_production_v1.zip
   ```

## 3. Process Management (PM2)
Using PM2 ensures this project runs as an isolated process.
1. **Install PM2** (if not already present): `npm install -g pm2`
2. **Start the App**:
   ```bash
   # We use a unique name to avoid conflict with other apps
   PORT=3000 pm2 start server.js --name "wasiyat-app"
   ```
   *Note: If port 3000 is used by another project, change it to 3001 or 3002.*

## 4. Isolated Nginx Configuration
We use Nginx Virtual Hosts to ensure this domain only points to this specific app.
1. **Create Config**:
   ```bash
   sudo nano /etc/nginx/sites-available/wasiyat
   ```
2. **Paste the Config**: (Use the [nginx.conf](file:///C:/Users/Sage/.gemini/antigravity/brain/f3cb0b44-0bf0-4e7d-bf1e-7f3962a9b293/nginx.conf) generated earlier).
3. **Enable & Test**:
   ```bash
   sudo ln -s /etc/nginx/sites-available/wasiyat /etc/nginx/sites-enabled/
   sudo nginx -t
   sudo systemctl restart nginx
   ```

## 5. Security & Isolation
- **No Impact**: Since Nginx uses `server_name` to route traffic, your other projects (e.g., `client-site.com` or `blog.com`) will remain untouched. Only traffic for `wasiyat.com` will hit this app.
- **Port Safety**: The `PORT=3000` is internal. It is blocked by the VPS firewall from outside access; only Nginx can talk to it locally.

## Summary Checklist
- [ ] Unique process name in PM2.
- [ ] Unique internal port.
- [ ] Explicit `server_name` in Nginx config.
- [ ] Isolated filesystem directory.
