# NFC-Admin — cPanel subdomain ONLY (React)

**Domain:** https://nfc.admin.erupai.com  
**This is separate from the API Podman stack** (`/home/erupaiin/code/nfc/backend`).

---

## Server paths

| Path | Role |
|------|------|
| `/home/erupaiin/public_html/nfc.admin.erupai.com/` | Apache **document root** (live site) |
| `/home/erupaiin/public_html/nfc.admin.erupai.com/code/NFC-Admin.zip` | Upload source zip here |
| `/home/erupaiin/public_html/nfc.admin.erupai.com/code/NFC-Admin/` | Unzipped source (after deploy) |
| `/home/erupaiin/code/nfc/backend/` | API only — do not put Admin here |

---

## 1) Upload zip (from your PC)

Zip the `NFC-Admin` project (include `package.json`, `src/`, `Containerfile`, etc. — exclude `node_modules` if you want), then upload to:

```text
/home/erupaiin/public_html/nfc.admin.erupai.com/code/NFC-Admin.zip
```

Create `code/` in File Manager if it does not exist.

---

## 2) Deploy (ROOT or account shell)

### Recommended — static files into docroot (Apache hosts the site)

```text
cd /home/erupaiin/public_html/nfc.admin.erupai.com/code
# unzip first so scripts exist, OR run from a machine where scripts are already extracted once:
unzip -qo NFC-Admin.zip -d .
cd NFC-Admin
sed -i 's/\r$//' scripts/deploy-from-zip.sh
chmod +x scripts/deploy-from-zip.sh
sh scripts/deploy-from-zip.sh static
```

Opens: **https://nfc.admin.erupai.com**

### Optional — Podman always-on on :8210

```text
sh scripts/deploy-from-zip.sh podman
```

Then in WHM / subdomain Apache:

```apache
ProxyPass / http://127.0.0.1:8210/
ProxyPassReverse / http://127.0.0.1:8210/
```

---

## 3) API URL baked at build

Default:

```text
http://66.116.206.165:8201/api/v1
```

With Apache API proxy:

```text
export VITE_API_BASE_URL=https://erupai.in/eyerexus-api/v1
sh scripts/deploy-from-zip.sh static
```

---

## Quick re-publish after new zip upload

```text
cd /home/erupaiin/public_html/nfc.admin.erupai.com/code/NFC-Admin
sh scripts/deploy-from-zip.sh static
```

---

## Checklist

- [ ] Subdomain `nfc.admin.erupai.com` points at `public_html/nfc.admin.erupai.com`
- [ ] `NFC-Admin.zip` uploaded under `code/`
- [ ] Deploy script ran (`static` mode)
- [ ] Backend API up on `8201` (separate stack)
- [ ] Login works with server `ADMIN_PASSWORD`
