# NordSafe EHS — Deployment Notes

## cPanel Shared Hosting (Node.js 18)

### Problem: WebAssembly disabled

Run the app with: `node --no-experimental-fetch index.js`

### Start the app manually:

```bash
source ~/nodevenv/test-backend/18/bin/activate
cd ~/test-backend
node --no-experimental-fetch index.js > app.log 2>&1 &
disown
```

### Create super admin:

```bash
node scripts/createSuperAdmin.js YourPassword
```

### .htaccess for api subdomain:

```apache
RewriteEngine On
RewriteRule ^$ http://localhost:3001/ [P,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ http://localhost:3001/$1 [P,L]
```

### .htaccess for frontend subdomain:

```apache
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
```
