# Namecheap deployment strategy

Create `clients.clickmagnets.co` in cPanel and set its document root to `~/clickmagnets-portal/public`. Put the Laravel application at `~/clickmagnets-portal`, the `.env` there, and private storage at `~/clickmagnets-storage`; none of these are under `public_html`.

1. On a local machine with PHP 8.3+, Composer, and Node: install dependencies, run `npm ci && npm run build`, then `composer install --no-dev --optimize-autoloader` for a release artifact.
2. Upload/extract the release above the web root through File Manager or SFTP. If SSH exists, run `php artisan migrate --force`, `php artisan storage:link` only for deliberately public assets, and `php artisan optimize`.
3. In cPanel, create the database/user, complete `.env`, set PHP 8.3+, enable HTTPS, and make `storage` and `bootstrap/cache` writable by the PHP user.
4. Add a cron job every minute: `* * * * * /usr/local/bin/php /home/CPANEL_USER/clickmagnets-portal/artisan schedule:run >> /dev/null 2>&1`. Confirm the PHP path in cPanel Terminal/Select PHP Version first.
5. If no SSH is available, run migrations locally against a temporary empty MySQL database, export the resulting structure, import it only as a bootstrap fallback, and retain the migrations as the source of truth. Prefer enabling SSH.

Never point the subdomain at the Laravel project root. Production is `APP_ENV=production`, `APP_DEBUG=false`, HTTPS, secure cookies, database queue/cache/session, and SMTP credentials only in `.env`.
