# Hosting the SQLite Version on cPanel / HostKoala

This version uses `sql.js`, which is SQLite compiled to WebAssembly. It does not require native Node module compilation.

## Normal cPanel flow

1. Upload the app files.
2. Set up the Node.js app with `app.js` as the startup file.
3. Set environment variables or create `.env`.
4. Run **NPM Install** from the Node.js App screen.
5. Restart the app.
6. Visit `/health` and `/admin`.

## Database file

Default database:

```text
pestlead.sqlite
```

Back up this file regularly.

## If NPM Install fails

Because this version uses `sql.js`, install problems are more likely to be general Node/cPanel issues rather than SQLite build-tool issues. Try:

1. Delete `node_modules`.
2. Run NPM Install again.
3. Confirm Node version is 18+.
4. Ask HostKoala support to confirm Node.js app dependencies can be installed from npm.

## Migration

If an older `data.json` exists and `pestlead.sqlite` is empty, the app will import the old leads/settings automatically.
