# cPanel / CloudLinux Node Deployment Notes

1. Zip this project folder.
2. Upload to your Node app directory in cPanel.
3. Extract the files.
4. In cPanel Node.js Selector:
   - Application root: the extracted project folder
   - Startup file: `app.js`
   - Node version: 18+
5. Create `.env` from `.env.example`.
6. Run `npm install` from cPanel's Node interface if available.
7. Start/restart the app.
8. Confirm the health endpoint:

```text
https://your-domain.com/api/health
```

9. Set Telnyx URLs:

TeXML inbound:

```text
https://your-domain.com/telnyx/texml/inbound
```

Webhook events:

```text
https://your-domain.com/telnyx/events
```

10. Login at `/login.html` using your `.env` super admin account. `ADMIN_API_KEY` is only for Telnyx assistant tool authentication.

## File persistence warning

The database is `data/db.json`. Do not overwrite this file once live unless you want to reset leads.

Back up:

```text
data/db.json
.env
```

## v0.1.1 cPanel startup file note

Some cPanel / CloudLinux Node.js Selector installs reset the startup file back to `app.js` even when `src/server.js` is entered manually. Version `v0.1.1` includes a root-level `app.js` launcher that loads `src/server.js`.

For cPanel, use:

```text
Application startup file: app.js
```

Do not use `public/app.js`. That is browser dashboard JavaScript and is not the server startup file.

## v0.1.2 auth note

Use `app.js` as the startup file.

Add these `.env` values before restart:

```env
SUPER_ADMIN_EMAIL=your-email@example.com
SUPER_ADMIN_PASSWORD=use-a-strong-password-here
SUPER_ADMIN_NAME=Super Admin
AUTH_SESSION_SECRET=make-this-long-random-and-private
SYNC_SUPER_ADMIN_PASSWORD=false
```

After restart, login at:

```text
https://pestdemo.recovermissedcall.com/login.html
```

The old dashboard API-key field has been removed. `ADMIN_API_KEY` remains only for Telnyx tool/webhook authentication.


## v0.1.3 UI note

Version `v0.1.3` updates the interface only. It adds the Recover Missed Call-style navy/blue/teal design, dark mode, and 60-second automatic refresh.

When uploading this version, keep your live files:

```text
.env
data/db.json
```

The cPanel startup file should remain:

```text
app.js
```


## v0.1.8 Final Lead Capture

See `FINAL_LEAD_CAPTURE_V0_1_7.md` for the post-call/final lead saving setup, caller ID fallback, and required Telnyx tool body parameters.
