# Bridge Frontend Deployment Checklist ✅

## Domain: cross-all.defi-oracle.io

### Pre-Deployment

- [x] ✅ Domain assigned: `cross-all.defi-oracle.io`
- [x] ✅ Deployment script created: `deploy.sh`
- [x] ✅ Nginx configuration created: `nginx.conf`
- [x] ✅ Production build exists: `dist/` (13MB)
- [x] ✅ Development server running: `http://localhost:3002`
- [x] ✅ VMID identified: 2101 (besu-rpc-core-1 on ml110)
- [x] ✅ Bridge frontend deployed to VMID 2101
- [x] ✅ Nginx configured and running
- [x] ✅ HTTP 200 OK verified
- [x] ✅ NPMplus proxy host configured (via API or manual)
- [ ] ⚠️  DNS record configured (A record for cross-all.defi-oracle.io)

### Step 1: Find Available VMID

```bash
cd /home/intlc/projects/proxmox/smom-dbis-138/frontend-dapp
./check-vmids.sh [proxmox-host]

# Example:
./check-vmids.sh 192.168.11.12
```

**Expected Output:**
- List of available VMIDs
- VMID 7810 marked as reserved for mim4u.org
- Recommendation for bridge frontend VMID

### Step 2: Deploy Bridge Frontend

```bash
cd /home/intlc/projects/proxmox/smom-dbis-138/frontend-dapp

# Deploy to identified VMID
./deploy.sh 192.168.11.12 [BRIDGE_VMID]

# Example (replace [BRIDGE_VMID] with actual VMID):
./deploy.sh 192.168.11.12 7811
```

**What the script does:**
1. ✅ Builds production bundle (if not recent)
2. ✅ Creates deployment tarball
3. ✅ Transfers to Proxmox host
4. ✅ Extracts to `/var/www/html/bridge-dapp` on VM
5. ✅ Configures nginx with domain `cross-all.defi-oracle.io`
6. ✅ Restarts nginx
7. ✅ Verifies deployment

### Step 3: Configure NPMplus

1. **Login to NPMplus Dashboard**
   - Access: `https://[NPMplus-IP]:81`

2. **Create Proxy Host**
   - Click "Proxy Hosts" → "Add Proxy Host"

3. **Details Tab:**
   ```
   Domain Names: cross-all.defi-oracle.io
   Scheme: http
   Forward Hostname/IP: [BRIDGE_VM_IP]
   Forward Port: 80
   Cache Assets: ✅ Enabled
   Block Common Exploits: ✅ Enabled
   Websockets Support: ✅ Enabled
   ```

4. **SSL Tab:**
   ```
   SSL Certificate: Request new SSL Certificate
   Force SSL: ✅ Enabled
   HTTP/2 Support: ✅ Enabled
   HSTS Enabled: ✅ Enabled
   HSTS Subdomains: ✅ Enabled (optional)
   ```

5. **Advanced Tab (Optional):**
   ```nginx
   # Add custom security headers
   add_header X-Frame-Options "SAMEORIGIN" always;
   add_header X-Content-Type-Options "nosniff" always;
   add_header X-XSS-Protection "1; mode=block" always;
   ```

6. **Save and Test**

### Step 4: Configure DNS

**DNS A Record:**
```
Type: A
Name: cross-all
Domain: defi-oracle.io
Value: [NPMplus Server Public IP]
TTL: 300 (or auto)
```

**Verify DNS:**
```bash
dig cross-all.defi-oracle.io +short
# Should return NPMplus server IP
```

### Step 5: Verify Deployment

**Test Direct VM Access:**
```bash
curl -I http://[BRIDGE_VM_IP]/
# Should return HTTP 200
```

**Test Domain Access:**
```bash
curl -I https://cross-all.defi-oracle.io/
# Should return HTTP 200 with SSL certificate
```

**Test Admin Panel:**
```bash
curl -I https://cross-all.defi-oracle.io/admin
# Should return HTTP 200
```

**Browser Tests:**
- [ ] ✅ Main page loads: `https://cross-all.defi-oracle.io/`
- [ ] ✅ Admin panel loads: `https://cross-all.defi-oracle.io/admin`
- [ ] ✅ SSL certificate valid
- [ ] ✅ Security headers present
- [ ] ✅ Wallet connection works
- [ ] ✅ Contract interactions work

### Step 6: Post-Deployment

- [ ] ✅ Monitor logs for errors
- [ ] ✅ Test all admin panel features
- [ ] ✅ Verify real-time monitoring works
- [ ] ✅ Check mobile responsiveness
- [ ] ✅ Verify backup/restore functions

## Quick Reference

**Domain:** `cross-all.defi-oracle.io`
**Purpose:** Bridge DApp Admin Panel (Mainnet Tether, Transaction Mirror, 2-Way Bridge)
**VMID (mim4u.org):** 7810 (separate deployment)
**VMID (Bridge):** [TO BE DETERMINED]
**Web Root:** `/var/www/html/bridge-dapp`
**Nginx Config:** `/etc/nginx/sites-available/bridge-dapp`

## Troubleshooting

### Deployment Fails
- Check VMID exists: `ssh root@[proxmox-host] "pct list"`
- Verify nginx is installed on VM
- Check VM has internet access

### NPMplus Configuration Issues
- Verify DNS points to NPMplus server
- Check NPMplus can reach bridge VM IP
- Verify SSL certificate was issued

### Domain Not Resolving
- Check DNS propagation: `dig cross-all.defi-oracle.io`
- Verify DNS record is correct
- Check DNS TTL (may need to wait)

---

**Last Updated**: 2025-01-22
