# Nexus Live cPanel Deploy

## Target

Use this project as a single Node.js app on cPanel for `live.testder.com`.

The app now runs:

- Next.js pages and API routes
- Socket.io realtime updates
- JSON config storage in `obs-configs.json`

through one startup file:

```text
server.js
```

## Recommended cPanel Settings

- Node.js version: `22.x`
- Application mode: `Production`
- Application root: `/home/atestderc/live_nexus`
- Application URL: `live.testder.com`
- Application startup file: `server.js`

Do not point this app to `/home/atestderc/public_html`.

## Terminal Commands

If cPanel Terminal still defaults to Node 10, put Node 22 first in `PATH`:

```bash
cd ~/live_nexus
export PATH=/opt/alt/alt-nodejs22/root/usr/bin:$PATH
hash -r
npm install
npm run build:cpanel
```

Use `npm run build` on the development machine before uploading when you want the full TypeScript check.

Then restart the app from **Setup Node.js App**.

## Environment Variables

Usually no socket URL is required in production because the browser connects to the same origin.

Optional:

```text
NODE_ENV=production
SOCKET_CORS_ORIGIN=https://live.testder.com
```

For local development, the app automatically uses:

```text
http://localhost:4000
```

when opened from `http://localhost:3000`.

## HTTPS

Enable Force HTTPS Redirect only after SSL is active for `live.testder.com`.
