# cPanel deployment for crm.microcode.email

Target subdomain: `crm.microcode.email`

Target folder: `public_html/crm.microcode.email`

This project is a Node/Express CRM app. The `/admin` CRM needs the Express API and SQLite database, so do not deploy only `server/public` unless you only want a static placeholder.

## cPanel Node.js setup

1. Open cPanel > Setup Node.js App.
2. Create or edit the application for `crm.microcode.email`.
3. Set application root to the folder that contains this project.
4. Set startup file to `server/server.js`.
5. Run `npm install --omit=dev`.
6. Run `npm run build` before restart if rebuilding on the server.
7. Restart the Node.js app.

## Environment values

Set these values for the cPanel Node.js app:

```env
NODE_ENV=production
APP_URL=https://crm.microcode.email
CLIENT_ORIGIN=https://crm.microcode.email
DATABASE_PATH=server/db/office365.sqlite
SESSION_SECRET=<keep-current-live-secret-or-generate-long-random-value>
SMTP_ENCRYPTION_KEY=<keep-current-live-secret-or-generate-long-random-value>
PASSWORD_RESET_SECRET=<keep-current-live-secret-or-generate-long-random-value>
```

Keep the existing SMTP and admin settings from the live CRM if this is replacing an existing deployment.

## Public site behavior

The public website now only displays `Microcode CRM` and admin access buttons. The old public plan, preview, checkout, and support marketing pages are hidden. The CRM functionality remains inside `/admin`.
